{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://fairfare.pages.dev/fleet-schema-0.1.json",
 "title": "fleet.json 0.1: a taxi or private hire firm's own listing for assistants",
 "type": "object",
 "required": ["format", "name", "area", "contact", "licensing", "vehicles", "updated"],
 "properties": {
  "format": {"const": "fleet/0.1"},
  "name": {"type": "string", "description": "Trading name, as passengers know it."},
  "area": {"type": "object", "required": ["country", "towns"], "properties": {
   "country": {"type": "string", "pattern": "^[A-Z]{2}$"},
   "towns": {"type": "array", "items": {"type": "string"}, "minItems": 1},
   "airports": {"type": "array", "items": {"type": "string", "pattern": "^[A-Z]{3}$"}, "description": "Airports served, as IATA codes."}
  }},
  "contact": {"type": "object", "properties": {
   "phone": {"type": "string"}, "booking_url": {"type": "string", "pattern": "^https://"}, "email": {"type": "string"},
   "whatsapp": {"type": "string"}
  }, "anyOf": [{"required": ["phone"]}, {"required": ["booking_url"]}]},
  "licensing": {"type": "object", "required": ["authority"], "properties": {
   "authority": {"type": "string", "description": "The council, city or regulator that licenses the firm."},
   "operator_licence": {"type": "string"}
  }},
  "vehicles": {"type": "array", "minItems": 1, "items": {"type": "object", "required": ["type"], "properties": {
   "type": {"enum": ["saloon", "sedan", "estate", "mpv", "minibus", "wav", "executive", "black_cab", "suv", "ev"]},
   "seats": {"type": "integer"}, "wheelchair": {"type": "boolean"}, "child_seat": {"type": "boolean"}, "pets": {"type": "boolean"}, "ev": {"type": "boolean"}
  }}},
  "tariff": {"type": "object", "required": ["currency", "flag"], "properties": {
   "currency": {"type": "string", "pattern": "^[A-Z]{3}$"}, "flag": {"type": "number"}, "per_mile": {"type": "number"}, "per_km": {"type": "number"},
   "per_min": {"type": "number"}, "minimum": {"type": "number"},
   "fixed": {"type": "array", "items": {"type": "object", "required": ["from", "to", "price"], "properties": {"from": {"type": "string"}, "to": {"type": "string"}, "price": {"type": "number"}}}}
  }},
  "hours": {"type": "string", "description": "When bookings are taken, for example 24/7 or Mon-Sat 06:00-01:00."},
  "payment": {"type": "array", "items": {"enum": ["cash", "card", "contactless", "app", "account"]}},
  "updated": {"type": "string", "description": "Date the file was last checked, YYYY-MM-DD."}
 }
}
