2024-07-03 15:00:56 +00:00
|
|
|
package projection
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/zitadel/zitadel/internal/eventstore"
|
|
|
|
"github.com/zitadel/zitadel/internal/eventstore/handler/v2"
|
|
|
|
"github.com/zitadel/zitadel/internal/repository/org"
|
|
|
|
"github.com/zitadel/zitadel/internal/repository/project"
|
|
|
|
)
|
|
|
|
|
2024-07-05 07:36:00 +00:00
|
|
|
const (
|
|
|
|
fieldsProjectGrant = "project_grant_fields"
|
|
|
|
fieldsOrgDomainVerified = "org_domain_verified_fields"
|
|
|
|
)
|
|
|
|
|
2024-07-03 15:00:56 +00:00
|
|
|
func newFillProjectGrantFields(config handler.Config) *handler.FieldHandler {
|
|
|
|
return handler.NewFieldHandler(
|
|
|
|
&config,
|
2024-07-05 07:36:00 +00:00
|
|
|
fieldsProjectGrant,
|
2024-07-03 15:00:56 +00:00
|
|
|
map[eventstore.AggregateType][]eventstore.EventType{
|
|
|
|
org.AggregateType: nil,
|
|
|
|
project.AggregateType: nil,
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
2024-07-05 07:36:00 +00:00
|
|
|
|
|
|
|
func newFillOrgDomainVerifiedFields(config handler.Config) *handler.FieldHandler {
|
|
|
|
return handler.NewFieldHandler(
|
|
|
|
&config,
|
|
|
|
fieldsOrgDomainVerified,
|
|
|
|
map[eventstore.AggregateType][]eventstore.EventType{
|
|
|
|
org.AggregateType: {
|
|
|
|
org.OrgDomainAddedEventType,
|
|
|
|
org.OrgDomainVerifiedEventType,
|
|
|
|
org.OrgDomainRemovedEventType,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|