Skip to main content
Spec: specs/hr/HR-09-applicant-tracking-system.md (v1.0)
Plan: specs/hr/HR-09-applicant-tracking-system-PLAN.md (v1.0)
Status: ✅ Implemented (Core Features)
Last Updated: 2026-02-09

Overview

This document defines the integration contracts for the HR-09 Applicant Tracking System (ATS). The ATS integrates with multiple platform features and HR modules to provide a seamless hiring workflow from job posting to employee onboarding.

Implementation Status

Core Features (✅ Implemented):
  • ✅ Job postings and candidate management
  • ✅ Application tracking with multi-stage workflow
  • ✅ Offer creation, sending, and acceptance
  • ✅ Employee creation triggered on offer acceptance
  • ✅ Automatic onboarding initiation (candidate_hired event + createOnboardingForHire)
  • ✅ Multi-tenant RLS security
  • useHireWithOnboarding hook for manual triggering
In Progress (🟡):
  • 🟡 Notification integrations (interview reminders, status updates)
Planned (📝):
  • 📝 Job board integrations (Indeed, LinkedIn) - Phase 5.4
  • 📝 Background check provider integration - Phase 5.2
  • 📝 Reference checking workflow - Phase 5.1
  • 📝 Candidate communication templates - Phase 5.3

Event Contracts

Published Events

Payload: hr_reference_completed

Purpose: Notifies workflow system when a reference check is completed by the referee. Status: 📝 Planned (Phase 5.1)
Field Notes:
  • All UUIDs are required and must reference existing entities
  • reference_rating is nullable (referee may decline to rate)
  • reference_status enum: completed | declined
  • Enum values and field names match hr_references table schema
  • Version: Compatible with Phase 5.1+ implementations

Payload: hr_background_check_completed

Purpose: Notifies offer workflow and other systems when a background check reaches a terminal state. Status: 📝 Planned (Phase 5.2)
Field Notes:
  • All UUIDs are required and must reference existing entities
  • background_check_status enum: cleared | flagged | cancelled | disputed | failed
  • fcra_adverse_action_required boolean indicates if FCRA workflow is triggered
  • result_summary and report_url are nullable
  • Enum values and field names match hr_background_checks table schema
  • Version: Compatible with Phase 5.2+ implementations

Payload: hr_job_board_application_received

Purpose: Notifies ATS when a candidate applies via external job board; triggers application creation. Status: 📝 Planned (Phase 5.4)
Field Notes:
  • All UUIDs are required; job_posting_id must reference existing hr_job_postings row
  • source_board enum matches hr_job_board_postings.board_name values
  • external_application_id is the board’s unique application identifier
  • Contact fields: candidate_email required; candidate_phone nullable
  • resume_url and cover_letter_text nullable (not all boards provide both)
  • source_metadata JSONB for board-specific fields (e.g., Indeed’s sponsored flag)
  • Version: Compatible with Phase 5.4+ implementations

hr_employee_hired Event (formerly candidate_hired)

Purpose: Notifies HR-03 Onboarding to start onboarding workflow for new hire.
Status: ✅ Implemented in src/cores/hr/services/hiring/publishCandidateHiredEvent.ts
Trigger Location: src/cores/hr/hooks/useOfferMutation.ts - acceptOffer mutation

offer_accepted Event

Purpose: Triggers employee record creation in HR-01.
Status: ✅ Implemented (via database trigger + event publishing)

interview_scheduled Event

Purpose: Notifies interviewers and candidates of scheduled interviews.

application_received Event

Purpose: Notifies HR of new application and sends confirmation to candidate.

Consumed Events


API Contracts

Exposed APIs

APIs exposed by HR-09 ATS for consumption by other modules.

Get Candidate by Employee

Endpoint: GET /api/v1/hr/candidates/by-employee/{employee_id}
Purpose: Retrieve candidate profile linked to an employee record.
Consumers: HR-01 (Employee Directory)
Status: 📝 Planned
Response:

Get Hiring Pipeline Metrics

Endpoint: GET /api/v1/hr/ats/pipeline-metrics
Purpose: Retrieve pipeline metrics for dashboard widgets.
Consumers: HR Dashboard, LO Dashboard
Status: 📝 Planned
Query Parameters:
  • organization_id (required)
  • date_from (optional)
  • date_to (optional)
  • department_id (optional)
Response:

Consumed APIs

APIs consumed by HR-09 ATS from other modules.

Platform Integration Layer Usage

PF-08 (Forms) Integration

Location: @/platform/forms
Purpose: Application forms, interview feedback forms
Usage:

PF-10 (Notifications) Integration

Location: @/platform/notifications
Purpose: Application confirmations, interview reminders, status updates
Notification Templates:
  • hr-ats-application-received - Candidate confirmation
  • hr-ats-interview-reminder - 24h and 1h reminders
  • hr-ats-offer-sent - Offer letter notification
  • hr-ats-status-update - Application status change

PF-11 (Documents) Integration

Location: @/platform/documents
Purpose: Resume/CV storage, offer letter PDFs
Storage Buckets:
  • hr-ats-resumes - Candidate resume uploads
  • hr-ats-offer-letters - Generated offer letter PDFs

PF-12 (Reports) Integration

Location: @/platform/reports
Purpose: Recruiting reports, EEO reports
Report Templates:
  • hr-ats-pipeline-report - Pipeline metrics
  • hr-ats-time-to-fill-report - Time-to-fill analytics
  • hr-ats-source-effectiveness-report - Source ROI
  • hr-ats-eeo-report - EEO-1 data export

Database Function Contracts

hr_create_employee_from_offer()

Purpose: Automatically create employee record when offer is accepted. Signature:
Behavior:
  1. Validates offer exists and is in ‘accepted’ status
  2. Creates hr_employees record with mapped fields
  3. Creates hr_hire_transitions record
  4. Returns new employee_id

create_onboarding_from_template()

Purpose: Create an onboarding instance from a template for a new hire.
Status: ✅ Implemented
Signature:
Called By: src/cores/hr/services/hiring/createOnboardingForHire.ts

Auto-Onboarding Flow

When an offer is accepted, the following sequence occurs:
Configuration:
  • hr_module_settings.auto_create_onboarding - Enable/disable automatic onboarding
  • hr_module_settings.default_onboarding_template_id - Template to use

Security Considerations

RLS Policy Requirements

All ATS tables use hr_has_org_access() SECURITY DEFINER function to prevent RLS recursion. Access Levels:
  • HR Admin: Full access to all ATS data within organization
  • Hiring Manager: Read/write for positions in their department
  • Interviewer: Read for assigned interviews, write for feedback
  • Candidate: Read-only for own applications and offer details

EEO Data Protection

EEO data in hr_candidates table requires additional access restrictions:
  • Encrypted at rest
  • Accessible only to HR Admin and Compliance Officer roles
  • Audit logging for all EEO data access
  • Excluded from standard data exports

References

  • Spec: specs/hr/HR-09-applicant-tracking-system.md
  • Plan: specs/hr/HR-09-applicant-tracking-system-PLAN.md
  • Constitution: constitution.md §5.7 (RLS patterns)
  • Integration Overview: docs/architecture/integrations/index.md