Back to projects

Field Service Callout Review

I built a web app that matches emergency callouts to technician shifts, lets site managers approve allowances, and exports the approved records as a CSV for payroll.

Demo company
Northline Facilities
Review period
October 2025
Sample files
172 dispatches · 175 roster rows

The problem

One callout, two records

Imagine a warehouse pump fails at 19:17. Dispatch sends a technician and logs the job. The schedule lives in another system. Before payroll adds an allowance, someone has to check that the technician was rostered at that site when the job came in, then get the manager’s approval.

I used Northline Facilities, a fictional company, to show how that review can work from the two source files through to the payroll handoff.

The workflow

From source files to payroll

01 · Operations

Import the dispatches and roster

Operations uploads both CSVs for the company. The importer checks the rows before saving the batch and reports which records were added or already saved. Uploading the same records again keeps a single copy of each.

The CSV imports page shows a completed run with 172 dispatch rows already saved and 175 roster rows on file.
The repeat dispatch upload processed 172 rows. All 172 were already on file.

02 · Roster matching

See which callouts need a closer look

PostgreSQL checks the company, site, technician and callout time against the roster. Shift review distinguishes a single match from a missing shift, overlapping shifts or a missing technician code.

Shift review shows matched, overlap and no shift statuses, with the roster times next to each callout.
The 03:03 Depot callout matches a shift that started the previous night. The Central overlap is flagged for review.

03 · Site manager

Approve an eligible callout

The manager works from the records for their assigned site. When they approve an eligible callout, the database checks the match again and saves the shift, amount, reviewer and approval time.

The Central manager's view shows existing £25 approvals and Approve buttons for eligible matched callouts.
The Central manager can approve matched callouts for Central. Rows with a scheduling exception still need investigation.

04 · Payroll handoff

Download the approved allowances

Operations opens the approved ledger and downloads a CSV for payroll. Each row carries the saved approval details, so payroll can trace the amount back to the callout and the person who signed it off.

The approved ledger lists two £25 allowances, the approver and approval times, and a Download CSV button.
The captured demo run shows two approved allowances totalling £50.

Behind the screens

Where the rules live

  • Next.js and TypeScript handle the pages, CSV upload and approval actions.
  • Supabase Auth signs users in. PostgreSQL access policies scope records to the user’s company or assigned site.
  • PostgreSQL validates imports, matches shifts and stores the approved record. Database functions check permissions for imports, approvals and exports.

The SQL checks run with temporary records and roll them back when they finish. The import suite covers cases such as re-uploading the same records or submitting a row for a site outside the selected company.

Supabase SQL Editor showing that 12 CSV import checks passed.
A captured run of the import test suite in Supabase. Twelve CSV import checks passed.

Try Callout Review

Try both roles in a sample Northline Facilities workspace without signing in.

  1. Start as Operations. Select Load sample roster, then Load sample dispatches.
  2. Open Shift review. Compare Matched, No shift and Overlap.
  3. Switch to Central site manager. Under Matched, select Approve for DEMO-CEN-101 and confirm with Approve callout.
  4. Switch to Operations. In Approved, select Download CSV.