mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:47:32 +00:00
state
This commit is contained in:
@@ -45,7 +45,7 @@ func TestCreateOrganization(t *testing.T) {
|
|||||||
ID: organizationId,
|
ID: organizationId,
|
||||||
Name: organizationName,
|
Name: organizationName,
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
return organization
|
return organization
|
||||||
}(),
|
}(),
|
||||||
@@ -59,7 +59,7 @@ func TestCreateOrganization(t *testing.T) {
|
|||||||
ID: organizationId,
|
ID: organizationId,
|
||||||
Name: "",
|
Name: "",
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
return organization
|
return organization
|
||||||
}(),
|
}(),
|
||||||
@@ -76,7 +76,7 @@ func TestCreateOrganization(t *testing.T) {
|
|||||||
ID: organizationId,
|
ID: organizationId,
|
||||||
Name: organizationName,
|
Name: organizationName,
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
|
|
||||||
err := organizationRepo.Create(ctx, &org)
|
err := organizationRepo.Create(ctx, &org)
|
||||||
@@ -98,7 +98,7 @@ func TestCreateOrganization(t *testing.T) {
|
|||||||
ID: organizationId,
|
ID: organizationId,
|
||||||
Name: organizationName,
|
Name: organizationName,
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
|
|
||||||
err := organizationRepo.Create(ctx, &org)
|
err := organizationRepo.Create(ctx, &org)
|
||||||
@@ -147,7 +147,7 @@ func TestCreateOrganization(t *testing.T) {
|
|||||||
ID: gofakeit.Name(),
|
ID: gofakeit.Name(),
|
||||||
Name: organizationName,
|
Name: organizationName,
|
||||||
InstanceID: instId,
|
InstanceID: instId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
|
|
||||||
err = organizationRepo.Create(ctx, &org)
|
err = organizationRepo.Create(ctx, &org)
|
||||||
@@ -163,7 +163,7 @@ func TestCreateOrganization(t *testing.T) {
|
|||||||
ID: orgID,
|
ID: orgID,
|
||||||
Name: organizationName,
|
Name: organizationName,
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}(),
|
}(),
|
||||||
@@ -176,7 +176,7 @@ func TestCreateOrganization(t *testing.T) {
|
|||||||
// ID: organizationId,
|
// ID: organizationId,
|
||||||
Name: organizationName,
|
Name: organizationName,
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
return organization
|
return organization
|
||||||
}(),
|
}(),
|
||||||
@@ -190,7 +190,7 @@ func TestCreateOrganization(t *testing.T) {
|
|||||||
organization := domain.Organization{
|
organization := domain.Organization{
|
||||||
ID: organizationId,
|
ID: organizationId,
|
||||||
Name: organizationName,
|
Name: organizationName,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
return organization
|
return organization
|
||||||
}(),
|
}(),
|
||||||
@@ -205,7 +205,7 @@ func TestCreateOrganization(t *testing.T) {
|
|||||||
ID: organizationId,
|
ID: organizationId,
|
||||||
Name: organizationName,
|
Name: organizationName,
|
||||||
InstanceID: gofakeit.Name(),
|
InstanceID: gofakeit.Name(),
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
return organization
|
return organization
|
||||||
}(),
|
}(),
|
||||||
@@ -283,7 +283,7 @@ func TestUpdateOrganization(t *testing.T) {
|
|||||||
ID: organizationId,
|
ID: organizationId,
|
||||||
Name: organizationName,
|
Name: organizationName,
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
|
|
||||||
// create organization
|
// create organization
|
||||||
@@ -307,7 +307,7 @@ func TestUpdateOrganization(t *testing.T) {
|
|||||||
ID: organizationId,
|
ID: organizationId,
|
||||||
Name: organizationName,
|
Name: organizationName,
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
|
|
||||||
// create organization
|
// create organization
|
||||||
@@ -336,7 +336,7 @@ func TestUpdateOrganization(t *testing.T) {
|
|||||||
ID: organizationId,
|
ID: organizationId,
|
||||||
Name: organizationName,
|
Name: organizationName,
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
|
|
||||||
// create organization
|
// create organization
|
||||||
@@ -344,7 +344,7 @@ func TestUpdateOrganization(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
// update with updated value
|
// update with updated value
|
||||||
org.State = domain.OrgStateInactive.String()
|
org.State = domain.OrgStateInactive
|
||||||
return &org
|
return &org
|
||||||
},
|
},
|
||||||
update: []database.Change{organizationRepo.SetState(domain.OrgStateInactive)},
|
update: []database.Change{organizationRepo.SetState(domain.OrgStateInactive)},
|
||||||
@@ -427,7 +427,7 @@ func TestGetOrganization(t *testing.T) {
|
|||||||
ID: gofakeit.Name(),
|
ID: gofakeit.Name(),
|
||||||
Name: gofakeit.Name(),
|
Name: gofakeit.Name(),
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
err = orgRepo.Create(t.Context(), &org)
|
err = orgRepo.Create(t.Context(), &org)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
@@ -451,7 +451,7 @@ func TestGetOrganization(t *testing.T) {
|
|||||||
ID: organizationId,
|
ID: organizationId,
|
||||||
Name: organizationName,
|
Name: organizationName,
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
|
|
||||||
// create organization
|
// create organization
|
||||||
@@ -474,7 +474,7 @@ func TestGetOrganization(t *testing.T) {
|
|||||||
ID: organizationId,
|
ID: organizationId,
|
||||||
Name: organizationName,
|
Name: organizationName,
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
|
|
||||||
// create organization
|
// create organization
|
||||||
@@ -572,7 +572,7 @@ func TestListOrganization(t *testing.T) {
|
|||||||
ID: gofakeit.Name(),
|
ID: gofakeit.Name(),
|
||||||
Name: gofakeit.Name(),
|
Name: gofakeit.Name(),
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
|
|
||||||
// create organization
|
// create organization
|
||||||
@@ -596,7 +596,7 @@ func TestListOrganization(t *testing.T) {
|
|||||||
ID: gofakeit.Name(),
|
ID: gofakeit.Name(),
|
||||||
Name: gofakeit.Name(),
|
Name: gofakeit.Name(),
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
|
|
||||||
// create organization
|
// create organization
|
||||||
@@ -621,7 +621,7 @@ func TestListOrganization(t *testing.T) {
|
|||||||
ID: gofakeit.Name(),
|
ID: gofakeit.Name(),
|
||||||
Name: gofakeit.Name(),
|
Name: gofakeit.Name(),
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
err = organizationRepo.Create(ctx, &org)
|
err = organizationRepo.Create(ctx, &org)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
@@ -634,7 +634,7 @@ func TestListOrganization(t *testing.T) {
|
|||||||
ID: organizationId,
|
ID: organizationId,
|
||||||
Name: gofakeit.Name(),
|
Name: gofakeit.Name(),
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
|
|
||||||
// create organization
|
// create organization
|
||||||
@@ -659,7 +659,7 @@ func TestListOrganization(t *testing.T) {
|
|||||||
ID: gofakeit.Name(),
|
ID: gofakeit.Name(),
|
||||||
Name: gofakeit.Name(),
|
Name: gofakeit.Name(),
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
err = organizationRepo.Create(ctx, &org)
|
err = organizationRepo.Create(ctx, &org)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
@@ -672,7 +672,7 @@ func TestListOrganization(t *testing.T) {
|
|||||||
ID: gofakeit.Name(),
|
ID: gofakeit.Name(),
|
||||||
Name: gofakeit.Name(),
|
Name: gofakeit.Name(),
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateInactive.String(),
|
State: domain.OrgStateInactive,
|
||||||
}
|
}
|
||||||
|
|
||||||
// create organization
|
// create organization
|
||||||
@@ -713,7 +713,7 @@ func TestListOrganization(t *testing.T) {
|
|||||||
ID: gofakeit.Name(),
|
ID: gofakeit.Name(),
|
||||||
Name: gofakeit.Name(),
|
Name: gofakeit.Name(),
|
||||||
InstanceID: instanceId_1,
|
InstanceID: instanceId_1,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
err = organizationRepo.Create(ctx, &org)
|
err = organizationRepo.Create(ctx, &org)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
@@ -739,7 +739,7 @@ func TestListOrganization(t *testing.T) {
|
|||||||
ID: gofakeit.Name(),
|
ID: gofakeit.Name(),
|
||||||
Name: gofakeit.Name(),
|
Name: gofakeit.Name(),
|
||||||
InstanceID: instanceId_2,
|
InstanceID: instanceId_2,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
|
|
||||||
// create organization
|
// create organization
|
||||||
@@ -822,7 +822,7 @@ func TestDeleteOrganization(t *testing.T) {
|
|||||||
ID: organizationId,
|
ID: organizationId,
|
||||||
Name: gofakeit.Name(),
|
Name: gofakeit.Name(),
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
|
|
||||||
// create organization
|
// create organization
|
||||||
@@ -850,7 +850,7 @@ func TestDeleteOrganization(t *testing.T) {
|
|||||||
ID: gofakeit.Name(),
|
ID: gofakeit.Name(),
|
||||||
Name: organizationName,
|
Name: organizationName,
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
|
|
||||||
// create organization
|
// create organization
|
||||||
@@ -886,7 +886,7 @@ func TestDeleteOrganization(t *testing.T) {
|
|||||||
ID: gofakeit.Name(),
|
ID: gofakeit.Name(),
|
||||||
Name: organizationName,
|
Name: organizationName,
|
||||||
InstanceID: instanceId,
|
InstanceID: instanceId,
|
||||||
State: domain.OrgStateActive.String(),
|
State: domain.OrgStateActive,
|
||||||
}
|
}
|
||||||
|
|
||||||
// create organization
|
// create organization
|
||||||
|
@@ -81,7 +81,7 @@ func (p *orgRelationalProjection) reduceOrgRelationalAdded(event eventstore.Even
|
|||||||
handler.NewCol(OrgColumnID, e.Aggregate().ID),
|
handler.NewCol(OrgColumnID, e.Aggregate().ID),
|
||||||
handler.NewCol(OrgColumnName, e.Name),
|
handler.NewCol(OrgColumnName, e.Name),
|
||||||
handler.NewCol(OrgColumnInstanceID, e.Aggregate().InstanceID),
|
handler.NewCol(OrgColumnInstanceID, e.Aggregate().InstanceID),
|
||||||
handler.NewCol(State, repoDomain.OrgStateActive.String()),
|
handler.NewCol(State, repoDomain.OrgStateActive),
|
||||||
handler.NewCol(CreatedAt, e.CreationDate()),
|
handler.NewCol(CreatedAt, e.CreationDate()),
|
||||||
handler.NewCol(UpdatedAt, e.CreationDate()),
|
handler.NewCol(UpdatedAt, e.CreationDate()),
|
||||||
},
|
},
|
||||||
@@ -118,7 +118,7 @@ func (p *orgRelationalProjection) reduceOrgRelationalDeactivated(event eventstor
|
|||||||
return handler.NewUpdateStatement(
|
return handler.NewUpdateStatement(
|
||||||
e,
|
e,
|
||||||
[]handler.Column{
|
[]handler.Column{
|
||||||
handler.NewCol(State, repoDomain.OrgStateInactive.String()),
|
handler.NewCol(State, repoDomain.OrgStateInactive),
|
||||||
handler.NewCol(UpdatedAt, e.CreationDate()),
|
handler.NewCol(UpdatedAt, e.CreationDate()),
|
||||||
},
|
},
|
||||||
[]handler.Condition{
|
[]handler.Condition{
|
||||||
@@ -136,7 +136,7 @@ func (p *orgRelationalProjection) reduceOrgRelationalReactivated(event eventstor
|
|||||||
return handler.NewUpdateStatement(
|
return handler.NewUpdateStatement(
|
||||||
e,
|
e,
|
||||||
[]handler.Column{
|
[]handler.Column{
|
||||||
handler.NewCol(State, repoDomain.OrgStateActive.String()),
|
handler.NewCol(State, repoDomain.OrgStateActive),
|
||||||
handler.NewCol(UpdatedAt, e.CreationDate()),
|
handler.NewCol(UpdatedAt, e.CreationDate()),
|
||||||
},
|
},
|
||||||
[]handler.Condition{
|
[]handler.Condition{
|
||||||
|
Reference in New Issue
Block a user