{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://albergance.com/agents/request.schema.json",
 "title": "Albergance request sent by an AI agent",
 "description": "Body of POST /api/request.php, or of an email to hello@albergance.com. A person at Albergance confirms every request.",
 "type": "object",
 "required": [
  "type",
  "property",
  "contact",
  "agent"
 ],
 "additionalProperties": false,
 "properties": {
  "type": {
   "enum": [
    "quote",
    "trial",
    "meeting",
    "subscription_intent",
    "question"
   ],
   "description": "subscription_intent: the hotel wants to subscribe; nothing is billed before a person confirms."
  },
  "language": {
   "enum": [
    "en",
    "fr"
   ],
   "default": "en"
  },
  "property": {
   "type": "object",
   "required": [
    "name",
    "city"
   ],
   "additionalProperties": false,
   "properties": {
    "name": {
     "type": "string",
     "maxLength": 160
    },
    "city": {
     "type": "string",
     "maxLength": 120
    },
    "country": {
     "type": "string",
     "maxLength": 2,
     "default": "FR",
     "description": "ISO 3166-1 alpha-2"
    },
    "rooms": {
     "type": "integer",
     "minimum": 1,
     "maximum": 5000
    },
    "employees": {
     "type": "integer",
     "minimum": 1,
     "maximum": 5000,
     "description": "Employees of the property, used to price Shift"
    },
    "website": {
     "type": "string",
     "maxLength": 300
    },
    "pms": {
     "type": "string",
     "maxLength": 120
    },
    "channel_manager": {
     "type": "string",
     "maxLength": 120
    },
    "company_id": {
     "type": "string",
     "maxLength": 40,
     "description": "SIREN, SIRET or VAT number"
    }
   }
  },
  "contact": {
   "type": "object",
   "required": [
    "name",
    "email"
   ],
   "additionalProperties": false,
   "properties": {
    "name": {
     "type": "string",
     "maxLength": 160
    },
    "role": {
     "type": "string",
     "maxLength": 120
    },
    "email": {
     "type": "string",
     "format": "email",
     "maxLength": 200
    },
    "phone": {
     "type": "string",
     "maxLength": 40
    }
   }
  },
  "agent": {
   "type": "object",
   "required": [
    "name",
    "acting_for"
   ],
   "additionalProperties": false,
   "properties": {
    "name": {
     "type": "string",
     "maxLength": 120,
     "description": "Name of the agent or assistant"
    },
    "operator": {
     "type": "string",
     "maxLength": 120,
     "description": "Company that runs the agent"
    },
    "acting_for": {
     "type": "string",
     "maxLength": 300,
     "description": "Who gave the mandate, and its scope"
    },
    "contact_url": {
     "type": "string",
     "maxLength": 300
    }
   }
  },
  "modules": {
   "type": "array",
   "maxItems": 9,
   "items": {
    "enum": [
     "signal",
     "desk",
     "welcome",
     "outbound",
     "shift",
     "supply",
     "pilot",
     "compset",
     "yield"
    ]
   }
  },
  "yield_level": {
   "enum": [
    "standard",
    "intensive"
   ],
   "default": "standard"
  },
  "billing": {
   "enum": [
    "annual",
    "monthly"
   ],
   "default": "annual"
  },
  "message": {
   "type": "string",
   "maxLength": 4000
  }
 }
}
