Skip to main content

Payroll

The Payroll entity, mapped to the payroll table.

Tablepayroll
Tenant-scopedYes — extends TenantOwned
Columns14
Relationships0
Sourcebackend/src/main/java/com/motorph/payroll/model/Payroll.java

Columns​

FieldTypeColumnNullNotes
payrollIdIntegerpayroll_id—primary key, generated
payrollRunDateLocalDatepayroll_run_date——
periodStartDateLocalDateperiod_start_date——
periodEndDateLocalDateperiod_end_date——
statusStringstatus——
payFrequencyPayFrequencypay_frequencyYesenum
replacesPayrollIdIntegerreplaces_payroll_idYes—
cancellationReasonStringcancellation_reasonYes—
createdByStringcreated_byYes—
settingsVersionIntegersettings_versionYes—
settingsCapturedAtLocalDateTimesettings_captured_atYes—
createdDateLocalDateTimecreated_dateYes—
lastModifiedByStringlast_modified_byYes—
lastModifiedDateLocalDateTimelast_modified_dateYes—

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​

EntityFieldKind
PayrollApprovalpayroll@ManyToOne
PayrollChangepayroll@ManyToOne
PayrollPayoutBatchpayroll@ManyToOne
PayrollTransactionpayroll@ManyToOne
Payslippayroll@ManyToOne
RecognitionAwardpayroll@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

MethodReturnsNotes
existsOverlappingPeriod(@Param("periodStartDate") LocalDate periodStartDate, @Param("periodEndDate") LocalDate periodEndDate, @Param("excludedStatuses") Collection<String> excludedStatuses)booleanexplicit @Query
findLatestPeriodEndDate(@Param("excludedStatuses") Collection<String> excludedStatuses)LocalDateexplicit @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.

ControllerBase pathEndpointsModule
DemoDataController/api/system-admin/demo-data3Billing & Platform
GovernmentFormsController/api/government-forms16PH Statutory
LeaveRequestController/api/leave-requests7HR
OvertimeRequestController/api/overtime-requests7HR
PayoutBatchController/api/payroll7Payroll
PayrollChangesController/api/payroll-changes1Payroll
PayrollController/api/payroll10Payroll
PayrollOnboardingController/api/onboarding/payroll1Payroll
PayrollRunReportsController/api/payroll/{payrollId}5Payroll
PayrollTransactionController/api/payroll-transactions6Payroll
PublicPayrollSimulatorController/api/public/payroll-simulator3Payroll
RecognitionAwardController/api/recognition-awards7HR
TimesheetController/api/timesheets10HR

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/.