Check Assignments
Validate existing assignments
POST
/scheduling/checkValidate existing assignments without making changes. Useful for checking if manual assignments are valid before committing them.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
trips | Trip[] | Yes | Trips with carId set to the vehicle to validate |
cars | Vehicle[] | Yes | Available vehicles |
settings | AssignmentSettings | No | Assignment constraints to validate against |
Trip
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Trip identifier |
carId | string | Yes | Pre-assigned vehicle to validate |
date | ISO8601 | Yes | Trip start time |
duration | number | Yes | Trip duration (seconds) |
distance | number | Yes | Trip distance (meters) |
seats | number | Yes | Seats required |
attr | string[] | No | Required attributes |
stops | Stop[] | Yes | Trip stops with times and locations |
Stop
| Field | Type | Required | Description |
|---|---|---|---|
loc | Coordinates | Yes | Stop location |
date | ISO8601 | Yes | Scheduled arrival time |
name | string | No | Stop name/address |
Coordinates
| Field | Type | Required | Description |
|---|---|---|---|
lat | number | Yes | Latitude |
lng | number | Yes | Longitude |
Vehicle
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Vehicle identifier |
seats | number | Yes | Total seat capacity |
attr | string[] | Yes | Vehicle attributes |
addrLoc | Coordinates | Yes | Home/starting location |
shifts | Shift[] | No | Availability schedule |
Example Response
Response Fields
| Field | Type | Description |
|---|---|---|
valid | object[] | Assignments that passed validation |
valid[].tripId | string | Trip ID |
valid[].vehicleId | string | Vehicle ID |
invalid | object[] | Assignments that failed validation |
invalid[].tripId | string | Trip ID |
invalid[].vehicleId | string | Vehicle ID |
counter.total | number | Total assignments checked |
counter.valid | number | Count of valid assignments |
counter.invalid | number | Count of invalid assignments |
Validation Checks
The engine validates:
- Attribute Matching: Vehicle has all required trip attributes
- Capacity: Vehicle can accommodate trip seat requirements
- Shift Availability: Driver shift covers trip time (if shifts defined)
- Timing Conflicts: No overlapping trips for same vehicle
- Distance Constraints: First trip within allowed distance from home
Use Cases
- Manual Assignment Validation: Check dispatcher assignments before saving
- Import Validation: Validate bulk-imported assignments
- Pre-flight Check: Verify assignments before trip execution
- Audit: Review historical assignments for compliance