HOCO B2B
Team tasksAnis

SRV-37 — V2 — Tour optimisation & stock-system sync

Routing-engine based visit ordering with time windows; API synchronisation with HOCO's stock system.

FieldDetails
Task codeSRV-37
PhaseP4 — V2 evolutions
Product scopeV2
StatusPlanned
StartSun 7 Feb 2027
DueTue 9 Feb 2027
ResponsibleAnis — Full-stack developer
Co-responsible—
Effort2.5 person-day(s) planned · 6 from scratch · size M
Area · appServer · server
Depends onSRV-34
UnblocksSRV-38
Milestones—

Summary

Routing-engine based visit ordering with time windows; API synchronisation with HOCO's stock system.

Description

Two V2 items complete field and stock automation (cahier §11, §14.2; FLD-18, STK-09): automatic tour optimisation and API synchronisation with HOCO's existing stock system. Tour optimisation replaces the V1 nearest-neighbour recommendation with a routing engine that accounts for road distances, visit time windows, priorities and visit durations, behind the same admin.tours.recommendOrder operation. Stock sync replaces the V1 file import with a scheduled and/or webhook-based exchange: levels pulled from HOCO's system, platform movements pushed back, a reconciliation report and an explicit conflict policy. Out of scope: changes to the delegate app beyond consuming the same visit order.

Subtasks

#SubtaskOwner
1Routing engine choice and setup (self-hosted OSRM/VROOM or a hosted routing API) with cost and data reviewAnis
2Optimisation request builder: start point, stops with coordinates, time windows, priorities, durations; result mapped to visit orderAnis
3admin.tours.recommendOrder switched to the engine with fallback to nearest-neighbour on failureAnis
4Stock-system connector: authentication, level pull, movement push, retry and idempotencyAnis
5Conflict policy (source of truth per field) and reconciliation report of differencesAnis
6Sync schedule and monitoring (last sync, errors, drift alerts)Anis

Deliverables

  • apps/server/src/modules/field/optimisation/{engine.ts,request-builder.ts}
  • apps/server/src/modules/integrations/stock-sync/{connector.ts,reconcile.job.ts}
  • Integration specification agreed with HOCO's stock system provider

Acceptance criteria

  • For a sample tour the optimised order is never longer in road distance than the nearest-neighbour order and respects time windows (FLD-18)
  • If the routing engine fails, the recommendation falls back to nearest-neighbour with a warning
  • A stock change in HOCO's system is reflected in platform availability within the agreed sync interval (STK-09)
  • Every reconciliation run produces a report and no movement is applied twice

Requirements covered

RequirementTitleRelease
FLD-18Automatic tour optimisation (routing engine)V2
STK-09Synchronisation with the client's existing stock system (V1 import, V2 API)V2

API surface

Endpoint groupOperations
Field operations20
Stock8

Test measures

  • Benchmark on recorded V1 tours comparing distances
  • Integration tests against the stock system sandbox or a recorded mock

Risks

  • HOCO's stock system has no usable API — keep the V1 scheduled file import as the integration path

KPI

  • Delivered by Tue 9 Feb 2027 within 2.5 person-day(s).
  • Every acceptance criterion above demonstrated before hand-off; linked requirements' acceptance criteria pass.
  • Zero open critical defects, permission gaps or data-integrity regressions at sign-off.

Generated from content/plan/tasks.json by scripts/generate-team-tasks.mjs. Dates are computed by the scheduler (Sunday–Thursday weeks, holidays excluded) — change the plan, not this page.

On this page