{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "customer.schema.json",
    "title": "Customer",
    "type": "object",
    "description": "Клиент",
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "description": "Уникальный идентификатор"
        },
         "createdBy": {
            "type": "string",
            "description": "id пользователя, создавшего клиента"
        },
        "type": {
            "enum": [
                "COMPANY",
                "PERSON",
                "IP"
            ],
            "description": "Тип заказчика \n\n - `COMPANY`: юр.лицо \n - `PERSON`: физ.лицо \n - `IP`: индивидуальный предприниматель"
        },
        "isPriority": {
            "type": "boolean",
            "description": "Признак приоритетного клиента"
        },
        "status": {
            "description": "Статус клиента",
            "enum": ["ACTIVE", "INACTIVE"]
        },
        "email": {
            "$ref": "common/_common.schema.json#/email",
            "description": "E-mail клиента"
        },
        "partner": {
            "type": "string",
            "description": "Партнер"
        },
        "signingType": {
            "enum": [
               "SIMPLE_ELECTRONIC",
               "HANDWRITTEN"
            ],
            "description": "Способ подписания документов \n\n - `HANDWRITTEN`: подписание вручную \n - `SIMPLE_ELECTRONIC`: ПЭП "
        },
        "canRequestSubsidiary": {
            "type": "boolean",
            "description": "Может запрашивать согласование плательщика"
        },
        "prioritySubsidiaries": {
            "type": "array",
            "item": {
                "$ref": "subsidiary.schema.json"
            }
        },
        "defaultContractDirection": {
            "enum": [
                "EXPORT",
                "IMPORT"
            ],
            "description": "Тип договора при автосоздании \n\n - `EXPORT`: экспортный \n - `IMPORT`: импортный"
        }
    },
    "additionalProperties": false,
    "required": [
        "id",
        "type",
        "status",
        "partner"
    ]
}