Version: 1.0.0Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Last Updated: 2026-03-20
Spec: HR-11 Benefits Administration
Constitution Reference: Section 1.2 (Core Independence), Section 1.3 (Integration Patterns)
Overview
HR-11 manages employee benefits enrollment, plans, and eligibility. It publishes events for enrollment approvals and terminations, and integrates with HR-06 (Leave Management), HR-07 (Payroll), and FA-15 (Cost Allocation).Integration Points
Platform Foundation (PF) Dependencies
Required PF Features:- PF-10 (Notifications): Enrollment reminders, approval notifications
- Integration Type: Platform Integration Layer (
@/platform/notifications)
- Integration Type: Platform Integration Layer (
Consumer Core Dependencies (Downstream)
Internal HR Features:- HR-01 (Employee Directory): Employee context, employment type, tenure
- HR-06 (Leave Management): Benefits-eligible leave tracking
- HR-07 (Payroll): Benefits deductions, employer contributions
- FA-15 (Cost Allocation & Indirect Cost Rates): Benefits cost allocation to departments
Event Contracts
Event: hr_benefits_enrollment_approved
Publisher: HR (HR-11)Subscribers: HR-06 Phase 2 (Leave Management), HR-07 (Payroll)
Status: 📝 Planned Purpose: Notify payroll and leave management of approved enrollment Published when: Enrollment status changes to ‘approved’ or ‘active’ Payload Schema:
Event: hr_benefits_enrollment_terminated
Publisher: HR (HR-11)Subscribers: HR-06 Phase 2 (Leave Management), HR-07 (Payroll)
Status: 📝 Planned Purpose: Notify payroll and leave management of enrollment termination Published when: Enrollment status changes to ‘terminated’ Payload Schema:
Events Consumed
hr_employee_hiredfrom HR-09 (ATS) - Create initial eligibility checkhr_employee_terminatedfrom HR-03 (Offboarding) - Terminate benefits
API Contracts
API: Employee Benefit Enrollment Status Query Hook
Endpoint: RLS-enforced query tohr_benefits_enrollments tableMethod: Read-only via Supabase client
Provider: HR (HR-11)
Consumers: HR-06 Phase 2 (Leave Management)
Status: ✅ Available Purpose: Check if an employee is enrolled in a specific benefit plan type (e.g., STD, LTD, disability) Example:
- Events should be published via database triggers on
hr_benefits_enrollmentstable - HR-06 Phase 2 subscribes to these events to update leave eligibility in real-time
- See
docs/architecture/integrations/EVENT_CONTRACTS.mdfor complete event schema
Platform Integration Layer Usage
Consumes:- PF-10 (Notifications): Enrollment reminders, approval notifications via
@/platform/notifications
Security Considerations
Multi-Tenancy
- ✅ RLS Enforcement: All
hr_benefits_*tables filtered byorganization_idvia RLS policies
Role-Based Access Control
- ✅ HR Admin: Full access to all benefits data
- ✅ Manager: View benefits for direct reports
- ✅ Staff: View own benefits enrollment only
Data Protection
- ✅ PII Handling: Benefits enrollment may contain sensitive employee information; access controlled via RLS
- ✅ Audit Trail: All benefits enrollment changes logged via PF-04
Testing Requirements
- Event payload structure validation
- Event fires on trigger condition (enrollment approval, termination)
- Correct
organization_idincluded in all events - Subscribers handle events correctly (HR-06, HR-07)
- RLS policies enforce org isolation on benefits queries
- Enrollment status query hook works correctly