Rules engine
Each request is evaluated on submit and re-evaluated at approval. Any violation disables Approve and the shift is never transferred.
REST_PERIOD
Gap to another shift for the same employee is under the minimum.
SKILL_MISMATCH
Requester does not hold the skill the shift requires.
DOUBLE_BOOKING
Requester already has an overlapping shift.
OVER_HOURS
Requester weekly hours would exceed their cap.
How the rules are enforced
Hours, pay and the four rules are deterministic arithmetic on the roster embedded in this file, re-evaluated on every submit and again at approval, so an ineligible swap can never be transferred. The engine covers REST_PERIOD, SKILL_MISMATCH, DOUBLE_BOOKING and OVER_HOURS. Tax, overtime premium, award and union-rate logic and payroll posting sit outside this calculation: pay here is worked hours times hourly rate, recomputed after every accepted swap.