Commit Graph

3 Commits (eee2071ac20e8fe540b56a800bf0bcb332a02bc2)

Author SHA1 Message Date
ahmed.mujtaba bb056456fc the pipeline and dashboard synced 2026-08-31 00:27:27 +05:00
Talha Ahmed 6eefaa2fad Tasks: recruiter-only assignees, role-gated creation, assignees API
- Assignees restricted to recruiter-role users (role id resolved from the
  roles table per request, not hardcoded); server 422s any other role on
  create and update
- New GET /tasks/assignees/fetch: active recruiter users for the picker,
  separate from /users/fetch so assigning never needs rbac_users.view
- Creation gated to system_administrator / hr_administrator / recruiter:
  allowed role ids searched from the DB and compared to the callers
  role_id, on top of the tasks.create permission tag
- manual/005_tasks_rbac_restrict.sql: permission DB follows suit -
  hiring_manager / department_head / ceo swap tasks_management for a
  view-only tasks_viewer bundle (idempotent, auto-applies at boot)
- UI: assignee dropdown lists recruiters from the new endpoint with
  required-field validation; recruiters get an assign-to-me default; the
  New Task button honours the creator roles

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 17:54:50 +05:00
Talha Ahmed b3483d9a6e Tasks domain: real backend + live screen with DB users/roles as assignees
- New backend/tasks/ package (offer/ house style): tasks table
  (title/status/priority/due_date/assignee_id -> users.id, optional
  inbox_id/job_post_id links, soft delete), routes /tasks/fetch|create|
  update|delete guarded by new tasks.* permission tags
- Assignees validated against users+roles: must exist, not deleted, not
  candidate-role; omitted assignee defaults to the caller; responses carry
  assignee_name/assignee_role from one batched join
- TASKS permission module (104 -> 112 tags); manual/004_tasks_rbac.sql
  seeds the tags + tasks_management bundle onto 6 staff roles (auto-applies
  at startup)
- Tasks.jsx cut over from seed to live: real create/complete/reopen with
  optimistic flip, two-click delete in the detail modal, assignee picker
  listing real users with roles; live sidebar badge (open-task total);
  route now requires tasks.view

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 16:27:19 +05:00