EV SLA manages field technician tasks where "I started the job" must mean "I am physically at the site". This post covers the geofence check, the realtime state machine, and what happens when connectivity drops mid-shift.
The geofence check
Each task carries the site coordinates and an allowed radius. On "start job", the client captures a GPS fix and the check runs with the haversine distance. The radius adapts to reported GPS accuracy so technicians in dense urban areas are not falsely rejected.
Haversine distance with accuracy-aware radius
function canStartJob ( task : Task , fix : GeoFix ): boolean { const distanceM = haversine ( task . site , fix . coords ); // Widen the fence by the GPS accuracy, capped to avoid abuse const tolerance = Math . min ( fix . accuracyM , MAX_ACCURACY_BONUS_M ); return distanceM <= task .…