Skip to main content

LeaveRequest

The LeaveRequest entity, mapped to the leave_request table.

Tableleave_request
Tenant-scopedYes — extends TenantOwned
Columns8
Relationships3
Sourcebackend/src/main/java/com/motorph/payroll/model/LeaveRequest.java

Columns​

FieldTypeColumnNullNotes
leaveRequestIdIntegerleave_request_id—primary key, generated
dateRequestedLocalDatedate_requested——
startDateLocalDatestart_dateYes—
endDateLocalDateend_dateYes—
statusStringstatus——
adminApprovalDateLocalDateTimeadmin_approval_dateYes—
descriptionStringdescription——
isPaidBooleanis_paid——

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
approver@ManyToOneEmployeeadmin_approval_employee_id—

Neighbourhood​

Repository​

LeaveRequestRepository​

Declared over LeaveRequest with id type Integer, with JpaSpecificationExecutor for dynamic filtering. Source: backend/src/main/java/com/motorph/payroll/repository/LeaveRequestRepository.java

MethodReturnsNotes
findWithDetailsByLeaveRequestId(Integer leaveRequestId)Optional<LeaveRequest>derived
findAllByEmployee_EmployeeNumberOrderByDateRequestedDesc(Integer employeeId)List<LeaveRequest>derived
findAllByEmployee_EmployeeNumberAndStatusIn(Integer employeeId, Collection<String> statuses)List<LeaveRequest>derived
findApprovedOverlapping(@Param("employeeNumber") Integer employeeNumber, @Param("periodStart") LocalDate periodStart, @Param("periodEnd") LocalDate periodEnd)List<LeaveRequest>explicit @Query

Reached by​

These controllers hold — directly or through a service they depend on — a repository over LeaveRequest.

ControllerBase pathEndpointsModule
DemoDataController/api/system-admin/demo-data3Billing & Platform
LeaveRequestController/api/leave-requests7HR
PayrollController/api/payroll8Payroll
RecognitionAwardController/api/recognition-awards7HR

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