{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/brm-chronographes-com/json-schema/brm-chronographes-com-demande-commande-schema.json",
  "title": "DemandeCommande",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/brm-chronographes-com-agent-orders-api-openapi.yml#/components/schemas/DemandeCommande",
  "properties": {
    "configuration": {
      "$ref": "#/$defs/app__routers__agent_configurateur__Configuration"
    },
    "customer": {
      "$ref": "#/$defs/Client"
    },
    "shipping_address": {
      "$ref": "#/$defs/Adresse"
    },
    "lang": {
      "type": "string",
      "maxLength": 5,
      "title": "Lang",
      "default": "en"
    },
    "user_consent": {
      "type": "boolean",
      "title": "User Consent",
      "description": "MUST be true: the user explicitly asked to order this watch and agreed to share their name, email and address with B.R.M for this order."
    }
  },
  "type": "object",
  "required": [
    "configuration",
    "customer",
    "shipping_address",
    "user_consent"
  ],
  "$defs": {
    "Adresse": {
      "properties": {
        "line1": {
          "type": "string",
          "maxLength": 120,
          "minLength": 3,
          "title": "Line1"
        },
        "line2": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ],
          "title": "Line2"
        },
        "postal_code": {
          "type": "string",
          "maxLength": 16,
          "minLength": 2,
          "title": "Postal Code"
        },
        "city": {
          "type": "string",
          "maxLength": 80,
          "minLength": 1,
          "title": "City"
        },
        "region": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 60
            },
            {
              "type": "null"
            }
          ],
          "title": "Region",
          "description": "State / province / region when the country uses one."
        },
        "country": {
          "type": "string",
          "maxLength": 2,
          "minLength": 2,
          "title": "Country",
          "description": "ISO-3166 alpha-2, e.g. 'US'."
        }
      },
      "type": "object",
      "required": [
        "line1",
        "postal_code",
        "city",
        "country"
      ],
      "title": "Adresse"
    },
    "Client": {
      "properties": {
        "email": {
          "type": "string",
          "maxLength": 200,
          "title": "Email"
        },
        "first_name": {
          "type": "string",
          "maxLength": 60,
          "minLength": 1,
          "title": "First Name"
        },
        "last_name": {
          "type": "string",
          "maxLength": 60,
          "minLength": 1,
          "title": "Last Name"
        },
        "phone": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 30
            },
            {
              "type": "null"
            }
          ],
          "title": "Phone"
        }
      },
      "type": "object",
      "required": [
        "email",
        "first_name",
        "last_name"
      ],
      "title": "Client"
    },
    "app__routers__agent_configurateur__Configuration": {
      "properties": {
        "model": {
          "type": "string",
          "maxLength": 80,
          "title": "Model",
          "description": "Model slug, e.g. 'v6-44-sa'."
        },
        "options": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "maxItems": 40,
          "title": "Options",
          "description": "option_id values from GET /models/{model}."
        },
        "engraving": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 24
            },
            {
              "type": "null"
            }
          ],
          "title": "Engraving"
        }
      },
      "type": "object",
      "required": [
        "model"
      ],
      "title": "Configuration"
    }
  }
}