{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "company.schema.json",
    "title": "Company",
    "type": "object",
    "description": "Юридическое лицо",
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "description": "Уникальный идентификатор"
        },
        "customer": {
            "Sref": "customer.schema.json"
        },
        "fullName": {
            "type": "string",
            "description": "Название"
        },
        "fullNameEnglish": {
            "type": "string",
            "description": "Название на английском языке"
        },
        "inn": {
            "type": "string",
            "description": "ИНН"
        },
        "kpp": {
            "type": "string",
            "minLength": 9,
            "maxLength": 9,
            "pattern": "^[0-9]{9}$",
            "description": "КПП"
        },
        "ogrn": {
            "type": "string",
            "description": "ОГРН"
        },
        "bankAccount" : {
            "$ref": "common/_common.schema.json#/bankAccount"
        },
        "addressRegistration": {
            "description": "Адрес регистрации",
            "$ref": "common/_common.schema.json#/address"
        },
        "addressRegistrationEnglish": {
            "description": "Адрес регистрации на английском языке",
            "$ref": "common/_common.schema.json#/address"
        },
        "taxResidence" : {
            "$ref": "common/_common.schema.json#/country",
            "description": "Страна налогового резидентства"
        },
        "representative": {
            "$ref": "common/_common.schema.json#/representative"
        },
        "stampPath" : {
            "type": "string",
            "description" : "Путь к файлу с изображением штампа"
        },
        "additionalProperties": false,
        "required": [
            "id",
            "fullName",
            "inn",
            "kpp",
            "taxResidence"
        ]
    } 
}