StaffingPlan
The StaffingPlan entity, mapped to the staffing_plan table.
| Table | staffing_plan |
| Tenant-scoped | Yes — extends TenantOwned |
| Columns | 6 |
| Relationships | 3 |
| Source | backend/src/main/java/com/motorph/payroll/model/StaffingPlan.java |
Columns
| Field | Type | Column | Null | Notes |
|---|---|---|---|---|
planId | Integer | plan_id | — | primary key, generated |
planName | String | plan_name | — | — |
fiscalYear | Integer | fiscal_year | — | — |
totalBudget | BigDecimal | total_budget | Yes | — |
status | String | status | — | — |
createdAt | LocalDateTime | created_at | — | — |
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 |
|---|---|---|---|---|
department | @ManyToOne | Department | department_id | — |
createdBy | @ManyToOne | Employee | created_by | Yes |
items | @OneToMany | StaffingPlanItem | mapped by plan | — |
Referenced by
| Entity | Field | Kind |
|---|---|---|
| StaffingPlanItem | plan | @ManyToOne |
Neighbourhood
Repository
StaffingPlanRepository
Declared over StaffingPlan with id type Integer, with JpaSpecificationExecutor for dynamic filtering. Source: backend/src/main/java/com/motorph/payroll/repository/StaffingPlanRepository.java
| Method | Returns | Notes |
|---|---|---|
findWithDetailsByPlanId(Integer planId) | Optional<StaffingPlan> | derived |
findAllByOrderByFiscalYearDescPlanIdDesc() | List<StaffingPlan> | derived |
Reached by
These controllers hold — directly or through a service they depend on — a repository over StaffingPlan.
| Controller | Base path | Endpoints | Module |
|---|---|---|---|
| StaffingPlanController | /api/staffing-plans | 7 | Recruitment |
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/.