{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://dellasale.com/ucp/schemas/business/services.json",
  "title": "Dellasale Services",
  "$ref": "#/$defs/ServiceCatalog",
  "$defs": {
    "Meta": {
      "type": "object",
      "required": ["ucp-agent"],
      "properties": {
        "ucp-agent": {
          "type": "object",
          "required": ["profile"],
          "properties": { "profile": { "type": "string", "format": "uri" } },
          "additionalProperties": true
        }
      },
      "additionalProperties": true
    },
    "UcpEnvelope": {
      "type": "object",
      "required": ["version", "status", "capabilities"],
      "properties": {
        "version": { "const": "2026-08-25" },
        "status": { "enum": ["success", "error"] },
        "capabilities": { "type": "object" }
      },
      "additionalProperties": true
    },
    "Service": {
      "type": "object",
      "required": ["id", "name", "description", "category", "service_regions", "pricing_mode", "actions", "last_updated"],
      "properties": {
        "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{1,63}$" },
        "name": { "type": "string", "minLength": 1 },
        "description": { "type": "string", "minLength": 1 },
        "category": { "type": "string", "minLength": 1 },
        "service_regions": { "type": "array", "items": { "type": "string" }, "minItems": 1, "uniqueItems": true },
        "pricing_mode": { "enum": ["fixed", "starting_at", "range", "quote_required"] },
        "actions": {
          "type": "array",
          "items": { "enum": ["request_quote", "schedule_meeting", "create_lead"] },
          "uniqueItems": true
        },
        "last_updated": { "type": "string", "format": "date" }
      },
      "additionalProperties": false
    },
    "ServiceCatalog": {
      "type": "array",
      "items": { "$ref": "#/$defs/Service" }
    },
    "ListServicesRequest": {
      "type": "object",
      "required": ["meta"],
      "properties": {
        "meta": { "$ref": "#/$defs/Meta" },
        "query": { "type": "string", "maxLength": 500 },
        "locale": { "type": "string", "default": "pt-BR" },
        "country": { "type": "string", "minLength": 2, "maxLength": 2 }
      },
      "additionalProperties": false
    },
    "ListServicesResponse": {
      "type": "object",
      "required": ["ucp", "services"],
      "properties": {
        "ucp": { "$ref": "#/$defs/UcpEnvelope" },
        "services": { "$ref": "#/$defs/ServiceCatalog" },
        "messages": { "type": "array", "items": { "type": "object" } }
      },
      "additionalProperties": false
    }
  }
}
