Skip to main content

LeaveBalance

The LeaveBalance entity, mapped to the leave_balance table.

Tableleave_balance
Tenant-scopedYes — extends TenantOwned
Columns2
Relationships2
Sourcebackend/src/main/java/com/motorph/payroll/model/LeaveBalance.java

Columns​

FieldTypeColumnNullNotes
balanceIdIntegerbalance_id—primary key, generated
balanceIntegerbalance——

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​

FieldKindTargetJoin columnRequired
employee@ManyToOneEmployeeemployee_idYes
leaveType@ManyToOneLeaveRequestTypeleave_type_idYes

Neighbourhood​

Repository​

LeaveBalanceRepository​

Declared over LeaveBalance with id type Integer. Source: backend/src/main/java/com/motorph/payroll/repository/LeaveBalanceRepository.java

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

ControllerBase pathEndpointsModule
DemoDataController/api/system-admin/demo-data3Billing & Platform
LeaveBalanceController/api/leave-balances1HR
LeaveRequestController/api/leave-requests7HR

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