Bonus
The Bonus entity, mapped to the bonus table.
| Table | bonus |
| Tenant-scoped | Yes — extends TenantOwned |
| Columns | 8 |
| Relationships | 1 |
| Source | backend/src/main/java/com/motorph/payroll/model/Bonus.java |
Columns
| Field | Type | Column | Null | Notes |
|---|---|---|---|---|
bonusId | Integer | bonus_id | — | primary key, generated |
bonusAmount | BigDecimal | bonus_amount | — | — |
bonusDate | LocalDate | bonus_date | — | — |
description | String | description | — | — |
createdBy | String | created_by | — | — |
createdDate | LocalDateTime | created_date | — | — |
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.
Relationships
| Field | Kind | Target | Join column | Required |
|---|---|---|---|---|
employee | @ManyToOne | Employee | employee_number | Yes |
Neighbourhood
Repository
BonusRepository
Declared over Bonus with id type Integer, with JpaSpecificationExecutor for dynamic filtering. Source: backend/src/main/java/com/motorph/payroll/repository/BonusRepository.java
| Method | Returns | Notes |
|---|---|---|
findWithEmployeeByBonusId(Integer bonusId) | Optional<Bonus> | derived |
findYearToDateBonusForAllEmployees(@Param("year") Integer year) | List<EmployeeBonusYtdDto> | explicit @Query |
findMonthlyBonusTotal(@Param("year") Integer year, @Param("month") Integer month) | BigDecimal | explicit @Query |
findYearToDateBonusForEmployee(@Param("employeeNumber") Integer employeeNumber, @Param("year") Integer year, @Param("excludeBonusId") Integer excludeBonusId) | BigDecimal | explicit @Query |
Reached by
These controllers hold — directly or through a service they depend on — a repository over Bonus.
| Controller | Base path | Endpoints | Module |
|---|---|---|---|
| BonusController | /api/bonuses | 6 | Payroll |
| DemoDataController | /api/system-admin/demo-data | 3 | Billing & Platform |
| GovernmentFormsController | /api/government-forms | 8 | PH Statutory |
| ReportingController | /api/reports | 16 | Platform Misc |
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/.