Check-In & Check-Out Flow
The check-in/check-out system is the core of field staff tracking. When a staff member starts their field duty, the mobile app captures their GPS coordinates and creates a site visit record. On ending duty, the closing coordinates are recorded.
Check-In Flow
Purpose Remapping
When a check-in is created, the system automatically remaps certain purpose values:
| Original Purpose | Remapped To | Reason |
|---|---|---|
| New Business CP | Follow Up CP | Aligns with CRM follow-up tracking |
| Conversion CP | Booking CP | Maps to booking workflow stage |
All other purpose values pass through unchanged.
Check-In: Pending Task Validation
At check-in time, the system counts 6 categories of pending work:
| Task Type | Method | Description |
|---|---|---|
| Follow-up Calls | GetFollowupCallsCountForAttendanceRestrictionByUserId | Pending call follow-ups |
| Follow-up Approvals | GetFollowupCallsApprovalCountForAttendanceRestrictionByUserId | Pending follow-up approvals |
| Attendance Approvals | GetMobileAttendanceByDateForApprovalCountByUserId | Pending attendance approvals |
| Overdue Tasks | GetOverDueTaskCount | Tasks past their due date |
| Pending Workflows | GetPendingWorkflowCount | Open workflow items |
| SV Pickup Pending | GetSVPickupPendingCount | Site visit pickups pending |
| Uncompleted SV | GetUncompletedSVCount | Incomplete site visits |
If the total count across all categories is greater than 0, the attendance is marked as conditional pending with a 20-minute grace period. The pending items are recorded as a reason string on the punch timing record.
Check-Out Flow
The check-out updates the existing t_SiteVisit_GPS record with ending coordinates, closing remarks, and the EndingDateAndTime is set by the database.
API Endpoint
Controller: SiteVisitGPSAPIController
POST /webapi/SiteVisitGPS/SaveReportOnDutyRequest Body:
{
"SiteVisitGPSID": 0,
"UserId": 1234,
"Purpose": "Follow Up CP",
"Remarks": "Client visit at site",
"StartingLatitude": 12.9716,
"StartingLongitude": 80.2437,
"CallLogId": 567
}Response:
{
"Id": 8901,
"result": true,
"message": "Successfully Created"
}When SiteVisitGPSID is 0, it creates a new check-in. When non-zero, it performs a check-out by updating the existing record with EndingLatitude, EndingLongitude, and ClosingRemarks.
Source Files
| File | Purpose |
|---|---|
SiteVisitGPSAPIController.cs | Check-in/out API endpoints |
SiteVisitGPSAPIModel.cs | Request/response data model |
SitevisitGPSBO.cs | Database operations for GPS records |
clsMobileAppService | Core GPS record creation/update |
PunchTimingsBO | Mobile punch timing insert |