Mission Management
The Mission API provides endpoints to manage the complete lifecycle of vehicle missions, from creation through completion or cancellation.Mission Lifecycle
Missions follow a defined state flow:- PROGRAMADA (Scheduled) - Initial state when created
- EN_EJECUCION (In Progress) - After starting the mission
- COMPLETADA (Completed) - Successfully finished
- CANCELADA (Cancelled) - Terminated before completion
Available Operations
Create Mission
Create a new mission for an approved request
Assign Resources
Assign vehicle and driver to a scheduled mission
Start Mission
Begin executing a scheduled mission
Finish Mission
Complete a mission in progress
Cancel Mission
Cancel a mission with reason
List Missions
Get missions with pagination and filters
Get Mission
Retrieve mission details and mileage
Update Mission
Modify a scheduled mission
Delete Mission
Soft delete a scheduled mission
Key Features
- Multi-stop Support: Missions can include multiple stops with estimated arrival times
- Resource Assignment: Validates vehicle and driver availability before assignment
- Mileage Tracking: Records initial and final mileage for each mission
- Fuel Consumption: Automatically calculates fuel consumption in gallons
- State Validation: Enforces valid state transitions throughout the lifecycle
- Request Integration: Automatically updates parent request status based on mission states
Common Response Codes
200- Success201- Created successfully404- Resource not found409- Conflict (invalid state transition or resource already assigned)422- Validation error500- Internal server error