{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "subagent.schema.json",
    "title": "Subagent",
    "description": "Компания, выступающая субагентом между клиентом и третьим лицом",
    "type": "object",
    "properties": {
        "id": {
            "type": "string",
            "format": "UUID",
            "description": "Идентификатор"
        },
        "fullNameEnglish": {
            "type": "string",
            "description": "Название на английском языке"
        },
        "status": {
            "enum": [
                "ACTIVE",
                "INACTIVE"
            ],
            "description": "Статус \n\n - `ACTIVE`: Активен\n - `INACTIVE`: Заблокирован"
        },
        "agents" : {
            "description": "Связанные агенты",
            "type": "array",
            "items": {
                "Sref": "agent.schema.json"
            }
        },
        "limits" : {
            "description": "Лимита субагента",
            "type": "array",
            "items": {
                "properties": {
                    "currency":{
                        "description": "Валюта лимита",
                        "$ref" : "common/_common.schema.json#/currency"
                    },
                    "amount": {
                        "type": "number",
                        "minimum": 0,
                        "multipleOf": 0.01,
                        "description": "Сумма лимита"
                    }
                }
            }
        },
        "costs" : {
            "description": "предельного значения ставки платежкй субагента",
            "type": "array",
            "items": {
                "properties": {
                    "currency":{
                        "description": "Валюта платежа",
                        "$ref" : "common/_common.schema.json#/currency"
                    },
                    "minAmount": {
                        "type": "number",
                        "minimum": 0,
                        "multipleOf": 0.01,
                        "description": "Нижняя граница диапазона"
                    },
                    "maxAmount": {
                        "type": "number",
                        "minimum": 0,
                        "multipleOf": 0.01,
                        "description": "Верхняя граница диапазона"
                    },
                    "percent": {
                        "type": "number",
                        "multipleOf": 0.0001,
                        "description": "Размер предельного значения ставки, указывается в %"
                    }
                }
            }
        },
        "subsidiaries": {
            "description": "Связанные плательщики и получатели",
            "type": "array",
            "items": {
                "Sref": "subsidiary.schema.json"
            }
        }
    },
    "additionalProperties": false,
    "required": [
        "status"
    ]
}