{
    "documents": [
        {
            "id": "INVOICE_IMPORT",
            "title": {
                "ru": "Инвойс-поручение",
                "en": ""
            },
            "templateId": "INVOICE_IMPORT",
            "fileType": "INVOICE",
            "documentType": "ORDER",
            "documentDelimiter": "IMPORT",
            "conditions": [
                {
                    "type": "REQUIRED_ROLES",
                    "items": [
                        "AGENT",
                        "CONTRACTOR",
                        "SENIOR_CONTRACTOR"
                    ]
                },
                {
                    "type": "REQUIRED_STATES",
                    "items": [
                        "INVOICE_PREPARATION"
                    ]
                },
                {
                    "type": "REQUIRED_FIELDS",
                    "items": [
                        "document.notValidAfter",
                        "payment.paymentTerm"
                    ],
                    "errorText": {
                        "ru": "Заполните обязательные поля",
                        "en": ""
                    }
                }
            ]
        },
        {
            "id": "REPORT_IMPORT",
            "title": {
                "ru": "Акт-отчёт",
                "en": ""
            },
            "templateId": "REPORT_IMPORT",
            "fileType": "REPORT",
            "documentType": "ORDER",
            "documentDelimiter": "IMPORT",
            "conditions": [
                {
                    "type": "REQUIRED_ROLES",
                    "items": [
                        "AGENT",
                        "CONTRACTOR",
                        "SENIOR_CONTRACTOR"
                    ]
                },
                {
                    "type": "REQUIRED_STATES",
                    "items": [
                        "EXECUTION_IMPORT",
                        "REPORT_ADJUSTMENT"
                    ]
                },
                {
                    "type": "REQUIRED_FILES",
                    "items": [
                        "CONFIRMATION"
                    ],
                    "errorText": {
                        "ru": "Загрузите файл",
                        "en": ""
                    }
                }
            ],
            "signatories": {
                "CUSTOMER": {
                    "requiredStates": [
                        "CUSTOMER_REPORT_SIGNING"
                    ]
                }
            }
        },
        {
            "id": "INVOICE_UPLOADED_EXPORT",
            "title": {
                "ru": "Инвойс",
                "en": ""
            },
            "templateId": "INVOICE_UPLOADED_EXPORT",
            "fileType": "INVOICE",
            "documentType": "EXPORT_ORDER"
        },
        {
            "id": "INVOICE_COMMODITY_EXPORT",
            "title": {
                "ru": "Инвойс на товары",
                "en": ""
            },
            "templateId": "INVOICE_COMMODITY_EXPORT",
            "fileType": "INVOICE",
            "documentType": "ORDER",
            "documentDelimiter": "EXPORT",
            "conditions": [
                {
                    "type": "REQUIRED_ROLES",
                    "items": [
                        "AGENT",
                        "CONTRACTOR",
                        "SENIOR_CONTRACTOR"
                    ]
                },
                {
                    "type": "REQUIRED_STATES",
                    "items": [
                        "INSTRUCTION_PREPARATION",
                        "INVOICE_PREPARATION",
                        "INVOICE_ADJUSTMENT"
                    ]
                },
                {
                    "type": "REQUIRED_FIELDS",
                    "items": [
                        "subsidiary",
                        "additionalInfo.invoiceNum",
                        "additionalInfo.invoiceDate"
                    ]
                }
            ]
        },
        {
            "id": "INVOICE_SERVICES_EXPORT",
            "title": {
                "ru": "Инвойс на услуги",
                "en": ""
            },
            "templateId": "INVOICE_SERVICES_EXPORT",
            "fileType": "INVOICE",
            "documentType": "ORDER",
            "documentDelimiter": "EXPORT",
            "conditions": [
                {
                    "type": "REQUIRED_ROLES",
                    "items": [
                        "AGENT",
                        "CONTRACTOR",
                        "SENIOR_CONTRACTOR"
                    ]
                },
                {
                    "type": "REQUIRED_STATES",
                    "items": [
                        "INSTRUCTION_PREPARATION",
                        "INVOICE_PREPARATION",
                        "INVOICE_ADJUSTMENT"
                    ]
                },
                {
                    "type": "REQUIRED_FIELDS",
                    "items": [
                        "subsidiary",
                        "additionalInfo.invoiceNum",
                        "additionalInfo.invoiceDate"
                    ]
                }
            ]
        },
        {
            "id": "INSTRUCTION_EXPORT",
            "title": {
                "ru": "Поручение",
                "en": ""
            },
            "templateId": "INSTRUCTION_EXPORT",
            "fileType": "INSTRUCTION",
            "documentType": "ORDER",
            "documentDelimiter": "EXPORT",
            "conditions": [
                {
                    "type": "REQUIRED_ROLES",
                    "items": [
                        "AGENT",
                        "CONTRACTOR",
                        "SENIOR_CONTRACTOR"
                    ]
                },
                {
                    "type": "REQUIRED_STATES",
                    "items": [
                        "INSTRUCTION_PREPARATION"
                    ]
                },
                {
                    "type": "REQUIRED_FIELDS",
                    "items": [
                        "payment.paymentTerm"
                    ]
                }
            ],
            "signatories": {
                "CUSTOMER": {
                    "signingType": "SIMPLE_ELECTRONIC",
                    "requiredStates": [
                        "CUSTOMER_INSTRUCTION_SIGNING"
                    ]
                },
                "CONTRACTOR": {
                    "signingType": "HANDWRITTEN",
                    "requiredStates": [
                        "CUSTOMER_INSTRUCTION_SIGNING"
                    ]
                }
            }
        },
        {
            "id": "REPORT_EXPORT",
            "title": {
                "ru": "Акт-отчёт",
                "en": ""
            },
            "templateId": "REPORT_EXPORT",
            "fileType": "REPORT",
            "documentType": "ORDER",
            "documentDelimiter": "EXPORT",
            "conditions": [
                {
                    "type": "REQUIRED_ROLES",
                    "items": [
                        "AGENT",
                        "CONTRACTOR",
                        "SENIOR_CONTRACTOR"
                    ]
                },
                {
                    "type": "REQUIRED_STATES",
                    "items": [
                        "REPORT_PREPARATION",
                        "REPORT_ADJUSTMENT"
                    ]
                }
            ],
            "signatories": {
                "CUSTOMER": {
                    "requiredStates": [
                        "CUSTOMER_REPORT_SIGNING"
                    ]
                },
                "CONTRACTOR": {
                    "signingType": "HANDWRITTEN",
                    "requiredStates": [
                        "CUSTOMER_REPORT_SIGNING"
                    ]
                }
            }
        },
        {
            "id": "AGREEMENT_IMPORT",
            "title": {
                "ru": "Договор",
                "en": ""
            },
            "templateId": "AGREEMENT_IMPORT",
            "fileType": "AGREEMENT",
            "documentType": "CONTRACT",
            "conditions": [
                {
                    "type": "REQUIRED_ROLES",
                    "items": [
                        "AGENT",
                        "CONTRACTOR",
                        "SENIOR_CONTRACTOR"
                    ]
                },
                {
                    "type": "REQUIRED_STATES",
                    "items": [
                        "AGENT_SIGNING",
                        "CONTRACTOR_ADJUSTMENT"
                    ]
                }
            ],
            "signatories": {
                "CUSTOMER": {
                    "signingType": "HANDWRITTEN",
                    "requiredStates": [
                        "CUSTOMER_SIGNING"
                    ]
                }
            }
        },
        {
            "id": "AGREEMENT_EXPORT",
            "title": {
                "ru": "Договор",
                "en": ""
            },
            "templateId": "AGREEMENT_EXPORT",
            "fileType": "AGREEMENT",
            "documentType": "CONTRACT",
            "conditions": [
                {
                    "type": "REQUIRED_ROLES",
                    "items": [
                        "AGENT",
                        "CONTRACTOR",
                        "SENIOR_CONTRACTOR"
                    ]
                },
                {
                    "type": "REQUIRED_STATES",
                    "items": [
                        "AGENT_SIGNING",
                        "CONTRACTOR_ADJUSTMENT"
                    ]
                }
            ],
            "signatories": {
                "CUSTOMER": {
                    "signingType": "HANDWRITTEN",
                    "requiredStates": [
                        "CUSTOMER_SIGNING"
                    ]
                }
            }
        },
        {
            "id": "ADDITIONAL_AGREEMENT_EDI",
            "title": {
                "ru": "Дополнительное соглашение ЭДО",
                "en": ""
            },
            "templateId": "ADDITIONAL_AGREEMENT_EDI",
            "fileType": "ADDITIONAL_AGREEMENT",
            "documentType": "ADDITIONAL_AGREEMENT",
            "signatories": {
                "CUSTOMER": {
                    "signingType": "HANDWRITTEN",
                    "requiredStates": [
                        "CUSTOMER_SIGNING"
                    ]
                }
            }
        },
        {
            "id": "REFUND_NOTIFICATION",
            "title": {
                "ru": "Уведомление о возврате",
                "en": ""
            },
            "templateId": "REFUND_NOTIFICATION",
            "fileType": "OTHER",
            "documentType": "COMPLAINT",
            "conditions": [
                {
                    "type": "REQUIRED_ROLES",
                    "items": [
                        "AGENT",
                        "CONTRACTOR",
                        "SENIOR_CONTRACTOR"
                    ]
                },
                {
                    "type": "REQUIRED_STATES",
                    "items": [
                        "ACTIVE"
                    ]
                }
            ]
        },
        {
            "id": "INSTRUCTION_IMPORT",
            "title": {
                "ru": "Поручение субагенту",
                "en": ""
            },
            "templateId": "INSTRUCTION_IMPORT",
            "fileType": "INSTRUCTION",
            "documentType": "ORDER",
            "documentDelimiter": "IMPORT",
            "conditions": [
                {
                    "type": "REQUIRED_ROLES",
                    "items": [
                        "AGENT",
                        "CONTRACTOR",
                        "SENIOR_CONTRACTOR"
                    ]
                },
                {
                    "type": "REQUIRED_STATES",
                    "items": [
                        "DOCUMENTS_COLLECTING"
                    ]
                },
                {
                    "type": "REQUIRED_FIELDS",
                    "items": [
                        "subagent",
                        "subsidiary",
                        "subsidiaryBankAccount"
                    ],
                    "errorText": {
                        "ru": "Заполните обязательные поля",
                        "en": ""
                    }
                }
            ]
        }
    ]
}