backend requirements onthe xustomer app

This commit is contained in:
2026-09-07 10:55:11 +05:30
parent 35675d8a9b
commit 1b2690b21a
56 changed files with 13342 additions and 1071 deletions

View File

@@ -39,3 +39,21 @@ func CityGateMiddleware(c *fiber.Ctx) error {
"code": "CITY_NOT_SUPPORTED",
})
}
// PincodeInOperatingCity reports whether a pincode falls in a city Doormile
// runs in, and names it.
//
// Exported because the customer app's booking request does not carry a
// pickuppincode at all — its pickup point is a title/sub/lat/lng from the place
// search, so CityGateMiddleware's body sniff finds nothing and waves it
// through. A middleware that silently no-ops on the one caller it matters most
// for is worse than no middleware, so the customer handler resolves the pickup
// point to a pincode itself and asks this directly.
func PincodeInOperatingCity(pincode string) (string, bool) {
pincode = strings.TrimSpace(pincode)
if len(pincode) < 3 {
return "", false
}
city, ok := operatingCityPrefixes[pincode[:3]]
return city, ok
}