fix(api): close M5 frontend contract gaps

This commit is contained in:
zouantchaw
2026-03-19 10:28:13 +01:00
parent 3399dfdac7
commit 4b2ef9d843
9 changed files with 293 additions and 21 deletions

View File

@@ -21,6 +21,7 @@ import {
getReportSummary,
getSavings,
getStaffDashboard,
getStaffReliabilityStats,
getStaffProfileCompletion,
getStaffSession,
getStaffShiftDetail,
@@ -89,6 +90,7 @@ const defaultQueryService = {
getSpendBreakdown,
getSpendReport,
getStaffDashboard,
getStaffReliabilityStats,
getStaffProfileCompletion,
getStaffSession,
getStaffShiftDetail,
@@ -443,6 +445,15 @@ export function createMobileQueryRouter(queryService = defaultQueryService) {
}
});
router.get('/staff/profile/stats', requireAuth, requirePolicy('staff.profile.read', 'staff'), async (req, res, next) => {
try {
const data = await queryService.getStaffReliabilityStats(req.actor.uid);
return res.status(200).json({ ...data, requestId: req.requestId });
} catch (error) {
return next(error);
}
});
router.get('/staff/dashboard', requireAuth, requirePolicy('staff.dashboard.read', 'dashboard'), async (req, res, next) => {
try {
const data = await queryService.getStaffDashboard(req.actor.uid);