Field Staff Tracking
Approval Workflow
OD Attendance Approval

OD Attendance Approval

On-Duty (OD) attendance requires manager approval. When field staff check in via GPS, their attendance record enters a pending state until a manager reviews the GPS data, route, and photos before approving or rejecting.

Approval Flow

Approval SQL

The approval operation updates four fields in a single atomic UPDATE:

UPDATE t_SiteVisit_GPS
SET IsApproved = @IsApproved,
    ApprovalBy = @ApprovalBy,
    ApprovalOn = GETDATE(),
    Reason = @Reason
WHERE SiteVisitGPSID = @SiteVisitGPSID

Approval List API

The AttendanceAPIController provides endpoints for the approval workflow:

EndpointMethodPurpose
GetAttendanceApprovalListGETFetch pending approvals with filters
GetMobileAttendanceByIdGETGet details of a specific attendance record
SaveAttendanceApprovalPOSTSubmit approval/rejection decision
GetAttendanceApprovalStatusGETGet list of valid approval status types

Approval List Parameters

GET /webapi/Attendance/GetAttendanceApprovalList
    ?UserId=1234
    &PeriodFrom=2025-01-01
    &PeriodTo=2025-01-31
    &ReportType=All

The ReportType parameter controls the scope — "All" shows all records; other values filter by specific report categories.

Approval Data Model

The MobileAttendanceApprovalModel includes:

FieldDescription
GMUserNameStaff name (sorted ascending by default)
PeriodFrom / PeriodToDate range filter
ApprovedAttendanceSelected attendance type
ApprovalRemarksManager's notes
MobileAttendanceIdRecord identifier

Web-Based Approval (MVC)

The MobileAttendanceController provides a web interface for approval:

The web approval page defaults to showing the previous day's records. Managers can change the date to review older entries.

Source Files

FilePurpose
SitevisitGPSBO.csApprovalODAttendance SQL operation
AttendanceAPIController.csAPI approval endpoints
MobileAttendanceController.csWeb approval UI
MobileAttendanceBO.csApproval business logic