Payroll
The Payroll entity, mapped to the payroll table.
| Table | payroll |
| Tenant-scoped | Yes — extends TenantOwned |
| Columns | 14 |
| Relationships | 0 |
| Source | backend/src/main/java/com/motorph/payroll/model/Payroll.java |
Columns
| Field | Type | Column | Null | Notes |
|---|---|---|---|---|
payrollId | Integer | payroll_id | — | primary key, generated |
payrollRunDate | LocalDate | payroll_run_date | — | — |
periodStartDate | LocalDate | period_start_date | — | — |
periodEndDate | LocalDate | period_end_date | — | — |
status | String | status | — | — |
payFrequency | PayFrequency | pay_frequency | Yes | enum |
replacesPayrollId | Integer | replaces_payroll_id | Yes | — |
cancellationReason | String | cancellation_reason | Yes | — |
createdBy | String | created_by | Yes | — |
settingsVersion | Integer | settings_version | Yes | — |
settingsCapturedAt | LocalDateTime | settings_captured_at | Yes | — |
createdDate | LocalDateTime | created_date | Yes | — |
lastModifiedBy | String | last_modified_by | Yes | — |
lastModifiedDate | LocalDateTime | last_modified_date | Yes | — |
Plus tenant_id, inherited from TenantOwned. Hibernate stamps it on insert and adds where tenant_id = ? to every query, so it is never written or read by application code.
Referenced by
| Entity | Field | Kind |
|---|---|---|
| PayrollApproval | payroll | @ManyToOne |
| PayrollChange | payroll | @ManyToOne |
| PayrollPayoutBatch | payroll | @ManyToOne |
| PayrollTransaction | payroll | @ManyToOne |
| Payslip | payroll | @ManyToOne |
| RecognitionAward | payroll | @ManyToOne |
Neighbourhood
Repository
PayrollRepository
Declared over Payroll with id type Integer, with JpaSpecificationExecutor for dynamic filtering. Source: backend/src/main/java/com/motorph/payroll/repository/PayrollRepository.java
| Method | Returns | Notes |
|---|---|---|
existsOverlappingPeriod(@Param("periodStartDate") LocalDate periodStartDate, @Param("periodEndDate") LocalDate periodEndDate, @Param("excludedStatuses") Collection<String> excludedStatuses) | boolean | explicit @Query |
findLatestPeriodEndDate(@Param("excludedStatuses") Collection<String> excludedStatuses) | LocalDate | explicit @Query |
findLaterRunIdsWithPayslips(@Param("after") LocalDate after, @Param("excludedStatuses") Collection<String> excludedStatuses) | List<Integer> | explicit @Query |
findOverlapping(@Param("from") LocalDate from, @Param("to") LocalDate to, @Param("statuses") Collection<String> statuses) | List<Payroll> | explicit @Query |
findFirstByReplacesPayrollIdOrderByPayrollIdDesc(Integer replacesPayrollId) | Optional<Payroll> | derived |
findByStatusInAndPayrollRunDateBetweenOrderByPayrollRunDateAscPayrollIdAsc(Collection<String> statuses, LocalDate from, LocalDate to) | List<Payroll> | derived |
findByStatusInAndPeriodEndDateBetweenOrderByPeriodEndDateAscPayrollIdAsc(Collection<String> statuses, LocalDate from, LocalDate to) | List<Payroll> | derived |
findByStatusNotInAndPeriodEndDateBeforeOrderByPeriodEndDateDescPayrollIdDesc(Collection<String> statuses, LocalDate before) | List<Payroll> | derived |
findLatestRunEvidence(@Param("statuses") Collection<String> statuses, Limit limit) | List<RunEvidence> | explicit @Query |
findLatestRunEvidenceWithPayslips(@Param("statuses") Collection<String> statuses, Limit limit) | List<RunEvidence> | explicit @Query |
Reached by
These controllers hold — directly or through a service they depend on — a repository over Payroll.
| Controller | Base path | Endpoints | Module |
|---|---|---|---|
| DemoDataController | /api/system-admin/demo-data | 3 | Billing & Platform |
| GovernmentFormsController | /api/government-forms | 16 | PH Statutory |
| LeaveRequestController | /api/leave-requests | 7 | HR |
| OvertimeRequestController | /api/overtime-requests | 7 | HR |
| PayoutBatchController | /api/payroll | 7 | Payroll |
| PayrollChangesController | /api/payroll-changes | 1 | Payroll |
| PayrollController | /api/payroll | 10 | Payroll |
| PayrollOnboardingController | /api/onboarding/payroll | 1 | Payroll |
| PayrollRunReportsController | /api/payroll/{payrollId} | 5 | Payroll |
| PayrollTransactionController | /api/payroll-transactions | 6 | Payroll |
| PublicPayrollSimulatorController | /api/public/payroll-simulator | 3 | Payroll |
| RecognitionAwardController | /api/recognition-awards | 7 | HR |
| TimesheetController | /api/timesheets | 10 | HR |
Generated page
This page is rebuilt from the source on every docs build by docs-site/scripts/gen-code-wiki.mjs. Editing it has no effect — change the code, or, if what you want to say is prose, write it in docs/.