Recruitment
Job vacancies and applications, staff-published postings, guest applicants, and a map-driven review state machine that strips personal details from its audit trail.
The recruitment half of the application module: staff post job vacancies, guests apply, staff move applications through a review pipeline. Same module, different rules: most notably, job applications reuse the APPLICATION permission resource (there is no separate JOB_APPLICATION resource) while vacancies get their own JOB_VACANCY.
Vacancies
job_vacancy (@TenantScoped): title, description, optional department/campus, requirements/responsibilities, employmentType (full_time / part_time / contract), a deadline, status (draft → published → closed), and an aiInterviewEnabled flag.
- Staff CRUD is
@RequireUserType(STAFF)+ per-actionJOB_VACANCYpermissions, campus-scoped on list, all audited. - The "public" listing (
GET job-vacancies) is authenticated guests, not anonymous:@RequireUserType(GUEST), filtered topublished, ordered by deadline. There are no truly public routes in this module.
Job applications
job_application is not tenant-scoped: it has no schoolId; it snapshots campusId from its vacancy so staff list permissions can scope it. It carries personalInfo jsonb (name/contact/address), optional qualifications/experience, a cover letter, a stored CV (cvFileId), review fields (reviewedBy/At, rejectionReason), and isPrioritized: AI-screened applications sort first in the staff list.
Guest flow: create a draft (prefilled from the guest profile), update while draft, submit (requires a CV and a strict address, addressLine1 + country) → pending, or withdraw. Staff see everything except other people's drafts unless they filter for them explicitly.
The review state machine
Staff advance applications with PATCH :id/status, and the allowed moves live in a literal transition map, extend the map, not the handler:
Every status change stamps reviewedBy/reviewedAt and best-effort emails the applicant (APPLICATION_STATUS, campus-aware).
Audit snapshots strip personal details
Job-application audit entries record metadata only: no personalInfo, cover letter, qualifications, or CV reference. Recruitment data is the richest in personally identifiable information (PII) in the system; keep the snapshot allowlist that way.
Routes
Generated from job-vacancy.controller.ts and job-application.controller.ts at API fbb63d51. Both controllers require the recruitment feature. Who is the user type and permission each route checks. Prefix every path with /api/v1.
Vacancies
| Route | Operation id | Does | Who |
|---|---|---|---|
POST /job-vacancies | createJobVacancy | Create vacancy | staff, create on job_vacancy |
GET /job-vacancies | listOpenJobVacancies | List open vacancies | guest, list on job_vacancy |
GET /job-vacancies/staff | listStaffJobVacancies | List staff vacancies | staff, list on job_vacancy |
GET /job-vacancies/staff/:id | getStaffJobVacancy | Get staff vacancy | staff, read on job_vacancy |
GET /job-vacancies/:id | getJobVacancy | Get vacancy | guest, read on job_vacancy |
PATCH /job-vacancies/:id | updateJobVacancy | Update vacancy | staff, update on job_vacancy |
PATCH /job-vacancies/:id/close | closeJobVacancy | Close vacancy | staff, update on job_vacancy |
DELETE /job-vacancies/:id | deleteJobVacancy | Delete vacancy | staff, delete on job_vacancy |
Job applications
| Route | Operation id | Does | Who |
|---|---|---|---|
POST /job-applications | createJobApplication | Create application | guest, create on application |
GET /job-applications/mine | listMyJobApplications | List my applications | guest, list on application |
GET /job-applications | listJobApplications | List applications | staff, list on job_vacancy |
GET /job-applications/:id | getJobApplication | Get application | staff or guest, read on job_vacancy |
PATCH /job-applications/:id/status | updateJobApplicationStatus | Update application status | staff, update on job_vacancy |
PATCH /job-applications/:id | updateJobApplicationDraft | Update draft | guest, update on application |
PATCH /job-applications/:id/submit | submitJobApplication | Submit application | guest, update on application |
PATCH /job-applications/:id/withdraw | withdrawJobApplication | Withdraw application | guest, update on application |