LeaveBalance
The LeaveBalance entity, mapped to the leave_balance table.
| Table | leave_balance |
| Tenant-scoped | Yes — extends TenantOwned |
| Columns | 2 |
| Relationships | 2 |
| Source | backend/src/main/java/com/motorph/payroll/model/LeaveBalance.java |
Columns
| Field | Type | Column | Null | Notes |
|---|---|---|---|---|
balanceId | Integer | balance_id | — | primary key, generated |
balance | Integer | balance | — | — |
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_id | Yes |
leaveType | @ManyToOne | LeaveRequestType | leave_type_id | Yes |
Neighbourhood
Repository
LeaveBalanceRepository
Declared over LeaveBalance with id type Integer. Source: backend/src/main/java/com/motorph/payroll/repository/LeaveBalanceRepository.java
| Method | Returns | Notes |
|---|---|---|
findAllByEmployee_EmployeeNumber(Integer employeeId) | List<LeaveBalance> | derived |
findByEmployee_EmployeeNumberAndLeaveType_LeaveTypeId(Integer employeeId, Integer leaveTypeId) | Optional<LeaveBalance> | derived |
Reached by
These controllers hold — directly or through a service they depend on — a repository over LeaveBalance.
| Controller | Base path | Endpoints | Module |
|---|---|---|---|
| DemoDataController | /api/system-admin/demo-data | 3 | Billing & Platform |
| LeaveBalanceController | /api/leave-balances | 1 | HR |
| LeaveRequestController | /api/leave-requests | 7 | 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/.