fix(api): close v2 mobile contract gaps

This commit is contained in:
zouantchaw
2026-03-17 22:37:45 +01:00
parent afcd896b47
commit 008dd7efb1
14 changed files with 1315 additions and 54 deletions

View File

@@ -28,6 +28,7 @@ import {
setupStaffProfile,
staffClockIn,
staffClockOut,
submitCompletedShiftForApproval,
submitLocationStreamBatch,
submitTaxForm,
unregisterClientPushToken,
@@ -70,6 +71,7 @@ import {
pushTokenRegisterSchema,
shiftApplySchema,
shiftDecisionSchema,
shiftSubmitApprovalSchema,
staffClockInSchema,
staffClockOutSchema,
staffLocationBatchSchema,
@@ -104,6 +106,7 @@ const defaultHandlers = {
setupStaffProfile,
staffClockIn,
staffClockOut,
submitCompletedShiftForApproval,
submitLocationStreamBatch,
submitTaxForm,
unregisterClientPushToken,
@@ -402,6 +405,14 @@ export function createMobileCommandsRouter(handlers = defaultHandlers) {
paramShape: (req) => ({ ...req.body, shiftId: req.params.shiftId }),
}));
router.post(...mobileCommand('/staff/shifts/:shiftId/submit-for-approval', {
schema: shiftSubmitApprovalSchema,
policyAction: 'staff.shifts.submit',
resource: 'shift',
handler: handlers.submitCompletedShiftForApproval,
paramShape: (req) => ({ ...req.body, shiftId: req.params.shiftId }),
}));
router.put(...mobileCommand('/staff/profile/personal-info', {
schema: personalInfoUpdateSchema,
policyAction: 'staff.profile.write',