Pending Task Restriction
The pending task restriction is a business enforcement mechanism that blocks immediate attendance posting if the staff member has unresolved work items. This ensures field staff address their pending obligations before their attendance is confirmed.
Task Check Flow
Pending Task Categories
| Category | Method | Example |
|---|---|---|
| Follow-up Calls | GetFollowupCallsCountForAttendanceRestrictionByUserId | 3 pending call follow-ups |
| Follow-up Approvals | GetFollowupCallsApprovalCountForAttendanceRestrictionByUserId | 2 pending call follow-up approvals |
| Attendance Approvals | GetMobileAttendanceByDateForApprovalCountByUserId | 1 pending attendance approvals |
| Overdue Tasks | GetOverDueTaskCount | 5 pending tasks |
| Pending Workflows | GetPendingWorkflowCount | 2 pending workflow items |
| SV Pickup Pending | GetSVPickupPendingCount | 1 pending pickup |
| Uncompleted SV | GetUncompletedSVCount | 3 pending status of SV |
Reason String Construction
When pending tasks exist, the system constructs a human-readable reason string by concatenating all non-zero categories:
"3 pending call follow-ups, 2 pending call follow-up approvals, 5 pending tasks"This string is stored on the punch timing record via PunchTimingsBO.UpdateReason() and used by the background processor to determine when to finalize attendance.
User-Facing Message
The mobile app displays this message when tasks are pending:
Your on duty is noted. But attendance will be considered, only after closing pending tasks within 20 minutes.
This gives the staff member a 20-minute window to clear their pending items before the attendance decision is made by the background processor.
API Endpoints for Task Counts
These endpoints are also exposed via the AttendanceAPIController for the mobile app to query independently:
| Endpoint | Method | Returns |
|---|---|---|
GetMobileAttendanceApprovalCount/{UserId} | GET | Pending attendance approval count |
GetFollowupCallsCountForAttendanceRestriction/{UserId} | GET | Pending follow-up calls count |
GetFollowupCountForAttendanceRestriction/{UserId} | GET | Pending follow-up approvals count |
GetAttendanceRestrictionForUser/{UserId} | GET | Full list of restriction reasons |