{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.shobusac.com/estimate-intake.json",
  "title": "Shobu's estimate request intake",
  "description": "Current fields accepted for an installation or replacement estimate request. This schema describes intake data; it is not a public submission API and does not confirm a booking or price.",
  "type": "object",
  "additionalProperties": false,
  "required": ["submissionId", "submittedAt", "source", "sourceDetail", "workType", "customerType", "serviceLine", "urgent", "businessImpact", "island", "postalCode", "customerName", "businessName", "phone", "email", "equipmentType", "problem", "preferredWindow", "consent", "consentVersion", "consentAt", "formElapsedMs"],
  "properties": {
    "submissionId": { "type": "string", "minLength": 1 },
    "submittedAt": { "type": "string", "format": "date-time" },
    "source": { "const": "website" },
    "sourceDetail": {
      "type": "object",
      "required": ["path"],
      "properties": {
        "path": { "type": "string", "description": "Path where the request began; no query string" },
        "referrer": { "type": ["string", "null"] }
      }
    },
    "workType": { "type": "string", "enum": ["repair", "maintenance", "replacement", "new-install"] },
    "customerType": { "type": "string", "enum": ["home", "business"] },
    "serviceLine": { "type": "string", "enum": ["residential-ac", "commercial-ac", "commercial-refrigeration", "ice-machine"] },
    "urgent": { "type": "boolean" },
    "businessImpact": { "type": "string", "maxLength": 500 },
    "island": { "const": "Oʻahu" },
    "customerName": { "type": "string", "minLength": 2, "maxLength": 120 },
    "businessName": { "type": "string", "maxLength": 160 },
    "phone": { "type": "string", "minLength": 7, "maxLength": 30, "description": "Customer callback number" },
    "email": { "anyOf": [{ "type": "string", "format": "email" }, { "const": "" }], "description": "Optional customer email" },
    "postalCode": { "type": "string", "pattern": "^[0-9]{5}$" },
    "equipmentType": { "type": "string", "enum": ["Split AC", "Central / packaged AC", "Commercial refrigeration", "Ice machine", "Ventilation", "Not sure"] },
    "problem": { "type": "string", "maxLength": 4000 },
    "preferredWindow": { "type": "string", "maxLength": 120 },
    "consent": { "const": true, "description": "The customer explicitly agrees that Shobu's may contact them about this request by phone, text, or email; message and data rates may apply" },
    "consentVersion": { "type": "string", "minLength": 1 },
    "consentAt": { "type": "string", "format": "date-time" },
    "formElapsedMs": { "type": "integer", "minimum": 0, "description": "Client-side time from form initialization to submission; use only as one spam signal." }
  },
  "allOf": [
    {
      "if": { "properties": { "customerType": { "const": "business" } }, "required": ["customerType"] },
      "then": { "properties": { "businessName": { "minLength": 2 } } }
    }
  ],
  "x-submission-page": "https://www.shobusac.com/get-quote",
  "x-phone": "+1-808-526-8068",
  "x-service-area": "Oʻahu",
  "x-human-review-required": true,
  "x-booking-confirmed-on-submit": false,
  "x-firm-price-confirmed-on-submit": false
}
