2022-03-24 17:21:34 +01:00
|
|
|
package model
|
|
|
|
|
|
|
|
import (
|
2023-10-19 12:19:10 +02:00
|
|
|
"github.com/zitadel/zitadel/internal/eventstore"
|
2022-04-27 01:01:45 +02:00
|
|
|
iam_es_model "github.com/zitadel/zitadel/internal/iam/repository/eventsourcing/model"
|
2022-03-24 17:21:34 +01:00
|
|
|
)
|
|
|
|
|
2023-10-19 12:19:10 +02:00
|
|
|
func (o *Org) appendAddDomainPolicyEvent(event eventstore.Event) error {
|
2022-03-24 17:21:34 +01:00
|
|
|
o.DomainPolicy = new(iam_es_model.DomainPolicy)
|
|
|
|
err := o.DomainPolicy.SetData(event)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2023-10-19 12:19:10 +02:00
|
|
|
o.DomainPolicy.ObjectRoot.CreationDate = event.CreatedAt()
|
2022-03-24 17:21:34 +01:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-10-19 12:19:10 +02:00
|
|
|
func (o *Org) appendChangeDomainPolicyEvent(event eventstore.Event) error {
|
2022-03-24 17:21:34 +01:00
|
|
|
return o.DomainPolicy.SetData(event)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *Org) appendRemoveDomainPolicyEvent() {
|
|
|
|
o.DomainPolicy = nil
|
|
|
|
}
|