updates on the admincontroler page

This commit is contained in:
2026-09-10 15:55:40 +05:30
parent 86ae2ab41e
commit 17bd316e4d
4 changed files with 196 additions and 1 deletions

View File

@@ -80,6 +80,18 @@ type PickupBooking struct {
// GET /customer/track/:trackingno at all: a booking is addressed by id, a
// shipment by tracking number, and nothing joined the two.
Trackingno string `json:"trackingno,omitempty" gorm:"-"`
// Destinationcount and Totalpackagecount are not columns either. A
// customer-app pickup is ONE booking carrying N destinations, and the admin
// list has to be able to say "3 destinations · 4 packages" without shipping
// the whole destination array on every row — the console drains up to 12
// pages of 100 bookings and does not use the array in the list. Filled in by
// the admin bookings list from one grouped query per page (see
// applyDestinationCounts). Deliberately NOT omitempty: a console-created
// booking has no bookingdestinations rows at all and must report 0, which
// the console reads as "no destinations recorded" — omitting the field would
// make it indistinguishable from a single-destination booking.
Destinationcount int `json:"destinationcount" gorm:"-"`
Totalpackagecount int `json:"totalpackagecount" gorm:"-"`
Createdat time.Time `json:"createdat" gorm:"column:createdat;default:CURRENT_TIMESTAMP"`
Updatedat time.Time `json:"updatedat" gorm:"column:updatedat;default:CURRENT_TIMESTAMP"`