Skip to content

FAC-121 feat: add ProgramFilterOptionResponseDto with moodleCategoryId#288

Merged
y4nder merged 2 commits intodevelopfrom
feat/enhance-moodle-seed-provision
Apr 11, 2026
Merged

FAC-121 feat: add ProgramFilterOptionResponseDto with moodleCategoryId#288
y4nder merged 2 commits intodevelopfrom
feat/enhance-moodle-seed-provision

Conversation

@y4nder
Copy link
Copy Markdown
Member

@y4nder y4nder commented Apr 11, 2026

Summary

  • Create standalone ProgramFilterOptionResponseDto with moodleCategoryId field and MapProgram() static mapper (follows SemesterFilterResponseDto pattern)
  • Update GetPrograms() service and controller return types to use the new DTO
  • Add service-level spec verifying MapProgram() produces correct class instances
  • Update controller spec with moodleCategoryId assertions

Closes #287

Context

The admin frontend's Seed Users tab needs moodleCategoryId from the programs filter endpoint to fetch courses from the Moodle category tree API via cascading dropdowns (Semester > Department > Program). FilterOptionResponseDto is unchanged — the new DTO is standalone to preserve Swagger metadata (same pattern as SemesterFilterResponseDto).

Tech Spec

Expand tech spec

Problem

The Seed Users tab has a bare-bones UX — users must type raw comma-separated Moodle course IDs. No visual course selection, no preview, no cascading dropdowns.

Solution (API portion)

Create a standalone ProgramFilterOptionResponseDto that includes moodleCategoryId, keeping FilterOptionResponseDto untouched. This enables the frontend to derive the Moodle category from program selection and fetch courses from the tree API.

Technical Decisions

  • Standalone flat DTO (not extending FilterOptionResponseDto): NestJS Swagger metadata scanner relies on class prototypes. SemesterFilterResponseDto uses this same pattern.
  • FilterOptionResponseDto unchanged: Avoids polluting campus/department responses with fields they don't need.

Test plan

  • All existing admin-filters tests pass (15/15)
  • New admin-filters.service.spec.ts verifies moodleCategoryId mapping and class instance
  • Controller spec updated with moodleCategoryId: 42 assertion
  • API builds cleanly (npm run build)
  • Manual: GET /admin/filters/programs?departmentId=<uuid> returns moodleCategoryId in Swagger

Create standalone ProgramFilterOptionResponseDto that exposes moodleCategoryId
in the program filter response, enabling the admin frontend to derive Moodle
category IDs for course fetching via cascading dropdowns.

- Add ProgramFilterOptionResponseDto with static MapProgram() mapper
- Update GetPrograms() service and controller return types
- Add service-level spec for mapping verification
- Update controller spec with moodleCategoryId assertions
@y4nder y4nder linked an issue Apr 11, 2026 that may be closed by this pull request
@y4nder y4nder self-assigned this Apr 11, 2026
@y4nder y4nder merged commit f206a21 into develop Apr 11, 2026
2 checks passed
y4nder added a commit that referenced this pull request Apr 11, 2026
#288)

* FAC-121 feat: add ProgramFilterOptionResponseDto with moodleCategoryId

Create standalone ProgramFilterOptionResponseDto that exposes moodleCategoryId
in the program filter response, enabling the admin frontend to derive Moodle
category IDs for course fetching via cascading dropdowns.

- Add ProgramFilterOptionResponseDto with static MapProgram() mapper
- Update GetPrograms() service and controller return types
- Add service-level spec for mapping verification
- Update controller spec with moodleCategoryId assertions

