Handover workspace

ERS, Todo, OfferReview, and Docu in one view

Imported from live server docs, code structure, and deployment notes.

Apr 3, 2026, 12:38 PM

OfferReview

W11 Candidate List - Delivery

**W11 (Candidate List)** is fully implemented with role-based saved views, advanced filtering, search, pagination, and candidate detail navigation.

W11-DELIVERY.md

Updated Feb 19, 2026, 6:59 AM

Codex 5.3 Refactor Note: Canonical refactor plan: docs/CODEX-5.3-REFACTOR-PLAN.md. This document is retained for historical and implementation context during the refactor.

W11 Candidate List - Delivery

โœ… Complete

W11 (Candidate List) is fully implemented with role-based saved views, advanced filtering, search, pagination, and candidate detail navigation.


๐Ÿ“ฆ Deliverables

Code (9 Files)

API:

  • src/app/api/candidates/route.ts (UPDATED - GET handler added)
    • Fetches candidates with RBAC filtering, search, filters, pagination
    • Computes ageInStatusDays, ownerRole, isOverdue
    • ~130 lines added

UI Components:

  • src/app/(app)/candidates/page.tsx (NEW - 180 lines)

    • Layout: header + sidebar + filters + table
    • Fetches metadata (managers, positions)
    • Coordinates data flow
  • src/app/(app)/candidates/_components/SavedViews.tsx (NEW - 95 lines)

    • Role-specific sidebar views
    • Active view highlight
  • src/app/(app)/candidates/_components/FiltersBar.tsx (NEW - 180 lines)

    • Search, status, position, manager, date range, overdue
    • Apply/Clear buttons
  • src/app/(app)/candidates/_components/CandidatesTable.tsx (NEW - 200 lines)

    • Table with 8 columns
    • Pagination, row click, empty state
    • Status color badges

Helpers:

  • src/lib/candidates/owner.ts (NEW - 60 lines)
    • getOwnerRole(status)
    • getAgeInStatusDays(date)
    • isOverdue(status, days)

Documentation

  • W11-IMPLEMENTATION.md (A-H format, 20 test cases)

๐ŸŽฏ Features Implemented

โœ… Role-based saved views (HR, Manager, SMO, Admin)
โœ… Server-side RBAC filtering (Manager: assigned only, SMO: TO_SMO/decided)
โœ… Advanced filtering: status, position, manager, date range, overdue
โœ… Search: name, code, position
โœ… Pagination (server-side)
โœ… Computed columns: age in status, owner role, overdue indicator
โœ… Table: 8 columns with color-coded status badges
โœ… Row click โ†’ candidate detail
โœ… Empty state with clear filters
โœ… URL parameters persist on refresh


โœ… Acceptance Criteria

  • Role-specific saved views appear and filter correctly
  • Table shows required columns and paginates
  • Search works across name/code/applyingFor
  • Clicking row opens candidate detail
  • RBAC enforced: Manager only sees assigned; Admin sees all
  • Overdue toggle works (hardcoded thresholds)
  • No extra features beyond W11

๐Ÿงช Test Coverage

20 comprehensive test cases (see W11-IMPLEMENTATION.md Section H):

  • Saved views per role
  • Search functionality
  • Status, position, manager, date filters
  • Overdue toggle
  • Pagination
  • Row navigation
  • Age in status calculation
  • Owner role determination
  • Status badge colors
  • Empty state
  • URL persistence
  • Multi-filter combinations
  • RBAC enforcement

๐Ÿ“Š Key Implementation Details

Saved Views (Role-Specific)

HR:

  • Needs HR Screening (status=NEW)
  • Needs Manager Assignment (status=HR_SCREENED, no manager)
  • Active Pipeline (status IN NEW, HR_SCREENED, MANAGER_EVAL_PENDING, MANAGER_REVIEWED, TO_SMO)
  • All Candidates

Manager:

  • My Queue (assigned, status=MANAGER_EVAL_PENDING)
  • Waiting for SMO (assigned, status=TO_SMO)
  • My Reviewed (assigned, status=MANAGER_REVIEWED)
  • All Assigned (assigned to me)

SMO:

  • Needs Decision (status=TO_SMO)
  • Recent Decisions (status=APPROVED/REJECTED/KIV)

Admin:

  • All Candidates

RBAC Filtering

if (role=MANAGER) โ†’ where hiringManagerId = user.id
if (role=SMO) โ†’ where status IN (TO_SMO, APPROVED, REJECTED, KIV)
HR/ADMIN โ†’ no filter

Overdue Thresholds (Hardcoded)

NEW: > 2 days
HR_SCREENED: > 2 days
MANAGER_EVAL_PENDING: > 3 days
MANAGER_REVIEWED: > 3 days
TO_SMO: > 2 days
APPROVED/REJECTED/KIV: never

Table Columns

  1. Candidate (name + code)
  2. Applying For
  3. Status (color badge + overdue โš )
  4. Owner (computed from status)
  5. Assigned Manager (name + email)
  6. Age in Status (days)
  7. Updated At
  8. Actions (Open)

๐Ÿš€ Quick Test

  1. Start server: npm run dev
  2. Login as Manager
  3. Navigate /candidates
  4. Verify "My Queue" saved view
  5. Click candidate โ†’ opens detail page
  6. Apply filters โ†’ table updates
  7. Search by name โ†’ results filter
  8. Toggle overdue โ†’ see warning badge

๐Ÿ“š Files Changed

src/app/api/candidates/route.ts (+130 lines)
  โ””โ”€ GET handler with RBAC, filters, pagination

src/app/(app)/candidates/page.tsx (NEW)
  โ””โ”€ Layout + data fetching

src/app/(app)/candidates/_components/
  โ”œโ”€ SavedViews.tsx (NEW)
  โ”œโ”€ FiltersBar.tsx (NEW)
  โ””โ”€ CandidatesTable.tsx (NEW)

src/lib/candidates/owner.ts (NEW)
  โ””โ”€ Helper functions

โš ๏ธ Notes

  • No database changes required
  • statusUpdatedAt already exists in schema
  • Overdue is computed on fetch (no SLA table in W11)
  • Saved views are fixed per role (no custom views)
  • RBAC enforced server-side
  • All filters are optional (can apply individually or together)