Skip to main content

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

#RuleTriggerBusiness outcomeValidationSource
1A shift belongs to a valid tenantShift creationTenant-scoped shiftTenant value must be positivemicroservices/src/attendance-service/Domain/TimeOffice/Shift.cs
2Shift name is mandatoryCreate/update shiftNamed working windowNonblank trimmed valuemicroservices/src/attendance-service/Domain/TimeOffice/Shift.cs
3Active shift names are unique per tenant in extracted commandsCreate/update shiftDuplicate active name rejectedRepository existence checkmicroservices/src/attendance-service/Application/Services/ShiftPolicyCommands.cs
4Start and end times cannot be identicalCreate/update shiftZero-duration window rejectedDomain comparisonmicroservices/src/attendance-service/Domain/TimeOffice/Shift.cs
5Grace is boundedCreate/update shiftInvalid grace rejectedZero through one day in minutesmicroservices/src/attendance-service/Domain/TimeOffice/Shift.cs
6Standard hours are boundedCreate/update shiftInvalid standard day rejectedGreater than zero and no more than one daymicroservices/src/attendance-service/Domain/TimeOffice/Shift.cs
7Overtime threshold is boundedCreate/update shiftInvalid threshold rejectedNonnegative and no more than one daymicroservices/src/attendance-service/Domain/TimeOffice/Shift.cs
8A crossing-midnight window is a night shift by defaultCreate/update without explicit overrideNight classification setEnd at/before startmicroservices/src/attendance-service/Domain/TimeOffice/Shift.cs
9Direct deletion preserves referenced historyDirect deleteShift becomes inactiveActive assignments must first be removed/reassignedmicroservices/src/attendance-service/Application/Services/ShiftPolicyCommands.cs
10Compatibility deletion detaches active assignmentsCompatibility deleteShift and active assignments become inactiveExisting compatible shift requiredmicroservices/src/attendance-service/Application/Compatibility/ShiftPolicyCompatService.cs

Assignment and calendar rules

#RuleTriggerBusiness outcomeValidationSource
11Employee and shift identities must be validCreate assignmentInvalid assignment rejectedPositive employee/labor and shift identifiersmicroservices/src/attendance-service/Domain/TimeOffice/EmployeeShiftAssignment.cs
12Only an active shift can be assignedCreate assignmentInactive shift rejectedShift lookup and active statemicroservices/src/attendance-service/Application/Services/ShiftPolicyCommands.cs
13Assignment end cannot precede startCreate assignmentInvalid date range rejectedDate-only comparisonmicroservices/src/attendance-service/Domain/TimeOffice/EmployeeShiftAssignment.cs
14Active assignments for one employee cannot overlapCreate assignmentConflict returnedInclusive range intersectionmicroservices/src/attendance-service/Application/Services/ShiftPolicyCommands.cs
15Missing assignment end means open-endedCreate assignmentAssignment continues indefinitelyNullable end datemicroservices/src/attendance-service/Domain/TimeOffice/EmployeeShiftAssignment.cs
16Weekly-off day must be a valid weekdayConfigure weekly offsInvalid value rejectedWeekday parser/enum validationmicroservices/src/attendance-service/Domain/TimeOffice/WeeklyOffRule.cs
17Direct weekly-off payload cannot repeat a weekdayDirect updateDuplicate-day payload rejectedGroup/count validationmicroservices/src/attendance-service/Application/Services/ShiftPolicyCommands.cs
18No extracted weekly-off rows defaults to SundayAttendance calendar resolutionSunday treated as weekly offEmpty configuration checkmicroservices/src/attendance-service/Application/Services/AttendancePolicyResolver.cs
19Existing but all-inactive weekly-off rows means no weekly offsAttendance calendar resolutionNo weekly-off day appliedActive-rule filtermicroservices/src/attendance-service/Application/Services/AttendancePolicyResolver.cs

Attendance, leave and payroll rules

#RuleTriggerBusiness outcomeValidationSource
20Effective assignment is resolved for the business dateAttendance calculationAssigned shift supplies effective valuesInclusive effective range; latest start wins defensivelymicroservices/src/attendance-service/Application/Services/AttendancePolicyResolver.cs
21Overtime is positive hours beyond effective thresholdPunch/approval calculationOvertime hours derivedMaximum with zeromicroservices/src/attendance-service/Domain/Attendance/AttendanceCalculator.cs
22Approved attendance prevents overlapping leaveLeave create/approveLeave rejected for attendance conflictAttendance Service conflict checkmicroservices/src/leave-service/Application/LeaveWorkflows.cs
23Payroll payable days include present, paid leave, weekly off and holidayPayroll calculationBase-pay input derivedSum of snapshot categories, capped by pay rulesmicroservices/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.cs
  • microservices/src/attendance-service/Domain/TimeOffice/EmployeeShiftAssignment.cs
  • microservices/src/attendance-service/Application/Services/ShiftPolicyCommands.cs
  • microservices/src/attendance-service/Application/Services/AttendancePolicyResolver.cs
  • microservices/src/payroll-service/Application/PayrollCalculationService.cs

See Also

Keywords

  • Rule catalog
  • Shift validation
  • Assignment validation

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-20
  • Review cycle: Quarterly