Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt

Use this file to discover all available pages before exploring further.

Module: Human Resources / Workforce Management
Prefix: hr_
Table Count: 85
Last Updated: 2026-02-08

Overview

The HR module covers employee records, recruitment (ATS), onboarding/offboarding, time and attendance, leave, payroll, benefits, credentials, skills, and employee relations.

Table Categories

1. Core Employee Management (5 tables)

TableColumnsDescription
hr_employees48Core employee records with PII
hr_employee_sites6Employee-to-site assignments
hr_employee_teams7Team memberships
hr_team_members6Team member junction table
hr_employee_preferences14Employee app preferences
Key Fields in hr_employees:
  • employee_number: Unique identifier
  • status: ‘active’, ‘inactive’, ‘terminated’, ‘on_leave’
  • employment_type: ‘full_time’, ‘part_time’, ‘contractor’, ‘intern’
  • ssn_encrypted: Encrypted SSN (column-level encryption)
  • custom_fields: JSONB for org-specific data
Relationships:
hr_employees (1) ──< (many) hr_employee_sites >── (1) pf_sites
hr_employees (1) ──< (many) hr_employee_teams
hr_employees (many) >── (1) pf_departments
hr_employees (many) >── (1) hr_positions

2. Recruitment / ATS (10 tables)

TableColumnsDescription
hr_job_postings32Job listing definitions
hr_candidates28Candidate profiles
hr_applications22Job applications
hr_interviews18Interview scheduling
hr_interview_feedback14Interviewer feedback
hr_offers26Job offer records
hr_offer_templates16Offer letter templates
hr_offer_approvals12Offer approval workflow
hr_offer_counteroffers14Counteroffer tracking
hr_hire_transitions16Candidate-to-employee conversion
Hiring Pipeline:
hr_job_postings → hr_applications → hr_candidates

                  hr_interviews → hr_interview_feedback

                     hr_offers → hr_offer_approvals

                  hr_hire_transitions → hr_employees

3. Onboarding & Offboarding (6 tables)

TableColumnsDescription
hr_onboarding_templates14Onboarding workflow templates
hr_onboarding_tasks16Task definitions in templates
hr_onboarding_instances18Active onboarding processes
hr_onboarding_task_instances14Task completion tracking
hr_offboarding_instances16Active offboarding processes
hr_offboarding_checklist_items12Offboarding task tracking

4. Time & Attendance (9 tables)

TableColumnsDescription
hr_timesheets18Weekly/biweekly timesheets
hr_timesheet_entries14Individual time entries
hr_time_punches12Clock in/out records
hr_time_exceptions14Exception tracking
hr_shift_templates16Shift pattern definitions
hr_shifts18Scheduled shifts
hr_shift_assignments10Employee shift assignments
hr_shift_swap_requests14Shift swap workflow
hr_availability_preferences12Employee availability
Time Entry Pattern:
// Submit timesheet entry
const { data } = await supabase
  .from('hr_timesheet_entries')
  .insert({
    timesheet_id: timesheetId,
    work_date: '2026-01-10',
    hours_worked: 8.0,
    entry_type: 'regular',
    project_code: 'PROJ-001'
  });

5. Leave Management (5 tables)

TableColumnsDescription
hr_leave_policies20Leave policy definitions
hr_leave_accrual_tiers12Tenure-based accrual rates
hr_employee_leave_balances14Current leave balances
hr_leave_requests22Leave request records
hr_fmla_cases24FMLA case tracking
Leave Types:
  • PTO (Paid Time Off)
  • Sick Leave
  • Vacation
  • Personal
  • FMLA
  • Bereavement
  • Jury Duty
  • Military

6. Payroll (9 tables)

TableColumnsDescription
hr_payroll_runs22Payroll processing runs
hr_payroll_line_items18Individual pay items
hr_payroll_exports14Export file tracking
hr_payroll_audit_log12Payroll changes audit
hr_pay_rates16Employee pay rates
hr_pay_adjustments14One-time adjustments
hr_tax_documents14W-2, W-4, I-9 tracking
hr_ssn_access_log10SSN access audit
hr_document_access_logs12Sensitive doc access
Security Notes:
  • SSN stored with column-level encryption
  • All SSN access logged to hr_ssn_access_log
  • Payroll changes tracked in hr_payroll_audit_log

7. Benefits (6 tables)

TableColumnsDescription
hr_benefits_plans24Benefit plan definitions
hr_benefits_enrollments18Employee enrollments
hr_benefits_enrollment_dependents12Dependent coverage
hr_benefits_dependents16Dependent information
hr_benefits_eligibility_rules14Eligibility criteria
hr_benefits_open_enrollment_periods12OE period tracking

8. Credentials & Certifications (5 tables)

