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. - Applies role-specific visibility:
ADMIN: repository pagination result is returned as-is.COACH: authorized set = public programs + own private templates + own private assigned programs with active coach-athlete link.ATHLETE: authorized set = own private assigned programs + public programs.
- Computes
total/page/limitfrom the authorized result set after business filtering. - Uses
resolveCoachAthleteVisibilityUsecasefor coach checks on assigned private programs. - Uses
loggerServicedependency to read/write required domain data.
- Returns the use case result (entity/model/list or boolean depending on implementation).
- Logs execution errors through the logger service before normalization/rethrow.
- Throws
ERRORS.LIST_PROGRAMS_FORBIDDENwhen the corresponding guard/validation fails. - Normalizes or references error code
ERRORS.LIST_PROGRAMS_FORBIDDEN. - Normalizes or references error code
ERRORS.LIST_PROGRAMS_USECASE.
bddServiceloggerServiceresolveCoachAthleteVisibilityUsecase
api/src/usecases/sport/program/list.programs.usecase.tsapi/src/usecases/sport/program/__tests__/list.programs.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.
api/src/usecases/sport/program/__tests__/list.programs.usecase.spec.ts