Consolidate the Attendance API type - #425
Conversation
|
Thanks Abhishek - the consolidation direction looks good, but I need the current Backend contract confirmed before merge.
Please also confirm whether |
|
Nice cleanup — consolidating to a single Attendance shape and killing the anys is the right direction. I confirmed nothing else in the app uses the removed fields (clockIn/Out, hoursWorked, status, scheduledStart/End), and I also checked them against main's backend: the ShiftAttendance model is exactly guardId, shiftId, checkInTime, checkOutTime, locationVerified — none of the removed fields exist there or in any response, so this is correcting the type to match the real contract, not dropping anything. 👍 Two things I checked so we're covered:
Could you also update the PR description with the ticket link, the field-mapping evidence that these match all current Attendance responses, Guard App screenshots (check-in, check-out, My Shifts, Timesheets), and the tsc/lint output? With those I'm happy to approve. |
|
Thanks for the follow-up commit — the navigation fix is a good catch. Passing the full shift object (and Alerting when it's missing) is the right call, since ShiftDetailsScreen reads route.params.shift, not a shiftId. I checked getMyShifts on the backend: with no status param the guard query is { $or: [{ applicants }, { acceptedBy }] } across all statuses, so myShifts() already includes completed/past shifts — and since an attendance record implies the guard was the assigned guard, shiftsById[item.shiftId] will resolve for any real timesheet row. So the "unavailable" Alert is just a safe fallback, not a common path — looks good. (And good that you didn't pass status=past, which would've filtered out current shifts.) Just confirm Alert is imported from react-native (lint would flag it otherwise) and I'm happy. |







Consolidate the Attendance API type