mirror of
https://github.com/zitadel/zitadel.git
synced 2025-11-14 14:43:19 +00:00
fix: all enums same style (#262)
* fix: all enums same style * fix: rename process to reduce * add some missing enum renaming Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
@@ -72,12 +72,12 @@ func (g *UserGrant) AppendEvent(event *es_models.Event) error {
|
||||
UserGrantCascadeChanged:
|
||||
return g.setData(event)
|
||||
case UserGrantDeactivated:
|
||||
g.appendGrantStateEvent(model.USERGRANTSTATE_INACTIVE)
|
||||
g.appendGrantStateEvent(model.UserGrantStateInactive)
|
||||
case UserGrantReactivated:
|
||||
g.appendGrantStateEvent(model.USERGRANTSTATE_ACTIVE)
|
||||
g.appendGrantStateEvent(model.UserGrantStateActive)
|
||||
case UserGrantRemoved,
|
||||
UserGrantCascadeRemoved:
|
||||
g.appendGrantStateEvent(model.USERGRANTSTATE_REMOVED)
|
||||
g.appendGrantStateEvent(model.UserGrantStateRemoved)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -24,9 +24,9 @@ func TestAppendGrantStateEvent(t *testing.T) {
|
||||
existing: &UserGrant{ObjectRoot: es_models.ObjectRoot{AggregateID: "ID"}, UserID: "UserID", ProjectID: "ProjectID", RoleKeys: []string{"Key"}},
|
||||
grant: &UserGrantID{GrantID: "GrantID"},
|
||||
event: &es_models.Event{},
|
||||
state: model.USERGRANTSTATE_INACTIVE,
|
||||
state: model.UserGrantStateInactive,
|
||||
},
|
||||
result: &UserGrant{ObjectRoot: es_models.ObjectRoot{AggregateID: "ID"}, UserID: "UserID", ProjectID: "ProjectID", RoleKeys: []string{"Key"}, State: int32(model.USERGRANTSTATE_INACTIVE)},
|
||||
result: &UserGrant{ObjectRoot: es_models.ObjectRoot{AggregateID: "ID"}, UserID: "UserID", ProjectID: "ProjectID", RoleKeys: []string{"Key"}, State: int32(model.UserGrantStateInactive)},
|
||||
},
|
||||
{
|
||||
name: "append reactivate grant event",
|
||||
@@ -34,9 +34,9 @@ func TestAppendGrantStateEvent(t *testing.T) {
|
||||
existing: &UserGrant{ObjectRoot: es_models.ObjectRoot{AggregateID: "ID"}, UserID: "UserID", ProjectID: "ProjectID", RoleKeys: []string{"Key"}},
|
||||
grant: &UserGrantID{GrantID: "GrantID"},
|
||||
event: &es_models.Event{},
|
||||
state: model.USERGRANTSTATE_ACTIVE,
|
||||
state: model.UserGrantStateActive,
|
||||
},
|
||||
result: &UserGrant{ObjectRoot: es_models.ObjectRoot{AggregateID: "ID"}, UserID: "UserID", ProjectID: "ProjectID", RoleKeys: []string{"Key"}, State: int32(model.USERGRANTSTATE_ACTIVE)},
|
||||
result: &UserGrant{ObjectRoot: es_models.ObjectRoot{AggregateID: "ID"}, UserID: "UserID", ProjectID: "ProjectID", RoleKeys: []string{"Key"}, State: int32(model.UserGrantStateActive)},
|
||||
},
|
||||
{
|
||||
name: "append remove grant event",
|
||||
@@ -44,9 +44,9 @@ func TestAppendGrantStateEvent(t *testing.T) {
|
||||
existing: &UserGrant{ObjectRoot: es_models.ObjectRoot{AggregateID: "ID"}, UserID: "UserID", ProjectID: "ProjectID", RoleKeys: []string{"Key"}},
|
||||
grant: &UserGrantID{GrantID: "GrantID"},
|
||||
event: &es_models.Event{},
|
||||
state: model.USERGRANTSTATE_REMOVED,
|
||||
state: model.UserGrantStateRemoved,
|
||||
},
|
||||
result: &UserGrant{ObjectRoot: es_models.ObjectRoot{AggregateID: "ID"}, UserID: "UserID", ProjectID: "ProjectID", RoleKeys: []string{"Key"}, State: int32(model.USERGRANTSTATE_REMOVED)},
|
||||
result: &UserGrant{ObjectRoot: es_models.ObjectRoot{AggregateID: "ID"}, UserID: "UserID", ProjectID: "ProjectID", RoleKeys: []string{"Key"}, State: int32(model.UserGrantStateRemoved)},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
|
||||
Reference in New Issue
Block a user