* chore: added tech spec
y4nder added a commit that referenced this pull request Apr 11, 2026
…rer, audit trail, semester fix, bulk course provisioning, program filter enhancements (#289)

* FAC-116 feat: add Moodle seeding toolkit API (#279)

* FAC-116 feat: add Moodle seeding toolkit API

Add provisioning endpoints for creating Moodle categories, courses, and
users via REST API, replacing the manual Rust CLI workflow.

Closes #278

* chore: add bmad artifacts for Moodle seeding toolkit

* FAC-117 feat: add Moodle tree explorer API endpoints (#281)

* FAC-117 feat: add Moodle tree explorer API endpoints

Add read-only endpoints for browsing live Moodle category hierarchy
and course listings to support admin provisioning visibility.

* chore: add tech spec for moodle tree explorer

* FAC-118 feat: add audit trail query endpoints (#282)

* feat: add audit trail query endpoints

Add GET /audit-logs (paginated, filtered list) and GET /audit-logs/:id
(single record) endpoints for superadmin audit log visibility.

https://claude.ai/code/session_01D6jVaVQiXM5y8P8XmsmzG5

* fix: startup issue

---------

Co-authored-by: Claude <noreply@anthropic.com>

* FAC-119 fix: correct semester year derivation and add category preview endpoint (#284)

Fix wrong semester tag generation in category provisioning when a single
semester is selected (e.g., S22626 instead of S22526). Add ComputeSchoolYears
utility for school-year-aware year computation. Add POST categories/preview
endpoint with read-only hierarchy walk. Improve webservice_access_exception
error message with actionable hint.

* FAC-120 feat: enhance bulk course provisioning with cascading dropdowns (#286)

* FAC-120 feat: enhance bulk course provisioning with cascading dropdowns

Replace free-text inputs and CSV upload with cascading dropdown selectors
(Semester → Department → Program) and JSON-based bulk preview/execute
endpoints for course provisioning.

* FAC-120 chore: add tech spec for bulk course provisioning enhancement

* FAC-121 feat: add ProgramFilterOptionResponseDto with moodleCategoryId (#288)

* FAC-121 feat: add ProgramFilterOptionResponseDto with moodleCategoryId

Create standalone ProgramFilterOptionResponseDto that exposes moodleCategoryId
in the program filter response, enabling the admin frontend to derive Moodle
category IDs for course fetching via cascading dropdowns.

- Add ProgramFilterOptionResponseDto with static MapProgram() mapper
- Update GetPrograms() service and controller return types
- Add service-level spec for mapping verification
- Update controller spec with moodleCategoryId assertions

* chore: added tech spec

---------

Co-authored-by: Claude <noreply@anthropic.com>
y4nder added a commit that referenced this pull request Apr 11, 2026
…rer, audit trail, semester fix, bulk course provisioning, program filter enhancements (#289)

* FAC-116 feat: add Moodle seeding toolkit API (#279)

* FAC-116 feat: add Moodle seeding toolkit API

Add provisioning endpoints for creating Moodle categories, courses, and
users via REST API, replacing the manual Rust CLI workflow.

Closes #278

* chore: add bmad artifacts for Moodle seeding toolkit

* FAC-117 feat: add Moodle tree explorer API endpoints (#281)

* FAC-117 feat: add Moodle tree explorer API endpoints

Add read-only endpoints for browsing live Moodle category hierarchy
and course listings to support admin provisioning visibility.

* chore: add tech spec for moodle tree explorer

* FAC-118 feat: add audit trail query endpoints (#282)

* feat: add audit trail query endpoints

Add GET /audit-logs (paginated, filtered list) and GET /audit-logs/:id
(single record) endpoints for superadmin audit log visibility.

https://claude.ai/code/session_01D6jVaVQiXM5y8P8XmsmzG5

* fix: startup issue

---------

Co-authored-by: Claude <noreply@anthropic.com>

* FAC-119 fix: correct semester year derivation and add category preview endpoint (#284)

Fix wrong semester tag generation in category provisioning when a single
semester is selected (e.g., S22626 instead of S22526). Add ComputeSchoolYears
utility for school-year-aware year computation. Add POST categories/preview
endpoint with read-only hierarchy walk. Improve webservice_access_exception
error message with actionable hint.

* FAC-120 feat: enhance bulk course provisioning with cascading dropdowns (#286)

* FAC-120 feat: enhance bulk course provisioning with cascading dropdowns

Replace free-text inputs and CSV upload with cascading dropdown selectors
(Semester → Department → Program) and JSON-based bulk preview/execute
endpoints for course provisioning.

* FAC-120 chore: add tech spec for bulk course provisioning enhancement

* FAC-121 feat: add ProgramFilterOptionResponseDto with moodleCategoryId (#288)

* FAC-121 feat: add ProgramFilterOptionResponseDto with moodleCategoryId

Create standalone ProgramFilterOptionResponseDto that exposes moodleCategoryId
in the program filter response, enabling the admin frontend to derive Moodle
category IDs for course fetching via cascading dropdowns.

- Add ProgramFilterOptionResponseDto with static MapProgram() mapper
- Update GetPrograms() service and controller return types
- Add service-level spec for mapping verification
- Update controller spec with moodleCategoryId assertions

* chore: added tech spec

---------

Co-authored-by: Claude <noreply@anthropic.com>
y4nder added a commit that referenced this pull request Apr 11, 2026
…Moodle Seeding Toolkit, Tree Explorer, Audit Trail, Semester Fix, Bulk Course Provisioning & Program Filter Enhancements (#291)

* FAC-113 feat: scoped program filters for analytics attention endpoint (#269) (#270)

Add programCode filter to GET /analytics/attention with scope
validation. Fix chairperson program scoping in GET /curriculum/programs.
Add scope validation for programCode on GET /analytics/overview.

* [STAGING] FAC-114 feat: add CSV test submission generator (#273) (#274)

* chore: initialize tech-spec WIP for CSV test submission generator

https://claude.ai/code/session_01VbeiqCo7jDVMYYi9dgp5kr

* chore: update tech-spec WIP with deep investigation findings

https://claude.ai/code/session_01VbeiqCo7jDVMYYi9dgp5kr

* chore: finalize tech-spec for CSV test submission generator

Spec passed two rounds of adversarial review. Key decisions:
- Direct submitQuestionnaire() calls instead of ingestion pipeline
- Import QuestionnaireModule for QuestionnaireService access
- em.clear() on failure for EM state recovery
- OpenAI gpt-4o-mini for multilingual comment generation
- Admin console builder UI with two-track selection flow

https://claude.ai/code/session_01VbeiqCo7jDVMYYi9dgp5kr

* feat: add CSV test submission generator API

Add backend endpoints for generating realistic test questionnaire
submissions with OpenAI-powered multilingual comments.

New endpoints:
- GET /admin/generate-submissions/status (lightweight pre-check)
- POST /admin/generate-submissions/preview (generate with comments)
- POST /admin/generate-submissions/commit (submit via QuestionnaireService)
- GET /admin/filters/faculty, courses, questionnaire-types, versions

Includes CommentGeneratorService with gpt-4o-mini integration and
fallback, AdminGenerateService with preview/commit flow, and 31
unit tests across 3 test suites.

---------

Co-authored-by: Claude <noreply@anthropic.com>

* FAC-115 fix: scope recommendation supporting evidence to pipeline submissions (#276) (#277)

TopicAssignment query now filters by submissionIds, preventing cross-faculty
evidence contamination. Replaced Topic.docCount with scoped assignment count
for accurate commentCount in evidence and confidence computation.

* [STAGING] FAC-116 to FAC-121 feat: Moodle seeding toolkit, tree explorer, audit trail, semester fix, bulk course provisioning, program filter enhancements (#289)

* FAC-116 feat: add Moodle seeding toolkit API (#279)

* FAC-116 feat: add Moodle seeding toolkit API

Add provisioning endpoints for creating Moodle categories, courses, and
users via REST API, replacing the manual Rust CLI workflow.

Closes #278

* chore: add bmad artifacts for Moodle seeding toolkit

* FAC-117 feat: add Moodle tree explorer API endpoints (#281)

* FAC-117 feat: add Moodle tree explorer API endpoints

Add read-only endpoints for browsing live Moodle category hierarchy
and course listings to support admin provisioning visibility.

* chore: add tech spec for moodle tree explorer

* FAC-118 feat: add audit trail query endpoints (#282)

* feat: add audit trail query endpoints

Add GET /audit-logs (paginated, filtered list) and GET /audit-logs/:id
(single record) endpoints for superadmin audit log visibility.

https://claude.ai/code/session_01D6jVaVQiXM5y8P8XmsmzG5

* fix: startup issue

---------

Co-authored-by: Claude <noreply@anthropic.com>

* FAC-119 fix: correct semester year derivation and add category preview endpoint (#284)

Fix wrong semester tag generation in category provisioning when a single
semester is selected (e.g., S22626 instead of S22526). Add ComputeSchoolYears
utility for school-year-aware year computation. Add POST categories/preview
endpoint with read-only hierarchy walk. Improve webservice_access_exception
error message with actionable hint.

* FAC-120 feat: enhance bulk course provisioning with cascading dropdowns (#286)

* FAC-120 feat: enhance bulk course provisioning with cascading dropdowns

Replace free-text inputs and CSV upload with cascading dropdown selectors
(Semester → Department → Program) and JSON-based bulk preview/execute
endpoints for course provisioning.

* FAC-120 chore: add tech spec for bulk course provisioning enhancement

* FAC-121 feat: add ProgramFilterOptionResponseDto with moodleCategoryId (#288)

* FAC-121 feat: add ProgramFilterOptionResponseDto with moodleCategoryId

Create standalone ProgramFilterOptionResponseDto that exposes moodleCategoryId
in the program filter response, enabling the admin frontend to derive Moodle
category IDs for course fetching via cascading dropdowns.

- Add ProgramFilterOptionResponseDto with static MapProgram() mapper
- Update GetPrograms() service and controller return types
- Add service-level spec for mapping verification
- Update controller spec with moodleCategoryId assertions

* chore: added tech spec

---------

Co-authored-by: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FAC-121 feat: add ProgramFilterOptionResponseDto with moodleCategoryId

1 participant