PayrollPayoutBatch
A set of payslips paid together (PAYOUT) or settled after the fact (HISTORICAL).
| Table | payroll_payout_batch |
| Tenant-scoped | Yes — extends TenantOwned |
| Columns | 14 |
| Relationships | 3 |
| Source | backend/src/main/java/com/motorph/payroll/model/PayrollPayoutBatch.java |
Columns
| Field | Type | Column | Null | Notes |
|---|---|---|---|---|
payoutBatchId | Integer | payout_batch_id | — | primary key, generated |
batchNo | String | batch_no | — | — |
kind | String | kind | — | — |
payoutMethod | String | payout_method | — | — |
payDate | LocalDate | pay_date | — | — |
reference | String | reference | Yes | — |
status | String | status | — | — |
totalAmount | BigDecimal | total_amount | — | — |
payslipCount | Integer | payslip_count | — | — |
createdBy | String | created_by | Yes | — |
createdAt | LocalDateTime | created_at | — | — |
voidedBy | String | voided_by | Yes | — |
voidedAt | LocalDateTime | voided_at | Yes | — |
voidReason | String | void_reason | 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.
Relationships
| Field | Kind | Target | Join column | Required |
|---|---|---|---|---|
payroll | @ManyToOne | Payroll | payroll_id | Yes |
paidFromAccount | @ManyToOne | Account | paid_from_account_id | Yes |
lines | @OneToMany | PayrollPayoutBatchLine | mapped by batch | — |
Referenced by
| Entity | Field | Kind |
|---|---|---|
| PayrollPayoutBatchLine | batch | @ManyToOne |
Neighbourhood
Repository
PayrollPayoutBatchRepository
Declared over PayrollPayoutBatch with id type Integer, with JpaSpecificationExecutor for dynamic filtering. Source: backend/src/main/java/com/motorph/payroll/repository/PayrollPayoutBatchRepository.java
| Method | Returns | Notes |
|---|---|---|
lockById(@Param("id") Integer id) | Optional<PayrollPayoutBatch> | explicit @Query |
findAllByPayroll_PayrollIdOrderByPayoutBatchIdDesc(Integer payrollId) | List<PayrollPayoutBatch> | derived |
existsByPayroll_PayrollIdAndStatus(Integer payrollId, String status) | boolean | derived |
countByStatus() | List<Object[]> | explicit @Query |
findLatestPayoutEvidence(@Param("kind") String kind, @Param("status") String status, @Param("runStatuses") Collection<String> runStatuses, Limit limit) | List<PayoutEvidence> | explicit @Query |
Reached by
These controllers hold — directly or through a service they depend on — a repository over PayrollPayoutBatch.
| Controller | Base path | Endpoints | Module |
|---|---|---|---|
| PayoutBatchController | /api/payroll | 7 | Payroll |
| PayrollOnboardingController | /api/onboarding/payroll | 1 | Payroll |
| PayrollRunReportsController | /api/payroll/{payrollId} | 5 | Payroll |
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/.