This commit is contained in:
adlerhurst
2025-08-05 16:57:05 +02:00
parent 5a75e9d558
commit caf4090db9
5 changed files with 152 additions and 124 deletions

View File

@@ -78,12 +78,7 @@ func (cmd *CreateOrganizationCommand) Execute(ctx context.Context, opts *Command
}
defer func() { err = close(ctx, err) }()
err = orgRepo(opts.DB).Create(ctx, &Organization{
ID: cmd.ID,
Name: cmd.Name,
InstanceID: cmd.InstanceID,
State: OrgStateActive,
})
err = orgRepo(opts.DB).Create(ctx, cmd)
if err != nil {
return err
}

View File

@@ -15,7 +15,7 @@ type OrganizationRepository interface {
Get(ctx context.Context, opts ...database.QueryOption) (*Organization, error)
List(ctx context.Context, opts ...database.QueryOption) ([]*Organization, error)
Create(ctx context.Context, instance *Organization) error
Create(ctx context.Context, org *CreateOrganizationCommand) error
Update(ctx context.Context, condition database.Condition, changes ...database.Change) (int64, error)
Delete(ctx context.Context, condition database.Condition) (int64, error)