Executes this business operation according to domain rules implemented in the use case.
- Internal invocation through dependency injection (Inversify).
| Name | Required | Type | Description |
|---|---|---|---|
dto |
Yes | object |
Use case input DTO (see implementation file). |
- Input DTO must respect constraints enforced by the implementation.
- Caller context/authorization must satisfy business checks implemented in the use case.
- Validates input/access constraints defined in
executeand helper guards. - Uses
bddServicedependency to read/write required domain data. - Uses
cryptServicedependency to read/write required domain data. - Initializes a coach subscription when
initialSubscriptionPlanCodeis provided for a newly created coach.
- Returns the use case result (entity/model/list or boolean depending on implementation).
- May persist domain state changes through repository/service dependencies.
- Logs execution errors through the logger service before normalization/rethrow.
- Throws
ERRORS.CREATE_USER_USECASE_USER_ALREADY_EXISTwhen repository reports an existing email. - Normalizes or references error code
ERRORS.CREATE_USER_USECASE.
bddServicecryptServiceinitializeCoachSubscriptionUsecaseloggerService
api/src/usecases/user/create.user.usecase.tsapi/src/usecases/user/__tests__/create.user.usecase.spec.ts
{
"dto": "see implementation DTO"
}- This document is generated from code and should be updated whenever behavior changes in implementation.
- If helper modules define additional rules, they are authoritative over this summary.