Problem
Departments cannot be managed via the API. Assets cannot be properly assigned to departments, breaking the organizational hierarchy feature.
Proposed Solution
Create backend/src/opsce/departments/departments.controller.ts and backend/src/opsce/departments/departments.service.ts.
Acceptance Criteria
Problem
Departments cannot be managed via the API. Assets cannot be properly assigned to departments, breaking the organizational hierarchy feature.
Proposed Solution
Create
backend/src/opsce/departments/departments.controller.tsandbackend/src/opsce/departments/departments.service.ts.Acceptance Criteria
POST /api/departmentscreates a department, optionally with aparentId(ADMIN only)GET /api/departmentsreturns all departments as a flat list with achildCountfieldGET /api/departments/:idreturns a department with its children and asset countPATCH /api/departments/:idupdates name, description, or parent (ADMIN only)DELETE /api/departments/:idfails with409if the department has active assetsCreateDepartmentDtovalidatesnameas required string,parentIdas optional UUID