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.
Version: 1.0.0
Last Updated: 2026-01-11
Module: Human Resources
Prefix:hr_
Tables: 75
Changelog
- 1.0.0 (2026-01-11): Initial ERD documentation
Overview
The Human Resources module manages the complete employee lifecycle including positions, departments, leave management, time tracking, payroll, and applicant tracking (ATS).Core Employee ERD
Leave Management ERD
Time & Attendance ERD
Payroll ERD
Applicant Tracking (ATS) ERD
RLS Policy Coverage
| Table | SELECT | INSERT | UPDATE | DELETE | WITH CHECK | Status |
|---|---|---|---|---|---|---|
| hr_employees | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| hr_positions | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| hr_departments_v | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| hr_leave_requests | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| hr_leave_balances | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| hr_timesheets | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| hr_timesheet_entries | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| hr_payroll_runs | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| hr_payroll_records | ✅ | ✅ | ✅ | ✅ | ✅ | Complete |
| hr_payroll_audit_log | ✅ | ✅ | - | - | - | Audit table |
| hr_ssn_access_log | ✅ | ✅ | - | - | - | Audit table |
| hr_document_access_logs | ✅ | ✅ | - | - | - | Audit table |
Key Tables
hr_employees
Core employee record with personal info, employment status, and org assignment.hr_positions
Job positions with salary ranges, requirements, and department assignment.hr_leave_requests
Leave/PTO requests with approval workflow integration.hr_timesheets
Weekly/bi-weekly time tracking with approval status.hr_payroll_runs
Payroll processing batches with summary totals.Helper Functions
| Function | Purpose |
|---|---|
hr_has_org_access(org_id, user_id) | Check HR module access |
hr_is_manager_of(employee_id, user_id) | Check management hierarchy |
hr_get_direct_reports(manager_id) | Get employees reporting to manager |
hr_calculate_leave_balance(employee_id, type_id) | Calculate current balance |
Cross-Module Dependencies
- PF: Organizations, profiles, user roles
- FA: Payroll journal entries, expense reimbursements
- FW: Leave request workflows, onboarding forms
- FM: Employee assigned assets