You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Admins need a dedicated page to create and manage departments — organisational units that group users and assets. Currently there is no frontend UI for department CRUD even though the backend endpoints exist (from BE-32 or later). Without this page, admins cannot set up the organisational structure required for scoped asset tracking.
Context
Route: frontend/app/(dashboard)/departments/page.tsx (needs to be created)
Add "Departments" to the sidebar navigation under an "Organisation" section
API endpoints: GET /departments, POST /departments, PATCH /departments/:id, DELETE /departments/:id, GET /departments/:id/users, GET /departments/:id/assets
React Query hooks: create in frontend/lib/query/hooks/useDepartments.ts
Table view with columns: Department Name, Manager (name), Member Count, Asset Count, Created Date, actions (Edit, Delete)
"Add Department" button opens a modal with: name (required), description (optional), manager selector (user search dropdown)
Clicking a department row opens a detail drawer with two tabs: "Members" (list of users with their roles) and "Assets" (list of department assets with status badges)
Edit button pre-fills the modal; Delete requires confirmation and warns if the department has members
Overview
Admins need a dedicated page to create and manage departments — organisational units that group users and assets. Currently there is no frontend UI for department CRUD even though the backend endpoints exist (from BE-32 or later). Without this page, admins cannot set up the organisational structure required for scoped asset tracking.
Context
frontend/app/(dashboard)/departments/page.tsx(needs to be created)GET /departments,POST /departments,PATCH /departments/:id,DELETE /departments/:id,GET /departments/:id/users,GET /departments/:id/assetsfrontend/lib/query/hooks/useDepartments.tsAcceptance Criteria
frontend/app/(dashboard)/departments/page.tsxuseDepartments(),useCreateDepartment(),useUpdateDepartment(),useDeleteDepartment(),useDepartmentUsers(id),useDepartmentAssets(id)