Fix 9 backend bugs: pricing, zones, geocoding, device tokens, assignment retry
- pricingid null: lookupDoormilePrice now returns matched rule ID; wired to BookingServiceOption.Pricingid - Zone rename: Interstate→Regional, OtherState→National throughout (code + DB migrated) - Zone from pincodes: CheckPrice now accepts pickup_pincode+delivery_pincode and auto-resolves zone - Delivery geocoding: pincodeToLatLon() maps 3-digit prefix to city coords when lat/lon are 0 - Device tokens: device_token field added to PinVerify DTOs; saved on both customer and miler login - Assignment retry: RejectMilerAssignment now re-triggers AssignCustomerMiler/AssignCRMMiler immediately - Provider empty B2C: defaults to Doormile when no pricing provider row matches - City gate 422→400: StatusUnprocessableEntity corrected to StatusBadRequest - Miler GPS 0,0: WS tracking falls back to MilerProfile DB coords when Redis key is expired Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -105,12 +105,12 @@ func tryCustomerAssign(bookingID int) (bool, error) {
|
||||
|
||||
provider, providerFound := selectBestProvider(zone, category, serviceType, weight)
|
||||
if !providerFound {
|
||||
utils.Warn("B2CAssignment: no provider pricing match, proceeding without one",
|
||||
utils.Warn("B2CAssignment: no provider pricing match, defaulting to Doormile",
|
||||
"booking_id", bookingID,
|
||||
"zone", zone,
|
||||
"category", category,
|
||||
)
|
||||
provider = providerResult{}
|
||||
provider = providerResult{company: "Doormile"}
|
||||
}
|
||||
|
||||
// Step 6 — ETA based on miler-to-pickup distance.
|
||||
@@ -359,9 +359,9 @@ func b2cResolveZone(pickupPincode, deliveryPincode string) string {
|
||||
return "Local"
|
||||
}
|
||||
if b2cPincodeToState(pickupPincode) == b2cPincodeToState(deliveryPincode) {
|
||||
return "Interstate"
|
||||
return "Regional"
|
||||
}
|
||||
return "OtherState"
|
||||
return "National"
|
||||
}
|
||||
|
||||
func b2cNormalizePricingCategory(category string) string {
|
||||
|
||||
Reference in New Issue
Block a user