{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ivans/json-schema/ivans-market-detail-schema.json",
  "title": "MarketDetail",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ivans-markets-api-openapi.yml#/components/schemas/MarketDetail",
  "type": "object",
  "properties": {
    "broker": {
      "$ref": "#/$defs/Broker"
    },
    "carrier": {
      "$ref": "#/$defs/Carrier"
    },
    "countries": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MarketCountry"
      }
    },
    "subdivisions": {
      "allOf": [
        {
          "$ref": "#/$defs/MarketSubdivision"
        }
      ],
      "readOnly": true
    },
    "products": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Product"
      }
    },
    "uuid": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string",
      "maxLength": 128
    },
    "displayName": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 128
    },
    "notes": {
      "type": "string"
    },
    "logo": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "pattern": "(?:png|jpg|svg|jpeg)$"
    },
    "akGroupId": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 32
    }
  },
  "required": [
    "broker",
    "carrier",
    "countries",
    "name",
    "products",
    "subdivisions"
  ],
  "$defs": {
    "BlankEnum": {
      "enum": [
        ""
      ]
    },
    "Broker": {
      "type": "object",
      "properties": {
        "uuid": {
          "type": "string",
          "format": "uuid",
          "readOnly": true
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "deleted": {
          "type": "boolean"
        },
        "deletedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "name": {
          "type": "string",
          "maxLength": 256
        },
        "fein": {
          "type": "string",
          "description": "Federal Employer Identification Number",
          "maxLength": 10
        },
        "npn": {
          "type": "string",
          "description": "National Producer Number",
          "maxLength": 32
        }
      },
      "required": [
        "createdAt",
        "updatedAt",
        "uuid"
      ]
    },
    "Carrier": {
      "type": "object",
      "properties": {
        "uuid": {
          "type": "string",
          "format": "uuid",
          "readOnly": true
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "deleted": {
          "type": "boolean"
        },
        "deletedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "companyId": {
          "type": [
            "integer",
            "null"
          ],
          "maximum": 2147483647,
          "minimum": -2147483648
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 256
        },
        "groupNumber": {
          "type": [
            "integer",
            "null"
          ],
          "maximum": 2147483647,
          "minimum": -2147483648
        },
        "icoType": {
          "description": "[('Property & Casualty', 'P'), ('LIFE', 'L'), ('HEALTH', 'H'), ('GPAL', 'G')]",
          "oneOf": [
            {
              "$ref": "#/$defs/IcoTypeEnum"
            },
            {
              "$ref": "#/$defs/BlankEnum"
            },
            {
              "$ref": "#/$defs/NullEnum"
            }
          ]
        },
        "monikers": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": {},
          "description": "A list of strings that represent the company's moniker(s).",
          "minProperties": 1
        }
      },
      "required": [
        "createdAt",
        "updatedAt",
        "uuid"
      ]
    },
    "IcoTypeEnum": {
      "enum": [
        "Property & Casualty",
        "LIFE",
        "HEALTH",
        "GPAL"
      ],
      "type": "string"
    },
    "LineOfBusiness": {
      "type": "object",
      "properties": {
        "uuid": {
          "type": "string",
          "format": "uuid",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "maxLength": 128
        },
        "code": {
          "type": "string",
          "maxLength": 32
        }
      },
      "required": [
        "code",
        "name",
        "uuid"
      ]
    },
    "MarketCountry": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "readOnly": true
        },
        "uuid": {
          "type": "string",
          "format": "uuid",
          "readOnly": true
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "maxLength": 128
        },
        "alpha3": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 3
        },
        "alpha2": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2
        },
        "numerical": {
          "type": [
            "integer",
            "null"
          ],
          "maximum": 2147483647,
          "minimum": -2147483648
        }
      },
      "required": [
        "createdAt",
        "id",
        "name",
        "updatedAt",
        "uuid"
      ]
    },
    "MarketSubdivision": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "readOnly": true
        },
        "uuid": {
          "type": "string",
          "format": "uuid",
          "readOnly": true
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "maxLength": 128
        },
        "alpha3": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 3
        },
        "alpha2": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2
        },
        "numerical": {
          "type": [
            "integer",
            "null"
          ],
          "maximum": 2147483647,
          "minimum": -2147483648
        },
        "subdivisionType": {
          "allOf": [
            {
              "$ref": "#/$defs/SubdivisionTypeEnum"
            }
          ],
          "minimum": -2147483648,
          "maximum": 2147483647
        },
        "country": {
          "type": "integer"
        },
        "parent": {
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "required": [
        "country",
        "createdAt",
        "id",
        "name",
        "subdivisionType",
        "updatedAt",
        "uuid"
      ]
    },
    "NullEnum": {
      "enum": [
        null
      ]
    },
    "Product": {
      "type": "object",
      "properties": {
        "lineOfBusiness": {
          "$ref": "#/$defs/LineOfBusiness"
        },
        "uuid": {
          "type": "string",
          "format": "uuid",
          "readOnly": true
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "maxLength": 128
        },
        "productType": {
          "$ref": "#/$defs/ProductTypeEnum"
        }
      },
      "required": [
        "createdAt",
        "lineOfBusiness",
        "name",
        "updatedAt",
        "uuid"
      ]
    },
    "ProductTypeEnum": {
      "enum": [
        "policy",
        "dbcd",
        "claims",
        "edocs"
      ],
      "type": "string"
    },
    "SubdivisionTypeEnum": {
      "enum": [
        1,
        2,
        3,
        4,
        5
      ],
      "type": "integer"
    }
  }
}