{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/alto-vebra/json-schema/alto-vebra-branch-schema.json",
  "title": "Branch",
  "description": "Represents a branch.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/alto-vebra-branches-api-openapi.yml#/components/schemas/Branch",
  "type": "object",
  "properties": {
    "branchId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The ID of the branch."
    },
    "createdAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "The date and time the branch was created.",
      "format": "date-time"
    },
    "modifiedAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "The date and time the branch was last modified.",
      "format": "date-time"
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "The name of the branch."
    },
    "address": {
      "allOf": [
        {
          "$ref": "#/$defs/Address"
        }
      ],
      "description": "The branch address."
    },
    "status": {
      "allOf": [
        {
          "$ref": "#/$defs/BranchStatus"
        }
      ],
      "description": "The status of the branch."
    },
    "defaultMarket": {
      "allOf": [
        {
          "$ref": "#/$defs/PropertyRecordType"
        }
      ],
      "description": "The default market of the branch."
    }
  },
  "additionalProperties": false,
  "$defs": {
    "Address": {
      "type": "object",
      "properties": {
        "subDwelling": {
          "type": [
            "string",
            "null"
          ]
        },
        "nameNumber": {
          "type": [
            "string",
            "null"
          ]
        },
        "street": {
          "type": [
            "string",
            "null"
          ]
        },
        "locality": {
          "type": [
            "string",
            "null"
          ]
        },
        "town": {
          "type": [
            "string",
            "null"
          ]
        },
        "county": {
          "type": [
            "string",
            "null"
          ]
        },
        "postcode": {
          "type": [
            "string",
            "null"
          ]
        },
        "countryCode": {
          "type": [
            "string",
            "null"
          ]
        },
        "uprn": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "BranchStatus": {
      "enum": [
        "Unknown",
        "Active",
        "Inactive"
      ],
      "type": "string"
    },
    "PropertyRecordType": {
      "enum": [
        "Unspecified",
        "Sale",
        "Rent"
      ],
      "type": "string"
    }
  }
}