Use cases¶
Tenants uses the processor/retriever pattern: ITenantsProcessor / ITenantsRetriever (DefaultTenantsProcessor / DefaultTenantsRetriever), with FluentValidation *Validator types.
Commands (write)¶
| Input | Validator | Processor method |
|---|---|---|
CreateTenantDraftInput |
CreateTenantDraftInputValidator |
CreateDraftAsync |
ActivateTenantInput |
ActivateTenantInputValidator |
ActivateAsync |
SuspendTenantInput |
SuspendTenantInputValidator |
SuspendAsync |
DecommissionTenantInput |
DecommissionTenantInputValidator |
DecommissionAsync |
ChangeTenantResidencyInput |
ChangeTenantResidencyInputValidator |
ChangeResidencyAsync |
Residency change is a first-class command unique to this context.
Queries (read)¶
| Input | Validator | Retriever method |
|---|---|---|
GetTenantForTenantInput |
GetTenantForTenantInputValidator |
GetRequiredForTenantAsync |
GetTenantByIdInput |
GetTenantByIdInputValidator |
GetRequiredByIdAsync |
GetTenantByTenantKeyInput |
GetTenantByTenantKeyInputValidator |
GetRequiredByTenantKeyAsync |
Lifecycle transitions are enforced in DefaultTenantsProcessor via the AllowedTransitions map; invalid transitions raise TenantStatusTransitionNotAllowedException.