Field Staff Tracking
Overview

Field Staff Tracking

The Field Staff Tracking module provides real-time GPS-based monitoring of field employees — from check-in to check-out. It captures location waypoints, geo-tagged photos, and integrates tightly with the attendance system to ensure accountability and approval workflows.

System Architecture

Core Components

ComponentTechnologyPurpose
Mobile AppFlutterGPS capture, check-in/out, photo upload
SiteVisitGPSAPIControllerASP.NET WebAPICheck-in, check-out, location, image endpoints
AttendanceAPIControllerASP.NET WebAPIApproval list, approval save, restriction checks
MobileAttendanceControllerASP.NET MVCWeb-based approval UI with map view
AttendancePostServiceWindows Service + Quartz.NETBackground punch processing every 30 seconds
Core API (Go)Go HTTPModern GPS list endpoint with filtering
GeoLocationBOC# + Google Maps APIReverse geocoding for lat/long to address
Admin PortalNext.jsGPS record listing, approval, map visualization

Data Flow Summary

StageActionStorage
Check-InStaff opens duty with GPS coordinatest_SiteVisit_GPS (start fields)
Location StreamContinuous GPS waypoints sent from appt_SiteVisit_GPS_Detail
Photo CaptureGeo-tagged images uploaded as base64t_SiteVisit_GPS_Images
Check-OutStaff closes duty with end coordinatest_SiteVisit_GPS (end fields)
Punch ProcessingBackground job posts to attendanceEmpDailyAttendance
ApprovalManager reviews and approves/rejectst_SiteVisit_GPS (approval fields)

Key Business Rules

RuleDetail
Pending Task CheckOn check-in, 6 pending task types are counted — if any exist, attendance is conditional
20-Minute GraceStaff gets 20 minutes to clear pending tasks before attendance is finalized
Purpose Remapping"New Business CP" remapped to "Follow Up CP"; "Conversion CP" to "Booking CP"
Role-Based ViewRoleLevel 6 and above see team GPS records; below see only own records
Location Service StatusApp reports GPS on/off, WiFi, battery percentage, signal strength
Continuous TrackingLocation captured only while a mobile attendance session is open (OutDateAndTime is null)

Configuration

SettingValueDescription
GoogleAPIKeyApp configUsed for reverse geocoding via Google Maps API
Punch Cron0/30 * 7-23 * * ?Every 30 seconds, 7 AM to 11 PM
Nearby Search Radius50 metersGoogle Places API radius for location name
Location Type Filterpremise, point_of_interestPreferred geocoding result types