Workforce Scheduling Business Rules
Summary
The verified catalog contains 23 business rules. Rules are implementation facts, not legal or policy recommendations.
Audience
HR/payroll administrators, managers, product, QA, support and solution architects.
Reference Content
Shift definition rules
| # | Rule | Trigger | Business outcome | Validation | Source |
|---|---|---|---|---|---|
| 1 | A shift belongs to a valid tenant | Shift creation | Tenant-scoped shift | Tenant value must be positive | microservices/src/attendance-service/Domain/TimeOffice/Shift.cs |
| 2 | Shift name is mandatory | Create/update shift | Named working window | Nonblank trimmed value | microservices/src/attendance-service/Domain/TimeOffice/Shift.cs |
| 3 | Active shift names are unique per tenant in extracted commands | Create/update shift | Duplicate active name rejected | Repository existence check | microservices/src/attendance-service/Application/Services/ShiftPolicyCommands.cs |
| 4 | Start and end times cannot be identical | Create/update shift | Zero-duration window rejected | Domain comparison | microservices/src/attendance-service/Domain/TimeOffice/Shift.cs |
| 5 | Grace is bounded | Create/update shift | Invalid grace rejected | Zero through one day in minutes | microservices/src/attendance-service/Domain/TimeOffice/Shift.cs |
| 6 | Standard hours are bounded | Create/update shift | Invalid standard day rejected | Greater than zero and no more than one day | microservices/src/attendance-service/Domain/TimeOffice/Shift.cs |
| 7 | Overtime threshold is bounded | Create/update shift | Invalid threshold rejected | Nonnegative and no more than one day | microservices/src/attendance-service/Domain/TimeOffice/Shift.cs |
| 8 | A crossing-midnight window is a night shift by default | Create/update without explicit override | Night classification set | End at/before start | microservices/src/attendance-service/Domain/TimeOffice/Shift.cs |
| 9 | Direct deletion preserves referenced history | Direct delete | Shift becomes inactive | Active assignments must first be removed/reassigned | microservices/src/attendance-service/Application/Services/ShiftPolicyCommands.cs |
| 10 | Compatibility deletion detaches active assignments | Compatibility delete | Shift and active assignments become inactive | Existing compatible shift required | microservices/src/attendance-service/Application/Compatibility/ShiftPolicyCompatService.cs |
Assignment and calendar rules
| # | Rule | Trigger | Business outcome | Validation | Source |
|---|---|---|---|---|---|
| 11 | Employee and shift identities must be valid | Create assignment | Invalid assignment rejected | Positive employee/labor and shift identifiers | microservices/src/attendance-service/Domain/TimeOffice/EmployeeShiftAssignment.cs |
| 12 | Only an active shift can be assigned | Create assignment | Inactive shift rejected | Shift lookup and active state | microservices/src/attendance-service/Application/Services/ShiftPolicyCommands.cs |
| 13 | Assignment end cannot precede start | Create assignment | Invalid date range rejected | Date-only comparison | microservices/src/attendance-service/Domain/TimeOffice/EmployeeShiftAssignment.cs |
| 14 | Active assignments for one employee cannot overlap | Create assignment | Conflict returned | Inclusive range intersection | microservices/src/attendance-service/Application/Services/ShiftPolicyCommands.cs |
| 15 | Missing assignment end means open-ended | Create assignment | Assignment continues indefinitely | Nullable end date | microservices/src/attendance-service/Domain/TimeOffice/EmployeeShiftAssignment.cs |
| 16 | Weekly-off day must be a valid weekday | Configure weekly offs | Invalid value rejected | Weekday parser/enum validation | microservices/src/attendance-service/Domain/TimeOffice/WeeklyOffRule.cs |
| 17 | Direct weekly-off payload cannot repeat a weekday | Direct update | Duplicate-day payload rejected | Group/count validation | microservices/src/attendance-service/Application/Services/ShiftPolicyCommands.cs |
| 18 | No extracted weekly-off rows defaults to Sunday | Attendance calendar resolution | Sunday treated as weekly off | Empty configuration check | microservices/src/attendance-service/Application/Services/AttendancePolicyResolver.cs |
| 19 | Existing but all-inactive weekly-off rows means no weekly offs | Attendance calendar resolution | No weekly-off day applied | Active-rule filter | microservices/src/attendance-service/Application/Services/AttendancePolicyResolver.cs |
Attendance, leave and payroll rules
| # | Rule | Trigger | Business outcome | Validation | Source |
|---|---|---|---|---|---|
| 20 | Effective assignment is resolved for the business date | Attendance calculation | Assigned shift supplies effective values | Inclusive effective range; latest start wins defensively | microservices/src/attendance-service/Application/Services/AttendancePolicyResolver.cs |
| 21 | Overtime is positive hours beyond effective threshold | Punch/approval calculation | Overtime hours derived | Maximum with zero | microservices/src/attendance-service/Domain/Attendance/AttendanceCalculator.cs |
| 22 | Approved attendance prevents overlapping leave | Leave create/approve | Leave rejected for attendance conflict | Attendance Service conflict check | microservices/src/leave-service/Application/LeaveWorkflows.cs |
| 23 | Payroll payable days include present, paid leave, weekly off and holiday | Payroll calculation | Base-pay input derived | Sum of snapshot categories, capped by pay rules | microservices/src/payroll-service/Application/PayrollCalculationService.cs |
Limitations and requires confirmation
The catalog contains no rotation, coverage, staffing, schedule approval, swap, publication, notification or jurisdiction-specific compliance rule. Policy interpretation and production routing require confirmation.
Business Evidence Checklist
- Business purpose: Provide a traceable catalog of implemented scheduling-adjacent rules.
- Actors: HR/payroll administrators, managers, QA, support and architects.
- Business process: Trigger validation, accept/reject the action and propagate the business outcome.
- Status transitions: Active/inactive configuration and downstream attendance/payroll states are covered where applicable.
- Responsibilities: Product and domain owners review rules; QA verifies each source-backed outcome.
- Business rules: Twenty-three verified rules are cataloged above with trigger, outcome, validation and source.
- Integrations: Assignment, Attendance, Leave and Payroll rules cross domain boundaries.
- Limitations: No unimplemented rotation, coverage, publication or legal rule is inferred.
- Requires confirmation: Tenant policy, routing and jurisdictional interpretation require confirmation.
Source References
microservices/src/attendance-service/Domain/TimeOffice/Shift.csmicroservices/src/attendance-service/Domain/TimeOffice/EmployeeShiftAssignment.csmicroservices/src/attendance-service/Application/Services/ShiftPolicyCommands.csmicroservices/src/attendance-service/Application/Services/AttendancePolicyResolver.csmicroservices/src/payroll-service/Application/PayrollCalculationService.cs
Related Articles
See Also
Keywords
- Rule catalog
- Shift validation
- Assignment validation
Revision Information
- Status: Draft
- Last reviewed: 2026-07-20
- Review cycle: Quarterly