From 549a35a63af6338f1875c00528f6515de2febb0a Mon Sep 17 00:00:00 2001 From: Suriyakumarvijayanayagam Date: Wed, 26 Aug 2026 15:25:42 +0530 Subject: [PATCH] fix: admin console reads reachedat on booking rows (JSON tag arrivedat->reachedat) The Admin Console derives Arrived from Pickup_Scheduled + reachedat != null, but GetAdminBookings serializes the PickupBooking struct raw and the arrival field emitted json arrivedat, not reachedat, so the console never saw the arrival. Align the wire name to reachedat (miler app and /reached already use it); DB column stays arrivedat. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01WRaFH5hMRqmUQvVPQsyjZD --- models/booking.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/models/booking.go b/models/booking.go index f33bbc5..1dbedd2 100644 --- a/models/booking.go +++ b/models/booking.go @@ -47,7 +47,11 @@ type PickupBooking struct { // pickup point. Nullable — a booking that was never reached has no arrival. // arrivallatitude/longitude are the rider's actual GPS at the moment they // tapped "arrived", kept as a durable record separate from live telemetry. - Arrivedat *time.Time `json:"arrivedat" gorm:"column:arrivedat"` + // JSON name is reachedat (not arrivedat): the miler app, the /reached + // response and the Admin Console all key off reachedat — the console derives + // its "Arrived" display from Pickup_Scheduled + reachedat != null. The DB + // column stays arrivedat. + Arrivedat *time.Time `json:"reachedat" gorm:"column:arrivedat"` Arrivallatitude *float64 `json:"arrivallatitude" gorm:"column:arrivallatitude"` Arrivallongitude *float64 `json:"arrivallongitude" gorm:"column:arrivallongitude"` Consignmentid *int `json:"consignmentid" gorm:"column:consignmentid"`