Summary
Create a standalone ProgramFilterOptionResponseDto that includes moodleCategoryId in the program filter response. This enables the admin frontend's Seed Users tab to derive the Moodle category for course fetching via cascading dropdowns (Semester > Department > Program).
Changes
- NEW
src/modules/admin/dto/responses/program-filter-option.response.dto.ts — standalone flat DTO with own Swagger decorators and MapProgram() static mapper (follows SemesterFilterResponseDto pattern)
- MODIFIED
src/modules/admin/services/admin-filters.service.ts — GetPrograms() returns ProgramFilterOptionResponseDto[]
- MODIFIED
src/modules/admin/admin-filters.controller.ts — return type + @ApiResponse updated
- MODIFIED
src/modules/admin/admin-filters.controller.spec.ts — mock includes moodleCategoryId
- NEW
src/modules/admin/services/admin-filters.service.spec.ts — service-level test verifying MapProgram() mapping and class instance
Context
Part of the Enhance Seed Users Provision UX initiative. The admin frontend needs moodleCategoryId from the programs filter endpoint to fetch courses from the Moodle category tree API. FilterOptionResponseDto is not modified — it stays clean for campus/department consumers.
Acceptance Criteria
GET /admin/filters/programs?departmentId=X returns moodleCategoryId: number for each program
- Swagger schema reflects the new field
- All existing tests pass, new service spec covers the mapping
Summary
Create a standalone
ProgramFilterOptionResponseDtothat includesmoodleCategoryIdin the program filter response. This enables the admin frontend's Seed Users tab to derive the Moodle category for course fetching via cascading dropdowns (Semester > Department > Program).Changes
src/modules/admin/dto/responses/program-filter-option.response.dto.ts— standalone flat DTO with own Swagger decorators andMapProgram()static mapper (followsSemesterFilterResponseDtopattern)src/modules/admin/services/admin-filters.service.ts—GetPrograms()returnsProgramFilterOptionResponseDto[]src/modules/admin/admin-filters.controller.ts— return type +@ApiResponseupdatedsrc/modules/admin/admin-filters.controller.spec.ts— mock includesmoodleCategoryIdsrc/modules/admin/services/admin-filters.service.spec.ts— service-level test verifyingMapProgram()mapping and class instanceContext
Part of the Enhance Seed Users Provision UX initiative. The admin frontend needs
moodleCategoryIdfrom the programs filter endpoint to fetch courses from the Moodle category tree API.FilterOptionResponseDtois not modified — it stays clean for campus/department consumers.Acceptance Criteria
GET /admin/filters/programs?departmentId=XreturnsmoodleCategoryId: numberfor each program