| # | Sub-Module | Backend | Frontend | Endpoints | Status |
|---|---|---|---|---|---|
| 1 | Departments | Complete | Complete | 6 | Fully implemented |
| 2 | Positions | Complete | Complete | 5 | Fully implemented |
| 3 | Employees | Complete | Partial | 8 | Missing: documents, dependents, some fields |
| 4 | Shifts | Complete | Complete | 5 | Fully implemented |
| 5 | Schedules | Complete | Missing | 4 | No frontend implementation |
| 6 | Settings | Complete | Complete | 2 | Fully implemented |
| 7 | Attendance | Complete | Complete | 5 | Fully implemented |
| 8 | Attendance Corrections | Complete | Missing | 2 | No frontend implementation |
| 9 | Leave Types | Complete | Complete | 5 | Fully implemented |
| 10 | Leave Balances | Complete | Missing | 3 | No frontend implementation |
| 11 | Leave Requests | Complete | Complete | 7 | Fully implemented |
| 12 | Salary Components | Complete | Complete | 5 | Fully implemented |
| 13 | Salary Structures | Complete | Missing | 3 | No frontend implementation |
| 14 | Payroll | Complete | Complete | 9 | Fully implemented |
| 15 | Loans | Complete | Complete | 6 | Fully implemented |
| 16 | Job Openings | Complete | Complete | 6 | Fully implemented |
| 17 | Candidates | Complete | Complete | 5 | Fully implemented |
| 18 | Job Applications | Complete | Partial | 5 | Nested in candidates, no pipeline view |
| 19 | Job Offers | Complete | Missing | 5 | Service only, no UI component |
| 20 | KPIs | Complete | Complete | 5 | Fully implemented |
| 21 | Review Templates | Complete | Complete | 5 | Inside KPIs (2-tab view) |
| 22 | Performance Reviews | Complete | Complete | 7 | Fully implemented |
| 23 | Training Programs | Complete | Complete | 5 | Inside Training (3-tab view) |
| 24 | Training Sessions | Complete | Complete | 5 | Inside Training (3-tab view) |
| 25 | Training Enrollments | Complete | Complete | 3 | Inside Training (3-tab view) |
| 26 | End of Service | Complete | Complete | 6 | Fully implemented |
| 27 | Reports | Complete | Complete | 6 | 6 report types |
/home/moonerpelbaset/moon_erp/Modules/HRM/
├── app/
│ ├── Enums/ (27 enum classes)
│ ├── Http/
│ │ ├── Controllers/ (26 controllers)
│ │ ├── Requests/ (59 form request classes)
│ │ └── Resources/ (33 API resources)
│ ├── Models/ (33 Eloquent models)
│ └── Services/ (11 business logic services)
├── database/
│ ├── migrations/ (34 migration files)
│ └── seeders/ (4 seeder classes)
├── routes/
│ └── api.php (180+ route definitions)
└── Providers/
└── EventServiceProvider.php
company_idcreated_by / updated_by on all tablesSoftDeletes traitname_ar + name_en on all entities/home/moonui/public_html/moon-erp/src/app/
├── features/hr/
│ ├── attendance/ (hr-attendance.component)
│ ├── candidates/ (hr-candidates.component)
│ ├── dashboard/ (hr-dashboard.component)
│ ├── departments/ (hr-departments.component)
│ ├── employees/ (hr-employees.component)
│ ├── eos/ (hr-eos.component)
│ ├── job-openings/ (hr-job-openings.component)
│ ├── kpis/ (hr-kpis.component - 2 tabs)
│ ├── leave-requests/ (hr-leave-requests.component)
│ ├── leave-types/ (hr-leave-types.component)
│ ├── loans/ (hr-loans.component)
│ ├── payroll/ (hr-payroll.component)
│ ├── performance-reviews/ (hr-performance-reviews.component)
│ ├── positions/ (hr-positions.component)
│ ├── reports/ (hr-reports.component - 6 types)
│ ├── salary-components/ (hr-salary-components.component)
│ ├── settings/ (hr-settings.component)
│ ├── shifts/ (hr-shifts.component)
│ └── training/ (hr-training.component - 3 tabs)
├── core/
│ ├── services/hr-*.service.ts (23 services)
│ ├── models/hr-*.model.ts (13 model files)
│ └── store/hr/ (8 NgRx slices, 24 files)
└── assets/i18n/{ar,en}.json (129+ HR keys)
| Component | Route | Permission | Features |
|---|---|---|---|
| Dashboard | /hr/dashboard | (none) | Workforce stats, charts, payroll summary, quick actions |
| Departments | /hr/departments | hrm.departments | CRUD, hierarchy tree, manager link, branch link |
| Positions | /hr/positions | hrm.positions | CRUD, salary ranges, department link |
| Employees | /hr/employees | hrm.employees | CRUD, 4-tab form, status management |
| Shifts | /hr/shifts | hrm.shifts | CRUD, night shift toggle, grace period |
| Attendance | /hr/attendance | hrm.attendance | CRUD, check-in/out, filters, status tags |
| Leave Types | /hr/leave-types | hrm.leave-types | CRUD, carry-forward, gender rules |
| Leave Requests | /hr/leave-requests | hrm.leave-requests | CRUD, approve/reject, multi-level |
| Salary Components | /hr/salary-components | hrm.salary-components | CRUD, earning/deduction, mandatory flag |
| Payroll | /hr/payroll | hrm.payroll | CRUD, calculate, approve, post, pay lifecycle |
| Loans | /hr/loans | hrm.loans | CRUD, approve, installment tracking |
| EOS | /hr/eos | hrm.eos | CRUD, preview calc, approve, pay |
| Job Openings | /hr/job-openings | hrm.job-openings | CRUD, publish/close, vacancy tracking |
| Candidates | /hr/candidates | hrm.candidates | CRUD, nested applications sub-dialog |
| KPIs | /hr/kpis | hrm.kpis | 2-tab: KPI definitions + Review Templates |
| Performance Reviews | /hr/performance-reviews | hrm.performance-reviews | CRUD, self/manager review, scoring |
| Training | /hr/training | hrm.training | 3-tab: Programs + Sessions + Enrollments |
| Reports | /hr/reports | hrm.reports | 6 reports: workforce, attendance, leave, payroll, loans, turnover |
| Settings | /hr/settings | hrm.settings | Key-value HR configuration (~25 settings) |
| Service | API Base | Key Methods |
|---|---|---|
| HrDepartmentService | /api/hr/departments | CRUD + listAll |
| HrPositionService | /api/hr/positions | CRUD + listAll |
| HrEmployeeService | /api/hr/employees | CRUD + terminate() |
| HrShiftService | /api/hr/shifts | CRUD + listAll |
| HrAttendanceService | /api/hr/attendance | CRUD + checkIn() + checkOut() |
| HrLeaveTypeService | /api/hr/leave-types | CRUD + listAll |
| HrLeaveRequestService | /api/hr/leave-requests | CRUD + approve() + reject() + cancel() |
| HrSalaryComponentService | /api/hr/salary-components | CRUD + listAll |
| HrPayrollService | /api/hr/payroll | CRUD + calculate() + approve() + post() + pay() |
| HrLoanService | /api/hr/loans | CRUD + approve() + reject() + cancel() |
| HrEosService | /api/hr/eos | CRUD + calculate() + approve() + pay() |
| HrJobOpeningService | /api/hr/job-openings | CRUD + publish() + close() |
| HrCandidateService | /api/hr/candidates | CRUD + listAll |
| HrApplicationService | /api/hr/applications | CRUD + updateStatus() |
| HrOfferService | /api/hr/offers | CRUD + send() + accept() + reject() |
| HrKpiService | /api/hr/kpis | CRUD + listAll |
| HrReviewTemplateService | /api/hr/review-templates | CRUD + listAll |
| HrPerformanceReviewService | /api/hr/performance-reviews | CRUD + submit() + approve() + complete() |
| HrTrainingProgramService | /api/hr/training-programs | CRUD + listAll |
| HrTrainingSessionService | /api/hr/training-sessions | CRUD + listAll |
| HrTrainingEnrollmentService | /api/hr/training-enrollments | CRUD + listAll |
| HrReportService | /api/hr/reports | workforce, attendance, leave, payroll, loans, turnover |
| HrSettingsService | /api/hr/settings | getAll() + update() |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/hr/departments | List (filters: search, branch_id, status, parent_id) |
| POST | /api/hr/departments | Create (name_ar*, name_en*, code, parent_id, manager_id, branch_id) |
| GET | /api/hr/departments/tree | Hierarchical tree view |
| GET | /api/hr/departments/{id} | Show single |
| PUT | /api/hr/departments/{id} | Update |
| DEL | /api/hr/departments/{id} | Delete (fails if has employees) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/hr/positions | List (filters: search, department_id, status) |
| POST | /api/hr/positions | Create (name_ar*, name_en*, code, department_id, grade, min/max_salary) |
| GET | /api/hr/positions/{id} | Show single |
| PUT | /api/hr/positions/{id} | Update |
| DEL | /api/hr/positions/{id} | Delete (fails if has employees) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/hr/employees | List (filters: search, department_id, position_id, branch_id, status, contract_type, manager_id) |
| POST | /api/hr/employees | Create (multipart/form-data: personal + employment + bank + documents[] + contacts[] + dependents[]) |
| GET | /api/hr/employees/{id} | Show with relations |
| PUT | /api/hr/employees/{id} | Update |
| DEL | /api/hr/employees/{id} | Soft-delete (fails if has payroll/attendance) |
| PUT | /api/hr/employees/{id}/status | Change status (active, on_leave, suspended, terminated, resigned) |
| POST | /api/hr/employees/{id}/documents | Upload document (max 5MB) |
| DEL | /api/hr/employees/{id}/documents/{doc} | Delete document |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/hr/shifts | List (filter: status) |
| POST | /api/hr/shifts | Create (name_ar*, name_en*, start_time*, end_time*, break, grace, night_shift) |
| GET | /api/hr/shifts/{id} | Show |
| PUT | /api/hr/shifts/{id} | Update |
| DEL | /api/hr/shifts/{id} | Delete (fails if has future schedules) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/hr/schedules | List (filters: employee_id, department_id, shift_id, date_from/to) |
| POST | /api/hr/schedules/bulk | Bulk create (employee_ids*, shift_id*, date_from/to*, days_of_week*) |
| PUT | /api/hr/schedules/{id} | Update (shift_id, date, actual_start/end, status) |
| DEL | /api/hr/schedules/{id} | Delete |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/hr/attendance | List (filters: employee_id, date_from/to, status) |
| POST | /api/hr/attendance/check-in | Check in (employee_id*, time, source) |
| POST | /api/hr/attendance/check-out | Check out (attendance_id*, time, source) |
| POST | /api/hr/attendance/bulk | Bulk check-in (employee_ids, date*, time*) |
| GET | /api/hr/attendance/summary | Summary (employee_id*, date_from*, date_to*) |
| POST | /api/hr/attendance/corrections | Submit correction (attendance_id*, corrected times, reason*) |
| PUT | /api/hr/attendance/corrections/{id}/approve | Approve/reject (action*: approve|reject) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/hr/leave-types | List (filters: search, is_active) |
| POST | /api/hr/leave-types | Create (name*, code*, max_days*, is_paid, carry_over, gender) |
| GET | /api/hr/leave-types/{id} | Show |
| PUT | /api/hr/leave-types/{id} | Update |
| DEL | /api/hr/leave-types/{id} | Delete |
| GET | /api/hr/leave-balances | List (filters: employee_id, fiscal_year, leave_type_id) |
| POST | /api/hr/leave-balances/initialize | Initialize for all active employees (fiscal_year*) |
| PUT | /api/hr/leave-balances/{id}/adjust | Adjust balance (days*, reason*) |
| GET | /api/hr/leave-requests | List (filters: employee_id, status, leave_type_id, date_from/to) |
| POST | /api/hr/leave-requests | Create & auto-submit (employee_id*, leave_type_id*, dates*, reason) |
| GET | /api/hr/leave-requests/calendar | Calendar view (date_from*, date_to*) |
| GET | /api/hr/leave-requests/{id} | Show |
| POST | /api/hr/leave-requests/{id}/approve | Approve (comments) |
| POST | /api/hr/leave-requests/{id}/reject | Reject (comments*) |
| POST | /api/hr/leave-requests/{id}/cancel | Cancel (restores balance) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/hr/salary-components | List (filters: search, component_type, is_active) |
| POST | /api/hr/salary-components | Create (name*, code*, type*: earning|deduction, calc_type, amount) |
| GET | /api/hr/salary-components/{id} | Show |
| PUT | /api/hr/salary-components/{id} | Update |
| DEL | /api/hr/salary-components/{id} | Delete |
| GET | /api/hr/employees/{id}/salary-structure | List employee salary structure |
| POST | /api/hr/employees/{id}/salary-structure | Assign component (component_id*, amount, effective_from*) |
| POST | /api/hr/salary-structures/apply-mandatory | Apply all mandatory components to active employees |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/hr/payroll | List (filters: year, status) |
| POST | /api/hr/payroll | Create (month*, year*, notes) |
| GET | /api/hr/payroll/{id} | Show with items |
| POST | /api/hr/payroll/{id}/calculate | Calculate salaries for all active employees |
| POST | /api/hr/payroll/{id}/approve | Approve payroll |
| POST | /api/hr/payroll/{id}/post | Post to accounting (creates journal entries) |
| POST | /api/hr/payroll/{id}/mark-paid | Mark as paid |
| POST | /api/hr/payroll/{id}/create-payment | Create bank payment JE (bank_account_id*) |
| GET | /api/hr/payroll/{id}/payslip | Get payslip (employee_id*) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/hr/loans | List (filters: employee_id, status, loan_type) |
| POST | /api/hr/loans | Create (employee_id*, type*, amount*, monthly_installment*, total_installments*) |
| GET | /api/hr/loans/active-installments | Pending installments (filters: month, year) |
| GET | /api/hr/loans/{id} | Show with installments |
| POST | /api/hr/loans/{id}/approve | Approve & generate installments |
| POST | /api/hr/loans/{id}/cancel | Cancel loan & pending installments |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/hr/job-openings | List (filters: status, department_id, employment_type) |
| POST | /api/hr/job-openings | Create (title*, department_id*, position_id*, employment_type*) |
| GET | /api/hr/job-openings/{id} | Show |
| PUT | /api/hr/job-openings/{id} | Update |
| DEL | /api/hr/job-openings/{id} | Delete |
| POST | /api/hr/job-openings/{id}/status | Status transition (draft→open→closed/filled) |
| GET | /api/hr/candidates | List (filters: source, search) |
| POST | /api/hr/candidates | Create (name_en*, email*, phone, source) |
| GET | /api/hr/candidates/{id} | Show |
| PUT | /api/hr/candidates/{id} | Update |
| DEL | /api/hr/candidates/{id} | Delete |
| GET | /api/hr/applications | List (filters: job_opening_id, stage, candidate_id) |
| POST | /api/hr/applications | Create (candidate_id*, job_opening_id*) |
| GET | /api/hr/applications/pipeline | Pipeline counts by stage |
| GET | /api/hr/applications/{id} | Show |
| POST | /api/hr/applications/{id}/stage | Advance stage (screening→interview→assessment→offer→hired) |
| GET | /api/hr/offers | List (filters: status, candidate_id) |
| POST | /api/hr/offers | Create (application_id*, position_id*, department_id*, salary*) |
| GET | /api/hr/offers/{id} | Show |
| POST | /api/hr/offers/{id}/send | Send offer |
| POST | /api/hr/offers/{id}/hire | Accept & auto-create employee |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/hr/kpis | List (filters: category, is_active) |
| POST | /api/hr/kpis | Create (name*, category*, weight, is_active) |
| GET | /api/hr/kpis/{id} | Show |
| PUT | /api/hr/kpis/{id} | Update |
| DEL | /api/hr/kpis/{id} | Delete |
| GET | /api/hr/review-templates | List (filters: is_active, review_type) |
| POST | /api/hr/review-templates | Create (name*, review_type, kpi_ids[]) |
| GET | /api/hr/review-templates/{id} | Show |
| PUT | /api/hr/review-templates/{id} | Update |
| DEL | /api/hr/review-templates/{id} | Delete |
| GET | /api/hr/performance-reviews | List (filters: employee_id, status, period) |
| POST | /api/hr/performance-reviews | Create (template_id*, period*, employee_ids[]) |
| POST | /api/hr/performance-reviews/bulk | Bulk create for multiple employees |
| GET | /api/hr/performance-reviews/{id} | Show |
| POST | /api/hr/performance-reviews/{id}/submit-self | Self-review scores (scores[]: kpi_id, score 0-10, comments) |
| POST | /api/hr/performance-reviews/{id}/submit-manager | Manager review scores |
| POST | /api/hr/performance-reviews/{id}/finalize | HR finalize + calc final score |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/hr/training-programs | List (filters: category, is_active) |
| POST | /api/hr/training-programs | Create (name*, category*, duration_hours, is_mandatory) |
| GET | /api/hr/training-programs/{id} | Show |
| PUT | /api/hr/training-programs/{id} | Update |
| DEL | /api/hr/training-programs/{id} | Delete |
| GET | /api/hr/training-sessions | List (filters: program_id, status) |
| POST | /api/hr/training-sessions | Create (program_id*, session_date*, location, trainer, max_participants) |
| GET | /api/hr/training-sessions/{id} | Show |
| PUT | /api/hr/training-sessions/{id} | Update |
| POST | /api/hr/training-sessions/{id}/status | Status transition (scheduled→in_progress→completed) |
| GET | /api/hr/training-enrollments | List (filters: session_id, employee_id, status) |
| POST | /api/hr/training-enrollments | Enroll (session_id*, employee_id*) |
| PUT | /api/hr/training-enrollments/{id} | Update (status, score, feedback) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/hr/eos | List (filters: employee_id, status) |
| POST | /api/hr/eos | Create & auto-calculate (employee_id*, settlement_type*, last_working_day*) |
| POST | /api/hr/eos/calculate-preview | Preview calculation without saving |
| GET | /api/hr/eos/{id} | Show |
| POST | /api/hr/eos/{id}/approve | Approve settlement |
| POST | /api/hr/eos/{id}/pay | Mark as paid |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/hr/reports/workforce | Headcount, status, departments, avg tenure |
| GET | /api/hr/reports/attendance | Present/absent/late, attendance rate |
| GET | /api/hr/reports/leave | By type/status, approval rates |
| GET | /api/hr/reports/payroll-summary | Earnings/deductions/net |
| GET | /api/hr/reports/loans | Active/completed, outstanding |
| GET | /api/hr/reports/turnover | Hires/separations/turnover rate |
| GET | /api/hr/settings | Get all HR settings with definitions |
| PUT | /api/hr/settings | Bulk update (~25 settings) |
| Model | Key Fields | Relationships |
|---|---|---|
| Department | name_ar, name_en, code, parent_id, manager_id, branch_id, status | parent, children, manager(Employee), branch, employees |
| Position | name_ar, name_en, code, department_id, grade, min_salary, max_salary | department, employees |
| Employee | employee_number, names (ar/en), user_id, department_id, position_id, branch_id, manager_id, hire_date, contract_type/dates, status, basic_salary, bank info, personal info | department, position, branch, manager, subordinates, documents, emergencyContacts, dependents, schedules, attendances, salaryStructures |
| EmployeeDocument | employee_id, document_type, title, file_path, issue_date, expiry_date | employee |
| EmergencyContact | employee_id, name, relationship, phone, alternative_phone, address | employee |
| EmployeeDependent | employee_id, name, relationship, date_of_birth, national_id | employee |
| Model | Key Fields | Relationships |
|---|---|---|
| Shift | name_ar, name_en, start_time, end_time, break_duration, working_hours, is_night_shift, grace_period, overtime_start_after | schedules |
| ShiftSchedule | employee_id, shift_id, date | employee, shift |
| Attendance | employee_id, date, check_in, check_out, status, worked_hours, overtime_hours, late_minutes, early_leave_minutes, source | employee, corrections |
| AttendanceCorrection | attendance_id, correction_type, reason, corrected_check_in/out, status, requested_by, approved_by | attendance, employee |
| Model | Key Fields | Relationships |
|---|---|---|
| LeaveType | name_ar, name_en, code, max_days_per_year, is_paid, requires_attachment, carry_over, max_carry_over_days, gender, min_service_months | balances |
| LeaveBalance | employee_id, leave_type_id, year, opening_balance, accrued_days, used_days, carry_over_days, closing_balance | employee, leaveType |
| LeaveRequest | employee_id, leave_type_id, start_date, end_date, total_days, reason, status, attachment_path | employee, leaveType, approvals |
| LeaveApproval | leave_request_id, level, approver_id, action, comments, acted_at | leaveRequest, approver |
| Model | Key Fields | Relationships |
|---|---|---|
| SalaryComponent | name_ar, name_en, code, component_type (earning/deduction), calculation_type (fixed/percentage), default_amount, is_mandatory, is_taxable | salaryStructures |
| SalaryStructure | employee_id, salary_component_id, amount, calculation_type, percentage_value, effective_from, effective_to | employee, salaryComponent |
| Payroll | payroll_number, month, year, period, status, totals (earnings/deductions/net), employee_count, journal_entry_id | items, journalEntry |
| PayrollItem | payroll_id, employee_id, basic_salary, working/absent days, overtime, totals | payroll, employee |
| PayrollItemDetail | payroll_item_id, salary_component_id, amount, calculation_basis, is_earning | payrollItem, salaryComponent |
| Model | Key Fields | Relationships |
|---|---|---|
| EmployeeLoan | loan_number, employee_id, loan_type, amount, monthly_installment, total/paid installments, remaining_amount, status | employee, installments |
| LoanInstallment | loan_id, installment_number, due_date, amount, paid_amount, status | loan |
| EosSettlement | settlement_number, employee_id, settlement_type, last_working_day, years_of_service, eos_amount, leave_balance_amount, loan_deduction, net_amount, calculation_details (JSON) | employee, journalEntry |
| Model | Key Fields | Relationships |
|---|---|---|
| JobOpening | opening_number, title, department_id, position_id, number_of_positions, filled_positions, status, employment_type, salary_range, closing_date | department, position, branch |
| Candidate | name_en, name_ar, email, phone, source, resume_path | applications |
| JobApplication | candidate_id, job_opening_id, stage (applied→hired), status, resume_path | candidate, jobOpening |
| JobOffer | application_id, offer_number, salary, start_date, contract_type, terms, status (draft→accepted) | application |
| Model | Key Fields | Relationships |
|---|---|---|
| Kpi | name_en, name_ar, category, weight, is_active | (none) |
| ReviewTemplate | name_en, name_ar, kpi_ids (JSON array), is_active | (none) |
| PerformanceReview | employee_id, reviewer_id, template_id, period, status, self/manager/final_score, comments | employee, reviewer, template, scores |
| ReviewScore | performance_review_id, kpi_id, self/manager/final_score, comments | performanceReview, kpi |
| TrainingProgram | name, category, duration_hours, is_mandatory, is_active | sessions |
| TrainingSession | program_id, session_date, location, trainer, max_participants, status | program, enrollments |
| TrainingEnrollment | session_id, employee_id, status, score, feedback | session, employee |
| Service | Methods | Description |
|---|---|---|
| AttendanceService | checkIn(), checkOut(), summary() | Handles check-in/out with late detection, calculates worked/overtime hours |
| PayrollService | calculate() | Calculates payroll: daily_rate=basic/30, hourly=daily/8, overtime=hours*hourly*1.5 |
| LeaveRequestService | submit(), approve(), reject(), cancel() | Multi-level approval workflow, working days calculation |
| LeaveBalanceService | adjustBalance(), deductBalance(), getAvailableBalance() | Manages leave balance operations and deductions |
| EosService | calculatePreview(), calculate() | Saudi Labor Law EOS formula, resignation discount, leave balance payout |
| RecruitmentService | advanceStage(), getPipeline(), hire() | Stage transitions, pipeline stats, auto-create employee from offer |
| SalaryStructureService | assignToEmployee(), applyMandatory(), getCurrentStructure() | Component assignment, mandatory application, salary change recalculation |
| PerformanceService | bulkCreateReviews(), submitSelf/Manager(), finalize() | Multi-step review workflow with scoring |
| LoanService | approve(), calculateInstallments(), deductFromPayroll() | Loan approval, installment generation, payroll deduction |
| PayrollAccountingService | postToAccounting(), createPaymentEntry() | Journal entry creation for salary expenses and payments |
| HrReportService | workforceStatistics(), attendance/leave/payroll/loan/turnover reports | All 6 report types with filters |
| Enum | Values |
|---|---|
| EmployeeStatus | active, on_leave, suspended, terminated, resigned |
| ContractType | permanent, contract, part_time, probation |
| PaymentMethod | bank_transfer, cash, check |
| Gender | male, female |
| MaritalStatus | single, married, divorced, widowed |
| AttendanceStatus | present, absent, late, on_leave, excused |
| AttendanceSource | manual, biometric, mobile, web |
| CorrectionStatus | pending, approved, rejected |
| LeaveRequestStatus | pending, manager_approved, approved, rejected, cancelled |
| PayrollStatus | draft, calculated, approved, posted, paid |
| PayrollCycle | monthly, biweekly, weekly |
| SalaryCalcDays | 28, 30, 365 |
| ComponentType | earning, deduction |
| CalculationType | fixed, percentage, formula |
| LoanType | loan, advance |
| LoanStatus | pending, approved, active, completed, cancelled |
| InstallmentStatus | pending, paid, cancelled |
| JobOpeningStatus | draft, open, on_hold, closed, filled |
| EmploymentType | full_time, part_time, contract |
| CandidateSource | website, referral, agency, linkedin, other |
| ApplicationStage | applied, screening, interview, assessment, offer, hired, rejected |
| OfferStatus | draft, sent, accepted, rejected, withdrawn |
| KpiCategory | quality, productivity, attendance, teamwork, leadership, communication |
| ReviewType | annual, probation, quarterly, monthly |
| ReviewStatus | draft, self_review, manager_review, manager_approved, finalized |
| TrainingCategory | technical, soft_skills, compliance, leadership, safety, onboarding |
| SessionStatus | scheduled, in_progress, completed, cancelled |
| EnrollmentStatus | enrolled, attended, completed, cancelled, no_show |
| EosSettlementType | resignation, termination, end_of_contract, retirement, death |
| EosCalcMethod | saudi_labor_law, kuwait_labor_law, custom |
departments - hierarchy with parent_id, manager, branch, statuspositions - name, grade, min/max salary, department FKemployees - comprehensive master data (40+ columns)employee_documents - file attachments per employeeemergency_contacts - multiple contacts per employeeemployee_dependents - spouse, children, etc.shifts - shift definitions with hours and rulesshift_schedules - employee-to-shift assignments by dateattendances - daily records, unique per (employee_id, date)attendance_corrections - correction requests with approval workflowleave_types - policy definitions (paid, carry-over, gender, service requirements)leave_balances - per employee, per type, per fiscal yearleave_requests - applications with multi-level approvalleave_approvals - approval chain trackingsalary_components - earnings/deductions definitionssalary_structures - employee-component assignments with effective datespayrolls - monthly batch with totals, unique per (company, month, year)payroll_items - per-employee breakdownpayroll_item_details - component-level amountsemployee_loans - principal, installments, statusloan_installments - monthly installment trackingeos_settlements - end-of-service with calculation breakdown (JSON)job_openings - vacancies with salary range and status transitionscandidates - external applicants with source trackingjob_applications - pipeline stages (applied → hired)job_offers - offer terms with send/accept/reject lifecyclekpis - KPI definitions with categories and weightsreview_templates - template structures linking KPIsperformance_reviews - multi-step scoring workflowreview_scores - KPI-level scores per reviewtraining_programs - program definitions (mandatory/optional)training_sessions - scheduled sessions with capacitytraining_enrollments - employee enrollment with score/feedback| Category | Key | Type | Default |
|---|---|---|---|
| Work Schedule | work_days_per_week | integer (1-7) | 5 |
| weekend_days | array | ['friday', 'saturday'] | |
| default_shift_id | FK | null | |
| Attendance | overtime_rate_multiplier | decimal (1-5) | 1.5 |
| late_threshold_minutes | integer (0-240) | 15 | |
| absent_threshold_minutes | integer (0-480) | 240 | |
| require_checkout | boolean | true | |
| Leave | leave_approval_levels | integer (1-3) | 1 |
| allow_negative_leave_balance | boolean | false | |
| max_carry_over_days | integer (0-365) | 5 | |
| Payroll | payroll_cycle | monthly|biweekly|weekly | monthly |
| salary_calculation_days | 28|30|365 | 30 | |
| working_hours_per_day | decimal (1-24) | 8 | |
| Accounting | salary_expense_account_id | FK | null |
| salary_payable_account_id | FK | null | |
| social_insurance_account_id | FK | null | |
| medical_insurance_account_id | FK | null | |
| income_tax_account_id | FK | null | |
| loan_receivable_account_id | FK | null | |
| eos_provision_account_id / eos_expense_account_id | FK | null | |
| Self-Service | employee_self_service | boolean | false |
| allow_attendance_self_checkin | boolean | false | |
| EOS | eos_calculation_method | saudi_labor_law|kuwait_labor_law|custom | saudi_labor_law |
| Probation | probation_period_months | integer (0-12) | 3 |