Skip to content

FAC-121 feat: add ProgramFilterOptionResponseDto with moodleCategoryId #287

@y4nder

Description

@y4nder

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.tsGetPrograms() 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions