updates on the otp updates on the customer app

This commit is contained in:
2026-09-15 11:50:12 +05:30
parent e8f4c0a593
commit 89321c9e06
17 changed files with 1072 additions and 69 deletions

View File

@@ -8,6 +8,7 @@ import (
"net/http"
"os"
"strconv"
"strings"
"time"
"doormile/constants"
@@ -263,9 +264,15 @@ func pickBestFromCandidates(candidates []*milerCandidate) *milerCandidate {
// ─── AI layer HTTP call ──────────────────────────────────────────────────────
func callDecisionEngine(booking *models.PickupBooking, candidates []aiCandidate) (aiDecisionResponse, error) {
baseURL := os.Getenv("AI_LAYER_BASE_URL")
// No hardcoded fallback. This used to default to the production AI layer,
// so a developer running the backend locally sent real booking and rider
// data to it without ever configuring anything. Unset now means "no AI
// layer": the caller already falls back to legacy scoring when this
// returns an error (see AI_LAYER_FALLBACK above), so degrading is the
// designed path rather than a new one.
baseURL := strings.TrimSpace(os.Getenv("AI_LAYER_BASE_URL"))
if baseURL == "" {
baseURL = "https://routemate.workolik.com"
return aiDecisionResponse{}, fmt.Errorf("AI_LAYER_BASE_URL is not set")
}
now := time.Now()