Skip to main content

EmployeeDeduction

Assignment of a DeductionType + amount to a specific employee.

Tableemployee_deductions
Tenant-scopedYes — extends TenantOwned
Columns12
Relationships2
Sourcebackend/src/main/java/com/motorph/payroll/model/EmployeeDeduction.java

Columns​

FieldTypeColumnNullNotes
employeeDeductionIdIntegeremployee_deduction_id—primary key, generated
amountBigDecimalamount——
amountBasisDeductionAmountBasisamount_basis—enum
isRecurringBooleanis_recurring——
startDateLocalDatestart_date——
endDateLocalDateend_dateYes—
activeBooleanactive——
notesStringnotesYes—
createdByStringcreated_by——
createdDateLocalDateTimecreated_date——
lastModifiedByStringlast_modified_byYes—
lastModifiedDateLocalDateTimelast_modified_dateYes—

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_numberYes
deductionType@ManyToOneDeductionTypededuction_type_idYes

Referenced by​

EntityFieldKind
PayslipDeductionItememployeeDeduction@ManyToOne

Neighbourhood​

Repository​

EmployeeDeductionRepository​

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

MethodReturnsNotes
findWithDetailsByEmployeeDeductionId(Integer employeeDeductionId)Optional<EmployeeDeduction>derived
existsByDeductionType_DeductionTypeId(Integer deductionTypeId)booleanderived
findApplicable(@Param("employeeNumber") Integer employeeNumber, @Param("periodStart") LocalDate periodStart, @Param("periodEnd") LocalDate periodEnd)List<EmployeeDeduction>explicit @Query

Reached by​

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

ControllerBase pathEndpointsModule
DeductionTypeController/api/deduction-types4Payroll
DemoDataController/api/system-admin/demo-data3Billing & Platform
EmployeeDeductionController/api/employee-deductions5Payroll
PayrollController/api/payroll8Payroll

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