Field Staff Tracking
GPS Tracking
Check-In & Check-Out

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 PurposeRemapped ToReason
New Business CPFollow Up CPAligns with CRM follow-up tracking
Conversion CPBooking CPMaps 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 TypeMethodDescription
Follow-up CallsGetFollowupCallsCountForAttendanceRestrictionByUserIdPending call follow-ups
Follow-up ApprovalsGetFollowupCallsApprovalCountForAttendanceRestrictionByUserIdPending follow-up approvals
Attendance ApprovalsGetMobileAttendanceByDateForApprovalCountByUserIdPending attendance approvals
Overdue TasksGetOverDueTaskCountTasks past their due date
Pending WorkflowsGetPendingWorkflowCountOpen workflow items
SV Pickup PendingGetSVPickupPendingCountSite visit pickups pending
Uncompleted SVGetUncompletedSVCountIncomplete 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/SaveReportOnDuty

Request 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

FilePurpose
SiteVisitGPSAPIController.csCheck-in/out API endpoints
SiteVisitGPSAPIModel.csRequest/response data model
SitevisitGPSBO.csDatabase operations for GPS records
clsMobileAppServiceCore GPS record creation/update
PunchTimingsBOMobile punch timing insert