Complete inventory of the Disciplinary subsystem — violation policies (with thresholds and exemptions), recorded violations, automated triggers, disciplinary actions, and suspensions (with payroll recovery).
Source of truth: core-backend-service source plus a live pass (Playwright, "Pade Demo" tenant, 2026-07-20; screenshots) with a network capture.
Backend scale (verified 2026-07-20)
| Service |
Lines |
Role |
DisciplinaryService.cs |
2,049 |
Core domain — violations, policies, triggers, suspensions |
AdminDisciplinaryService.cs |
1,126 |
Admin orchestration |
Employee/DisciplinaryService.cs |
215 |
Employee self-service (view/dispute) |
Employee/MileStoneEmailExemptionsService.cs |
102 |
Milestone-email opt-outs (a separate exemption) |
| Total |
~3,492 |
|
Controllers
| Controller |
Endpoints |
Admin/DisciplinaryController |
31 |
DisciplinaryController |
6 |
Employee/DisciplinaryController |
5 |
Employee/MileStoneEmailExemptionsController |
3 |
1. The model (TenantDb, CompanyId-scoped)
ViolationPolicy ──> ViolationAction (what happens)
│ EmployeeViolationTypeId, ViolationCount, HasThreshold
└──< ViolationPolicyExemption ──> Person (who's exempt)
EmployeeViolation ──> Person (offender), TargetPersonId (victim, optional)
│ Source (Employee/System), Status (New/Approved/Declined), Type
└──< EmployeeViolationItem (timeline: Action / Comment / Update)
EmployeeViolationTrigger ──> ViolationAction, Amount (auto-raised at threshold)
│ TriggerStatus (New/Approved/Declined)
EmployeeSuspension ──> EmployeeRequestId (→ Requests), RecoveredInPayrollId (→ Payroll)
│ IsSuspended, SuspensionDate, IsReinstated, ReinstatementDate, HasBeenRecovered
PayrollExemption ──> PayrollId, Person (exempt from a run)
MilestoneEmailExemption (opt out of anniversary/milestone emails)
| Entity |
Purpose |
Key fields |
ViolationPolicy |
Rule: type + threshold → action |
EmployeeViolationTypeId, ViolationActionId, ViolationCount, HasThreshold |
ViolationAction |
The consequence |
Deduction / Demotion / Redeployment / Suspension / Termination / Probation |
ViolationPolicyExemption |
People exempt from a policy |
ViolationPolicyId, PersonId |
EmployeeViolation |
A recorded violation |
PersonId, TargetPersonId, EmployeeViolationSourceId, EmployeeViolationStatusId, EmployeeViolationTypeId |
EmployeeViolationItem |
Violation timeline entry |
type Action/Comment/Update |
EmployeeViolationTrigger |
Auto-raised action at threshold |
ViolationActionId, Amount, EmployeeViolationTriggerStatusId |
EmployeeSuspension |
A suspension |
EmployeeRequestId, IsSuspended, SuspensionDate, IsReinstated, HasBeenRecovered, RecoveredInPayrollId |
PayrollExemption |
Exempt from a payroll run |
PayrollId, PersonId, StartDate/StopDate, Period/IntervalId |
MilestoneEmailExemption |
Opt out of milestone emails |
PersonId |
2. Enums (DisciplinaryModel.cs)
| Enum |
Values |
ViolationActionParams |
Deduction · Demotion · Redeployment · Suspension · Termination · Probation |
EmployeeViolationSourceParams |
Employee · System (manual vs auto-raised) |
EmployeeViolationStatuParams |
New · Approved · Declined |
EmployeeViolationTriggerStatuParams |
New · Approved · Declined |
EmployeeViolationItemTypeParams |
Action · Comment · Update |
EmployeeViolationItemStatuParams |
Not started · In progress · Completed |
EmployeeViolationItemStateParams |
Upcoming · Current · Ending · Due · Other |
3. The three "exemption" concepts (Task.md's "exemptions")
| Exemption |
Exempts from |
Entity |
| Violation policy exemption |
A specific disciplinary policy |
ViolationPolicyExemption |
| Payroll exemption |
A payroll run (e.g. during suspension) |
PayrollExemption |
| Milestone-email exemption |
Anniversary/milestone emails |
MilestoneEmailExemption |
4. Two automation-critical relationships
- Suspensions run on the Requests engine.
EmployeeSuspension.EmployeeRequestId links to a request; the live suspension list shows "Pending HR Admin's Review (0/3)" — the role-chain approval. See RFD-002.
- Disciplinary actions reach Payroll. Deduction triggers carry an
Amount; suspensions are recovered (RecoveredInPayrollId, HasBeenRecovered); PayrollExemption pulls people from a run.
5. Automated triggers (the interesting bit)
A ViolationPolicy with HasThreshold + ViolationCount = N means: after N violations of that type, the System raises an EmployeeViolationTrigger proposing the policy's action (with an Amount for deductions). The trigger enters New and awaits review. Live evidence: the Triggers screen shows auto-raised Probation and Deduction actions at status New. See RFD-001.