From ebba1025ac17ee4b9175a67c49fd6361dd75ec04 Mon Sep 17 00:00:00 2001 From: louispaulb Date: Thu, 2 Jul 2026 19:03:52 -0400 Subject: [PATCH] feat(dispatch): TARGO office as default departure + per-tech origin button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit techOrigin(techId): a tech's departure point = their home if set, else the TARGO office (depot from roster policy) — the stated default. Wired into ALL 9 origin sites: greedy proximity, VRP vehicles (solver now optimizes from the office), techsForJob/Selection ranking, review nnOrder + suggestRoutes + loadLegTimes, and the Tournées tab. UI: origin button on each tech — 🏠 (teal) when home set, 🏢 (grey) for office-default — in the review header AND the Tournées legend; click opens the existing home map picker (GPS position / search / map click). The first-leg line now reads "🏢 bureau TARGO → 1er arrêt : X min" or "🏠 domicile → …" (legsByKey carries the origin kind). Verified: prod policy has the depot (Sainte-Clotilde) and 1 home → all legends show 🏢; review shows real OSRM office→first-stop times (21/43/29/26 min); pin opens "Domicile — Anthony Dion" picker. Co-Authored-By: Claude Opus 4.8 (1M context) --- apps/ops/src/pages/PlanificationPage.vue | 45 +++++++++++++++--------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/apps/ops/src/pages/PlanificationPage.vue b/apps/ops/src/pages/PlanificationPage.vue index 7a6eb5e..3ba0cb8 100644 --- a/apps/ops/src/pages/PlanificationPage.vue +++ b/apps/ops/src/pages/PlanificationPage.vue @@ -483,7 +483,9 @@
- {{ r.name }} · {{ r.stops.length }} arrêt(s) · 🚗 {{ dayRouteMetrics[r.id].km }} km / {{ dayRouteMetrics[r.id].mins }} min + {{ r.name }} + Départ : {{ techHomes[r.id] ? 'domicile' : 'bureau TARGO (défaut)' }} — cliquer pour définir/modifier + · {{ r.stops.length }} arrêt(s) · 🚗 {{ dayRouteMetrics[r.id].km }} km / {{ dayRouteMetrics[r.id].mins }} min Aucune tournée géolocalisée ce jour — les jobs assignés n'ont pas de coordonnées, ou la journée est vide.
@@ -1065,6 +1067,8 @@ {{ g.techName }} n'a pas de quart {{ g.noShiftDays.length > 1 ? 'sur ' + g.noShiftDays.length + ' jour(s)' : 'ce jour' }} — créer un quart 8-16 + + Départ : {{ techHomes[g.techId] ? ('domicile — ' + (techHomes[g.techId].address || 'défini')) : 'bureau TARGO (défaut)' }} — cliquer pour définir/modifier le domicile Compétences & niveaux de {{ g.techName }} — glisser pour l'ordre de priorité @@ -1097,7 +1101,7 @@