feat: delete organizations (#6083)

* feat: delete organizations

* feat: tests and delete all that depends on org

* fix: grpc delete description

* fix: get back reduce OrgRemovedEvent

* fix: add @muhlemmer review suggestions

* fix: new e2e for add/delete org
This commit is contained in:
Miguel Cabrerizo
2023-09-07 06:54:51 +02:00
committed by GitHub
parent 0f06e84f40
commit dd80109969
86 changed files with 166 additions and 495 deletions

View File

@@ -574,30 +574,21 @@ func (p *loginNameProjection) reduceOwnerRemoved(event eventstore.Event) (*handl
return crdb.NewMultiStatement(
event,
crdb.AddUpdateStatement(
[]handler.Column{
handler.NewCol(LoginNameDomainOwnerRemovedCol, true),
},
crdb.AddDeleteStatement(
[]handler.Condition{
handler.NewCond(LoginNameDomainInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(LoginNameDomainResourceOwnerCol, e.Aggregate().ID),
},
crdb.WithTableSuffix(loginNameDomainSuffix),
),
crdb.AddUpdateStatement(
[]handler.Column{
handler.NewCol(LoginNamePoliciesOwnerRemovedCol, true),
},
crdb.AddDeleteStatement(
[]handler.Condition{
handler.NewCond(LoginNamePoliciesInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(LoginNamePoliciesResourceOwnerCol, e.Aggregate().ID),
},
crdb.WithTableSuffix(loginNamePolicySuffix),
),
crdb.AddUpdateStatement(
[]handler.Column{
handler.NewCol(LoginNameUserOwnerRemovedCol, true),
},
crdb.AddDeleteStatement(
[]handler.Condition{
handler.NewCond(LoginNameUserInstanceIDCol, e.Aggregate().InstanceID),
handler.NewCond(LoginNameUserResourceOwnerCol, e.Aggregate().ID),