TableColumnsDescription
hr_credential_types16Credential definitions
hr_employee_credentials20Employee credentials
hr_credential_requirements12Position requirements
hr_credential_alerts14Expiration alerts
hr_credential_renewal_workflows14Renewal tracking
Credential Tracking:
// Get expiring credentials
const { data } = await supabase
  .from('hr_employee_credentials')
  .select(`
    *,
    employee:hr_employees(first_name, last_name),
    credential_type:hr_credential_types(name)
  `)
  .lte('expiration_date', addDays(new Date(), 30))
  .eq('status', 'active');

9. Skills & Competencies (6 tables)

TableColumnsDescription
hr_skills_library14Skill definitions
hr_employee_skills12Employee skill records
hr_skills_assessments16Skill evaluations
hr_competency_frameworks14Competency models
hr_competency_framework_skills8Framework-skill mapping
hr_position_skill_requirements10Position requirements

10. Positions (1 table)

TableColumnsDescription
hr_positions22Job position definitions
Position Fields:
  • title, description, department_id
  • pay_grade, min_salary, max_salary
  • reports_to_position_id (hierarchy)
  • headcount_authorized, headcount_filled

11. Employee Relations (4 tables)

TableColumnsDescription
hr_disciplinary_actions20Disciplinary records
hr_grievances18Employee grievances
hr_incidents22Workplace incidents
hr_investigations20Investigation tracking
ER Workflow:
hr_incidents → hr_investigations → hr_disciplinary_actions
hr_grievances → hr_investigations

12. Workload Planning (8 tables)

TableColumnsDescription
hr_workload_drivers16Workload factor definitions
hr_workload_driver_versions12Driver version history
hr_workload_calculations18FTE calculations
hr_workload_forecasts16Future workload projections
hr_workload_scenarios14What-if scenarios
hr_workload_approvals12Approval workflow
hr_workload_accuracy_tracking14Forecast vs actual
hr_workload_pto_patterns12PTO impact analysis

13. Module Settings (1 table)

TableColumnsDescription
hr_module_settings46HR module configuration

14. ATS Enhanced (10 tables)

TableColumnsDescription
hr_references28Reference request tracking and feedback
hr_reference_emails12Reference email audit log
hr_background_check_webhook_dlq14Failed webhook dead letter queue
hr_background_check_providers16BGC provider configuration
hr_communication_templates18Email/SMS templates with variables
hr_candidate_communications20Communication tracking and delivery
hr_candidate_portal_accounts16Portal authentication accounts
hr_candidate_portal_sessions10Portal JWT sessions
hr_job_board_integrations18Job board API configuration
hr_job_board_postings16Job posting sync tracking
Reference Checking Workflow:
hr_references → hr_reference_emails (audit)

Request → Sent → Viewed → Completed

Ratings & Feedback stored in hr_references
Background Check DLQ Pattern:
Webhook fails → hr_background_check_webhook_dlq

Retry (up to 3) → Success/Abandoned
Key Settings:
SettingTypeDescription
default_pto_accrual_ratedecimalAnnual PTO accrual
overtime_threshold_hoursdecimalWeekly OT threshold
require_timesheet_approvalbooleanApproval workflow
credential_alert_daysinteger[]Alert thresholds
payroll_approval_requiredbooleanPayroll approval

Common Query Patterns

const { data } = await supabase
  .from('hr_employees')
  .select(`
    *,
    department:pf_departments(name),
    position:hr_positions(title),
    manager:hr_employees!manager_id(first_name, last_name),
    credentials:hr_employee_credentials(
      *,
      credential_type:hr_credential_types(name)
    )
  `)
  .eq('id', employeeId)
  .single();

Get Team Members

const { data } = await supabase
  .from('hr_team_members')
  .select(`
    employee:hr_employees(
      id, first_name, last_name, email,
      position:hr_positions(title)
    )
  `)
  .eq('team_id', teamId);

Leave Balance Check

const { data } = await supabase
  .from('hr_employee_leave_balances')
  .select('*')
  .eq('employee_id', employeeId)
  .eq('leave_type', 'pto')
  .single();

RLS Policies

HR tables use layered RLS:
  1. Organization isolation via organization_id
  2. Manager access to direct reports
  3. Self-service for employee’s own data
  4. HR admin access for sensitive operations
Helper Functions:
  • hr_user_can_view_employee() - View permission check
  • hr_user_can_edit_employee() - Edit permission check
  • hr_user_is_manager_of() - Manager relationship check

Sensitive Data Handling

ColumnProtection
hr_employees.ssn_encryptedColumn-level encryption
hr_employees.date_of_birthRLS restricted
hr_pay_rates.hourly_rateRLS restricted
hr_disciplinary_actions.*Manager/HR only

See Also