Skip to content

[FE-02] Build global Maintenance page — kanban board and calendar of all work orders #1090

Description

@yusuftomilola

Overview

Maintenance today only exists as a tab inside a single asset's detail page. Teams need the global view: everything scheduled/in-progress/overdue across all assets — the core screen of CMMS tools like UpKeep and Fiix.

What to Build

A /maintenance page under frontend/app/(dashboard)/:

  • Board view: columns for SCHEDULED / IN_PROGRESS / COMPLETED / CANCELLED (dnd-kit is already installed for drag-to-change-status)
  • Calendar view toggle: month grid plotting records by scheduledDate
  • Each card: asset name + link, maintenance type badge, scheduled date, cost
  • Filters: type (PREVENTIVE/CORRECTIVE/SCHEDULED), department, date range
  • "New maintenance" modal (asset picker + the fields from the existing per-asset form)
  • Needs a small backend addition: list maintenance across assets (GET /api/maintenance?status=&from=&to=) — coordinate with [BE-11] or file the endpoint as part of this issue's PR

Conventions to Follow

  • API calls: add a typed client in frontend/lib/api/ (see frontend/lib/api/assets.ts for the pattern) — never call axios directly from components
  • Data fetching: TanStack Query hooks in frontend/lib/query/hooks/ with keys registered in frontend/lib/query/keys.ts
  • UI: reuse frontend/components/ui/ (button, input, confirm-dialog, toast) and the badge/modal patterns in frontend/components/assets/
  • Route goes under frontend/app/(dashboard)/ and gets a sidebar entry in frontend/components/layout/sidebar.tsx
  • Forms: React Hook Form + Zod resolver, matching the existing create-asset modal

References

  • Blocked by [BE-11]
  • Per-asset maintenance UI already exists in frontend/app/(dashboard)/assets/[id]/page.tsx — reuse its types and form

Acceptance Criteria

  • Board and calendar views both render all records with working filters
  • Dragging a card between columns updates the record status (with rollback on API error)
  • Overdue scheduled items are visually flagged
  • Creating a record from this page also appears on the asset's detail tab

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions