Files
MobilityOps/contracts/events.schema.json

36 lines
1.3 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://itworx.tech/schemas/mobilityops-events-v1.json",
"title": "MobilityOps event envelope",
"type": "object",
"required": ["event_id", "event_type", "occurred_at", "correlation_id", "aggregate", "data"],
"properties": {
"event_id": {"type": "string", "format": "uuid"},
"event_type": {"const": "vehicle.returned.v1"},
"occurred_at": {"type": "string", "format": "date-time"},
"correlation_id": {"type": "string"},
"aggregate": {
"type": "object",
"required": ["type", "id", "public_ref"],
"properties": {
"type": {"const": "booking"},
"id": {"type": "string", "format": "uuid"},
"public_ref": {"type": "string"}
},
"additionalProperties": false
},
"data": {
"type": "object",
"required": ["vehicle_ref", "inspection_ref", "resulting_vehicle_status", "attention_reasons"],
"properties": {
"vehicle_ref": {"type": "string"},
"inspection_ref": {"type": "string"},
"resulting_vehicle_status": {"enum": ["cleaning", "maintenance", "blocked"]},
"attention_reasons": {"type": "array", "items": {"type": "string"}}
},
"additionalProperties": false
}
},
"additionalProperties": false
}