loreal-utilisation-dept/backend/tests
DJP 9f3d3cabfd feat: rebuild Department / Forecast / Project Type pages to match original SPA
Three big pages rebuilt against the original's screen recording — addresses
the "the chart is not dynamic" + "see booking and timesheet together"
feedback. 72/72 backend tests (+12 new), frontend typecheck/lint/build
clean, main entry 16.43 KB gzipped.

Department page:
- Department pill subnav (Creative / PM Team / Syndication / Transcreation /
  Opera Upload / Operations / Adhoc People). Replaces dropdown.
- Last Week / This Week / Next Week pills with date-range labels +
  month-preset pills derived from the uploaded timelog.
- HOURS & UTILISATION strip: 6 tiles — Allocated (net of leave), Time
  Logged (net of leave), Active People, Actual %, Forecast % (amber
  highlight), Leave Hours.
- BILLABILITY BREAKDOWN strip: Fee Related, Client Related, Non-Billable,
  Total Billable %.
- FTE VS FREELANCER section: two large composite cards, each with nested
  Actual + Forecast utilisation sub-cards.
- DeptWeeklyChart (new): per-person stacked bars with billing-category
  colours and red Forecast % line overlay. Click a name → DailyBreakdownModal
  with per-weekday stacked bars + red avg-% line. Click a bar segment →
  project-logs panel for that segment.
- DeptBookingVsActual (new): grouped per-person bars (Active / Soft /
  Actual).
- ResourceAvailability (new): sortable two-section table (FTE / Freelancer)
  showing each person's Active Booked, Soft Booked, Booked %, Logged h,
  and Status — the "booking + timesheet together" view.

Forecast page:
- 12 KPI tiles in two rows (Weekly Team Capacity → Active Next Week).
- Last Week / This Week toggle + "Project Summary loaded" badge.
- Weekly Pipeline chart: active-count bars + red exit-rate line + dashed
  forecast-avg baseline. Click a bar → drill into that week.
- Right-hand "How this forecast is built" sidebar with prose explanations.

Project Type Summary page:
- "Project Type Benchmark" header + coverage callouts (months in timelog,
  warning about projects starting before coverage, recommended export
  range).
- Month-preset pills.
- Sortable Summary by Project Type table — 10 columns including avg
  assets/week and avg projects/month.
- Per-type detail panel below: monthly assets trend chart + project list.
- Bottom: Avg H/Asset and Avg Duration totals + Insights & Recommended
  Actions section with auto-generated outlier callouts.

Backend additions:
- /api/utilisation/department, /api/utilisation/daily-breakdown
- /api/forecast extended with thisWeek + nextWeek capacity blocks
- /api/project-types extended with monthly trends, project lists,
  longest-project tracking, coverage section, insights
- services/department.py + tests/test_department.py
- Booking model gains resourceRecordIds so daily breakdowns can match
  bookings by Airtable record ID, not just flattened name

Tutorial selectors preserved + new ones added: dept-pills,
resource-availability, forecast-sidebar, forecast-canvas.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 23:17:42 -04:00
..
fixtures Initial commit: dockerised FastAPI backend + React/Vite frontend rewrite 2026-05-16 12:37:04 -04:00
__init__.py Initial commit: dockerised FastAPI backend + React/Vite frontend rewrite 2026-05-16 12:37:04 -04:00
conftest.py Initial commit: dockerised FastAPI backend + React/Vite frontend rewrite 2026-05-16 12:37:04 -04:00
test_airtable_cache.py backend + frontend: leave hours, server-side bookings filter, dynamic meta, defensive charts 2026-05-17 20:48:12 -04:00
test_auth.py Initial commit: dockerised FastAPI backend + React/Vite frontend rewrite 2026-05-16 12:37:04 -04:00
test_chat.py feat: Forecast, Project Type Summary, Time Log Detail, AI Chat, filters v2, stats bar, RBAC 2026-05-17 21:40:03 -04:00
test_deliverable_parse.py feat: Forecast, Project Type Summary, Time Log Detail, AI Chat, filters v2, stats bar, RBAC 2026-05-17 21:40:03 -04:00
test_department.py feat: rebuild Department / Forecast / Project Type pages to match original SPA 2026-05-17 23:17:42 -04:00
test_forecast.py feat: Forecast, Project Type Summary, Time Log Detail, AI Chat, filters v2, stats bar, RBAC 2026-05-17 21:40:03 -04:00
test_merge.py feat: KPI tiles, active/soft booking split, hour-breakdown drill-down, period toggle, forecast line, sync button 2026-05-17 21:06:23 -04:00
test_project_types.py feat: Forecast, Project Type Summary, Time Log Detail, AI Chat, filters v2, stats bar, RBAC 2026-05-17 21:40:03 -04:00
test_zoho_parse.py fix: stop flooding Upload banner with every Zoho column we don't use 2026-05-17 21:52:04 -04:00