feat: Nagercoil single-rider assignment endpoint

Adds POST /api/v1/optimization/nagercoil/riderassign. Nagercoil runs with one
rider, so this skips the matching/VRP/pattern logic in riderassign and straight-
assigns every order to the single rider, then reuses the shared TSP sequencer
(_sync_optimize_route) so stop order, cumulative kms and per-stop ETAs match the
main endpoint's response shape.

Rider defaults to Sivakumar Subramani (userid 852, 8248176099) via the
NAGERCOIL_RIDER constant; a `rider` object in the request body overrides it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018jhRcey2fxhwz2SuPVm7c5
This commit is contained in:
2026-09-03 12:07:17 +05:30
parent 75b175b16f
commit 1096dfa578
3 changed files with 252 additions and 1 deletions

View File

@@ -28,7 +28,7 @@ from app.core.exception_handlers import (
)
from app.core.exceptions import APIException
from app.middleware.request_id import RequestIDMiddleware
from app.routes import cache_router, health_router, ml_router, ml_web_router, optimization_router, batch_analytics_router, riders_router, doormile_router
from app.routes import cache_router, health_router, ml_router, ml_web_router, optimization_router, batch_analytics_router, riders_router, doormile_router, nagercoil_router
# ---------------------------------------------------------------------------
# Logging
@@ -184,6 +184,7 @@ app.include_router(ml_web_router)
app.include_router(batch_analytics_router)
app.include_router(riders_router)
app.include_router(doormile_router)
app.include_router(nagercoil_router)
@app.get("/", tags=["Root"])