Dispatch API

A service for managing and dispatching missions, providing health checks, and logging mission executions.


Features


Installation

  1. Clone the repository:

bash git clone https://source.modulotech.fr/modulosource/powerpanne/powerpanne/houston/archimede/dispatch.git cd dispatch

Usage

Run the FastAPI server:

bash docker compose up --build # on Mac os docker-compose up --biuld # on Windows

Endpoints

GET /

Returns the README.md rendered as HTML in the browser.

GET|POST /health

Health check endpoint.

Response

json { "status": "ok" }

GET /dispatch

Dispatch a mission. Requires query parameters via DispatchRequestParams (mission ID, etc.) and optional API key. Returns recommended driver:

json { "status_code": 200, "recommended_driver_id": 123 }

GET /dispatch_logs

Returns today's mission logs and rules. Example response:

json { "rules": "Rules from rules.md and today's planning", "missions_executions": [ { "mission_id": 1, "recommended_dirver": 5, "chain_of_thought": "chain of thought of the ai model", "trained_recommended_ai": 4, "date": 39849308 } ], "missions_data": [ { "mission_id": 1, "misison_data": { "drivers": [ { "id": 165129, "billable_item_id": 28937, "billable_item_name": null, "count": 1 }, { "id": 165226, "billable_item_id": 28933, "billable_item_name": null, "count": 1 } ], "mission": { "id": 15443733, "driver_id": null, "created_at": "2025-09-02T08:00:32.000+02:00", "pickup_address": { "id": 76493439, "number": null, "country": null, "city_zip": "94100", "city_name": "Saint-Maur-des-Fossés", "street_name": "52 Avenue de Tunis", "latitude": 48.80823, "longitude": 2.48452, "is_underground": null, "garage_id": null, "garage_name": null, "site_id": null, "site_name": null }, "pickup_time": "2025-09-02T08:45:31.000+02:00", "intervention_type_id": 3, "intervention_type_name": "Remorquage", "is_rendez_vous": false, "snsa_breakdown_origin_id": null, "vehicle": { "type_id": 1, "type_name": "Véhicule léger", "brand_id": 65, "brand_name": "toyota", "energy_id": 4, "energy_name": "vehicle_energy_electrique_hybrid", "motricity_id": null, "motricity_name": null, "gear_id": 1, "gear_name": "vehicle_gear_automatic", "not_able_to_move": null, "is_wreck": null, "f2": null }, "agency": { "id": 61, "name": "Noisy", "address": { "id": 56680, "number": "6", "country": "FR", "city_zip": "93160", "city_name": "Noisy-le-Grand", "street_name": "All. des Performances", "latitude": 48.8325992, "longitude": 2.5850547, "is_underground": null, "garage_id": null, "garage_name": null, "site_id": null, "site_name": null } } } } } ] }


Database Models


Development