<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="portal-mapintegration"
           xmlns:pmi="portal-mapintegration"
           elementFormDefault="qualified">

    <xs:annotation>
        <xs:documentation xml:lang="ru">
            **Формирование имени выгружаемого файла**

            - Текущие дата и время в формате yyyyMMddHHmmss (год, месяц, день, час, минуты, секунды);
            - код клиента (clentID);
            - идентификатор выгружаемой инициативы.

            Например, `20180426135530_292_1164.xml`- файл с инициативой 1164, сформированный 26 апреля 2018 года в
            13:55:30 для клиента с clientID = 292.
        </xs:documentation>
    </xs:annotation>

    <xs:simpleType name="marketing_action_type" final="restriction">
        <xs:annotation>
            <xs:documentation>
                Код типа инициативы

                - PREVENT_STOCKOUT - Бездефектурное наличие
                - PROCUREMENT_PLAN - План по закупке
                - PROCUREMENT_PLAN_MONETARY - План по закупке в суммах
                - SALES_PLAN - План по продаже
                - SALES_PLAN_MONETARY - План по продаже в суммах
                - PRIORITY_SALE - Допродажа
                - MANDATORY_MATRIX - Обязательная матрица
                - RECOMMENDED_GOODS - Рекомендованный товар
                - PRODUCT_OF_THE_DAY - Товар дня
                - PRIVATE_LABEL - УСТМ
                - PHARMACIST_MOTIVATION - Дополнительный бонус за продажу
                - PROCUREMENT - Закупка
                - PROCUREMENT - Закупка месяц
                - DISCOUNT_COMPENSATION - Компенсация скидки
                - SHOWCASE - Выкладка
                - MATRIX_PLUS - Матрица+ квартал
                - MATRIX_PLUS_MONTH - Матрица+ месяц
                - ESTABLISHED_ORDER - Постановочный заказ
                - PROCUREMENT_USTM - Закупка УСТМ Пульс квартал
                - PROCUREMENT_USTM_MONTH - Закупка УСТМ Пульс месяц
                - IMPULSE_ACTION - Импульсная акция пакетная
                - IMPULSE_ACTION_SINGLETON - Импульсная акция
                - PROCUREMENT_GROUPING_USTM - Закупка групповая УСТМ/СТМ ПУЛЬС
            </xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:enumeration value="PREVENT_STOCKOUT"/>
            <xs:enumeration value="PROCUREMENT_PLAN"/>
            <xs:enumeration value="PROCUREMENT_PLAN_MONETARY"/>
            <xs:enumeration value="SALES_PLAN"/>
            <xs:enumeration value="SALES_PLAN_MONETARY"/>
            <xs:enumeration value="PRIORITY_SALE"/>
            <xs:enumeration value="MANDATORY_MATRIX"/>
            <xs:enumeration value="RECOMMENDED_GOODS"/>
            <xs:enumeration value="PRODUCT_OF_THE_DAY"/>
            <xs:enumeration value="PRIVATE_LABEL"/>
            <xs:enumeration value="PHARMACIST_MOTIVATION"/>
            <xs:enumeration value="PROCUREMENT"/>
            <xs:enumeration value="PROCUREMENT_MONTH"/>
            <xs:enumeration value="DISCOUNT_COMPENSATION"/>
            <xs:enumeration value="SHOWCASE"/>
            <xs:enumeration value="ESTABLISHED_ORDER"/>
            <xs:enumeration value="PROCUREMENT_USTM"/>
            <xs:enumeration value="PROCUREMENT_USTM_MONTH"/>
            <xs:enumeration value="MATRIX_PLUS"/>
            <xs:enumeration value="MATRIX_PLUS_MONTH"/>
            <xs:enumeration value="IMPULSE_ACTION"/>
            <xs:enumeration value="IMPULSE_ACTION_SINGLETON"/>
            <xs:enumeration value="PROCUREMENT_GROUPING_USTM"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="marketing_action_data_type" abstract="true"/>
    <xs:complexType name="product_data_type" abstract="true"/>

    <xs:complexType name="marketing_action_data_prevent_stockout">
        <xs:annotation>
            <xs:documentation>
                Свойства инициативы соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_prevent_stockout">
        <xs:annotation>
            <xs:documentation>
                Свойства промотовара в инициативе соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:sequence>
                    <xs:element name="quantity" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Бездефектурное количество
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="optima_settings" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                Настройки для использования в программе заказов
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Mandatory matrix -->
    <xs:complexType name="marketing_action_data_mandatory_matrix">
        <xs:annotation>
            <xs:documentation>
                Свойства инициативы соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
                <xs:sequence>
                    <xs:element name="threshold_percent" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Коэффициент для смягчения условий
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>

                    <xs:element name="remuneration_lists">
                        <xs:annotation>
                            <xs:documentation>
                                Список таблиц вознаграждений
                            </xs:documentation>
                        </xs:annotation>
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="remuneration_list" maxOccurs="unbounded">
                                    <xs:complexType>
                                        <xs:sequence>
                                            <xs:element name="id" type="xs:long">
                                                <xs:annotation>
                                                    <xs:documentation>
                                                        ID списка
                                                    </xs:documentation>
                                                </xs:annotation>
                                            </xs:element>
                                            <xs:element name="proplines">
                                                <xs:annotation>
                                                    <xs:documentation>
                                                        Для расчета вознаграждения: при выполнении плана на ...
                                                        процентов будет начислено ... бонусов
                                                    </xs:documentation>
                                                </xs:annotation>
                                                <xs:complexType>
                                                    <xs:sequence>
                                                        <xs:element name="propline"
                                                                    maxOccurs="unbounded">
                                                            <xs:complexType>
                                                                <xs:sequence>
                                                                    <xs:element name="percent"
                                                                                type="xs:decimal"/>
                                                                    <xs:element name="remuneration_percent"
                                                                                type="xs:decimal"/>
                                                                </xs:sequence>
                                                            </xs:complexType>
                                                        </xs:element>
                                                    </xs:sequence>
                                                </xs:complexType>
                                            </xs:element>
                                        </xs:sequence>
                                    </xs:complexType>
                                </xs:element>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_mandatory_matrix">
        <xs:annotation>
            <xs:documentation>
                Свойства промотовара в инициативе соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:all>
                    <xs:element name="quantity" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Бездефектурное количество
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="nominal_price" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Цена для расчёта выполнения плана (факт рассчитывается по формуле: целое количество
                                упаковок * указанную тут цену)
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="optima_settings" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                Настройки для использования в программе заказов
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <!-- Enumeration of possible calculation types -->
                    <xs:element name="calculation_type">
                        <xs:annotation>
                            <xs:documentation>
                                Показатель, используемый при вычислении суммы вознаграждения: продажи или закупки
                            </xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                            <xs:restriction base="xs:string">
                                <xs:enumeration value="SALES"/>
                                <xs:enumeration value="PROCUREMENT"/>
                            </xs:restriction>
                        </xs:simpleType>
                    </xs:element>
                    <xs:element name="remunerations_table" type="xs:long">
                        <xs:annotation>
                            <xs:documentation>
                                Номер таблицы вознаграждений для данного промотовара
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:all>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Recommended goods -->
    <xs:complexType name="marketing_action_data_recommended_goods">
        <xs:annotation>
            <xs:documentation>
                Свойства инициативы соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_recommended_goods">
        <xs:annotation>
            <xs:documentation>
                Свойства промотовара в инициативе соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:all>
                    <xs:element name="quantity" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Рекомендованное количество товара
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="nominal_price" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Цена для расчёта выполнения плана (факт рассчитывается по формуле: целое количество
                                упаковок * указанную тут цену)
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="optima_settings" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                Настройки для использования в программе заказов
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <!-- Enumeration of possible calculation types -->
                    <xs:element name="calculation_type">
                        <xs:annotation>
                            <xs:documentation>
                                Показатель, используемый при вычислении суммы вознаграждения: продажи или закупки
                            </xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                            <xs:restriction base="xs:string">
                                <xs:enumeration value="SALES"/>
                                <xs:enumeration value="PROCUREMENT"/>
                            </xs:restriction>
                        </xs:simpleType>
                    </xs:element>
                    <xs:element name="remuneration_percent" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Процент вознаграждения
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:all>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Procurement -->
    <xs:complexType name="marketing_action_data_procurement">
        <xs:annotation>
            <xs:documentation>
                Свойства инициативы соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_procurement">
        <xs:annotation>
            <xs:documentation>
                Свойства промотовара в инициативе соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:all>
                    <xs:element name="nominal_price" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Цена для расчёта выполнения плана (факт рассчитывается по формуле: целое количество
                                упаковок * указанную тут цену)
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="optima_settings" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                Настройки для использования в программе заказов
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="remuneration_percent" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Процент вознаграждения
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="procurement_plan" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                План шт.упаковок
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:all>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Procurement month -->
    <xs:complexType name="marketing_action_data_procurement_month">
        <xs:annotation>
            <xs:documentation>
                Свойства инициативы соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_procurement_month">
        <xs:annotation>
            <xs:documentation>
                Свойства промотовара в инициативе соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:all>
                    <xs:element name="nominal_price" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Цена для расчёта выполнения плана (факт рассчитывается по формуле: целое количество
                                упаковок * указанную тут цену)
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="optima_settings" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                Настройки для использования в программе заказов
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="remuneration_percent" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Процент вознаграждения
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="procurement_plan" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                План шт.упаковок
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:all>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Established order -->
    <xs:complexType name="marketing_action_data_established_order">
        <xs:annotation>
            <xs:documentation>
                Свойства инициативы соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_established_order">
        <xs:annotation>
            <xs:documentation>
                Свойства промотовара в инициативе соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:all>
                    <xs:element name="nominal_price" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Цена для расчёта выполнения плана (факт рассчитывается по формуле: целое количество
                                упаковок * указанную тут цену)
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="optima_settings" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                Настройки для использования в программе заказов
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="points" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Вознаграждение (фиксированное, при выполнении всех условий инициативы)
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="procurement_plan" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                План по закупкам для каждого промотовара и каждой категории аптеки (шт.упаковок)
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:all>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Procurement ustm -->
    <xs:complexType name="marketing_action_data_procurement_ustm">
        <xs:annotation>
            <xs:documentation>
                Свойства инициативы соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_procurement_ustm">
        <xs:annotation>
            <xs:documentation>
                Свойства промотовара в инициативе соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:all>
                    <xs:element name="nominal_price" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Цена для расчёта выполнения плана (факт рассчитывается по формуле: целое количество
                                упаковок * указанную тут цену)
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="optima_settings" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                Настройки для использования в программе заказов
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="remuneration_percent" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Процент вознаграждения
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="procurement_plan" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                План шт.упаковок
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:all>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Procurement ustm month -->
    <xs:complexType name="marketing_action_data_procurement_ustm_month">
        <xs:annotation>
            <xs:documentation>
                Свойства инициативы соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_procurement_ustm_month">
        <xs:annotation>
            <xs:documentation>
                Свойства промотовара в инициативе соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:all>
                    <xs:element name="nominal_price" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Цена для расчёта выполнения плана (факт рассчитывается по формуле: целое количество
                                упаковок * указанную тут цену)
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="optima_settings" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                Настройки для использования в программе заказов
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="remuneration_percent" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Процент вознаграждения
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="procurement_plan" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                План шт.упаковок
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:all>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Product of the day -->
    <xs:complexType name="marketing_action_data_product_of_the_day">
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_product_of_the_day">
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:sequence>
                    <xs:element name="quantity" type="xs:decimal"/>
                    <xs:element name="points" type="xs:decimal"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Discount compensation -->
    <xs:complexType name="marketing_action_data_discount_compensation">
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_discount_compensation">
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:sequence>
                    <xs:element name="discount" type="xs:decimal"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Private label -->
    <xs:complexType name="marketing_action_data_private_label">
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_private_label">
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:sequence>
                    <xs:element name="quantity" type="xs:decimal"/>
                    <xs:element name="points" type="xs:decimal"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Pharmacist motivation -->
    <xs:complexType name="marketing_action_data_pharmacist_motivation">
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_pharmacist_motivation">
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:sequence>
                    <xs:element name="quantity" type="xs:decimal"/>
                    <xs:element name="points" type="xs:decimal"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Procurement plan -->
    <xs:complexType name="marketing_action_data_procurement_plan">
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
                <xs:sequence>
                    <xs:element name="propline" maxOccurs="unbounded">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="percent" type="xs:decimal"/>
                                <xs:element name="bonus" type="xs:decimal"/>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_procurement_plan">
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:sequence>
                    <xs:element name="quantity" type="xs:decimal"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Procurement plan monetary -->
    <xs:complexType name="marketing_action_data_procurement_plan_monetary">
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
                <xs:sequence>
                    <xs:element name="monetary_amount" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Плановая сумма по инициативе
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="proplines">
                        <xs:annotation>
                            <xs:documentation>
                                Для расчета вознаграждения: при выполнении плана на ... процентов будет начислено ...
                                бонусов
                            </xs:documentation>
                        </xs:annotation>
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="propline" maxOccurs="unbounded">
                                    <xs:complexType>
                                        <xs:sequence>
                                            <xs:element name="percent" type="xs:decimal"/>
                                            <xs:element name="bonus" type="xs:decimal"/>
                                        </xs:sequence>
                                    </xs:complexType>
                                </xs:element>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_procurement_plan_monetary">
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:sequence>
                    <xs:element name="nominal_price" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Цена для расчёта выполнения плана (факт рассчитывается по формуле: целое количество
                                упаковок * указанную тут цену)
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Sales plan -->
    <xs:complexType name="marketing_action_data_sales_plan">
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
                <xs:sequence>
                    <xs:element name="propline" maxOccurs="unbounded">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="percent" type="xs:decimal"/>
                                <xs:element name="bonus" type="xs:decimal"/>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_sales_plan">
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:sequence>
                    <xs:element name="quantity" type="xs:decimal"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Sales plan monetary -->
    <xs:complexType name="marketing_action_data_sales_plan_monetary">
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
                <xs:sequence>
                    <xs:element name="monetary_amount" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Целевая сумма
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="proplines">
                        <xs:annotation>
                            <xs:documentation>
                                Для расчета вознаграждения: при выполнении плана на ... процентов будет начислено ...
                                бонусов
                            </xs:documentation>
                        </xs:annotation>
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="propline" maxOccurs="unbounded">
                                    <xs:complexType>
                                        <xs:sequence>
                                            <xs:element name="percent" type="xs:decimal"/>
                                            <xs:element name="bonus" type="xs:decimal"/>
                                        </xs:sequence>
                                    </xs:complexType>
                                </xs:element>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_sales_plan_monetary">
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:all>
                    <xs:element name="nominal_price" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Цена для расчёта выполнения плана (факт рассчитывается по формуле: целое количество
                                упаковок * указанную тут цену)
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="points" type="xs:decimal"/>
                </xs:all>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Priority sale -->
    <xs:complexType name="marketing_action_data_priority_sale">
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_priority_sale">
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:sequence>
                    <xs:element name="chips" type="xs:integer"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Showcase -->
    <xs:complexType name="marketing_action_data_showcase">
        <xs:annotation>
            <xs:documentation>
                Свойства инициативы соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
                <xs:sequence>
                    <xs:element name="special_condition" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                Условие выкладки
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>

                    <xs:element name="remuneration_lists">
                        <xs:annotation>
                            <xs:documentation>
                                Список таблиц вознаграждений
                            </xs:documentation>
                        </xs:annotation>
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="remuneration_list" maxOccurs="unbounded">
                                    <xs:complexType>
                                        <xs:sequence>
                                            <xs:element name="id" type="xs:long">
                                                <xs:annotation>
                                                    <xs:documentation>
                                                        ID списка
                                                    </xs:documentation>
                                                </xs:annotation>
                                            </xs:element>
                                            <xs:element name="proplines">
                                                <xs:annotation>
                                                    <xs:documentation>
                                                        Для расчета вознаграждения: при выполнении плана на ...
                                                        процентов будет начислено ... бонусов
                                                    </xs:documentation>
                                                </xs:annotation>
                                                <xs:complexType>
                                                    <xs:sequence>
                                                        <xs:element name="propline"
                                                                    maxOccurs="unbounded">
                                                            <xs:complexType>
                                                                <xs:sequence>
                                                                    <xs:element name="percent"
                                                                                type="xs:decimal"/>
                                                                    <xs:element name="remuneration_percent"
                                                                                type="xs:decimal"/>
                                                                </xs:sequence>
                                                            </xs:complexType>
                                                        </xs:element>
                                                    </xs:sequence>
                                                </xs:complexType>
                                            </xs:element>
                                        </xs:sequence>
                                    </xs:complexType>
                                </xs:element>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_showcase">
        <xs:annotation>
            <xs:documentation>
                Свойства промотовара в инициативе соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:all>
                    <xs:element name="nominal_price" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                СИП-цена
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="remunerations_table" type="xs:long">
                        <xs:annotation>
                            <xs:documentation>
                                Номер таблицы вознаграждений для данного промотовара
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:all>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Procurement Amount -->
    <xs:complexType name="marketing_action_data_matrix_plus">
        <xs:annotation>
            <xs:documentation>
                Свойства инициативы соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
                <xs:all>
                    <xs:element name="remuneration_percents">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="remuneration_percent" maxOccurs="unbounded">
                                    <xs:complexType>
                                        <xs:annotation>
                                            <xs:documentation>
                                                Процент вознаграждения для Плана 1, 2, 3
                                            </xs:documentation>
                                        </xs:annotation>
                                        <xs:simpleContent>
                                            <xs:extension base="xs:string">
                                                <xs:attribute name="plan_number" type="xs:string"/>
                                            </xs:extension>
                                        </xs:simpleContent>
                                    </xs:complexType>
                                </xs:element>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                </xs:all>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_matrix_plus">
        <xs:annotation>
            <xs:documentation>
                Свойства промотовара в инициативе соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:all>
                    <xs:element name="nominal_price" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Цена для расчёта выполнения плана
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="optima_settings" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                Настройки для использования в программе заказов
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:all>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Procurement Amount Month -->
    <xs:complexType name="marketing_action_data_matrix_plus_month">
        <xs:annotation>
            <xs:documentation>
                Свойства инициативы соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
                <xs:all>
                    <xs:element name="remuneration_percents">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="remuneration_percent" maxOccurs="unbounded">
                                    <xs:complexType>
                                        <xs:annotation>
                                            <xs:documentation>
                                                Процент вознаграждения для Плана 1, 2, 3
                                            </xs:documentation>
                                        </xs:annotation>
                                        <xs:simpleContent>
                                            <xs:extension base="xs:string">
                                                <xs:attribute name="plan_number" type="xs:string"/>
                                            </xs:extension>
                                        </xs:simpleContent>
                                    </xs:complexType>
                                </xs:element>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                </xs:all>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_matrix_plus_month">
        <xs:annotation>
            <xs:documentation>
                Свойства промотовара в инициативе соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:all>
                    <xs:element name="nominal_price" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Цена для расчёта выполнения плана
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="optima_settings" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                Настройки для использования в программе заказов
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:all>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Impulse action -->
    <xs:complexType name="marketing_action_data_impulse_action">
        <xs:annotation>
            <xs:documentation>
                Свойства инициативы соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_impulse_action">
        <xs:annotation>
            <xs:documentation>
                Свойства промотовара в инициативе соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:all>
                    <xs:element name="nominal_price" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Цена для расчёта выполнения плана (факт рассчитывается по формуле: целое количество
                                упаковок * указанную тут цену)
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="optima_settings" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                Настройки для использования в программе заказов
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="remuneration_percent" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Процент вознаграждения
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="procurement_plan" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                План шт.упаковок
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:all>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Impulse action singleton -->
    <xs:complexType name="marketing_action_data_impulse_action_singleton">
        <xs:annotation>
            <xs:documentation>
                Свойства инициативы соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_impulse_action_singleton">
        <xs:annotation>
            <xs:documentation>
                Свойства промотовара в инициативе соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:all>
                    <xs:element name="nominal_price" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Цена для расчёта выполнения плана (факт рассчитывается по формуле: целое количество
                                упаковок * указанную тут цену)
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="optima_settings" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                Настройки для использования в программе заказов
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="remuneration_percent" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Процент вознаграждения
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="procurement_plan" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                План шт.упаковок
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:all>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Procurement grouping ustm -->
    <xs:complexType name="marketing_action_data_procurement_grouping_ustm">
        <xs:annotation>
            <xs:documentation>
                Свойства инициативы соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:marketing_action_data_type">
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="product_data_procurement_grouping_ustm">
        <xs:annotation>
            <xs:documentation>
                Свойства промотовара в инициативе соответствующего типа
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="pmi:product_data_type">
                <xs:all>
                    <xs:element name="nominal_price" type="xs:decimal">
                        <xs:annotation>
                            <xs:documentation>
                                Цена для расчёта выполнения плана
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="optima_settings" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>
                                Настройки для использования в программе заказов
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="remuneration_percents">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="remuneration_percent" maxOccurs="unbounded">
                                    <xs:complexType>
                                        <xs:annotation>
                                            <xs:documentation>
                                                Процент вознаграждения для Плана 1, 2, 3, 4
                                            </xs:documentation>
                                        </xs:annotation>
                                        <xs:simpleContent>
                                            <xs:extension base="xs:string">
                                                <xs:attribute name="plan_number" type="xs:string"/>
                                            </xs:extension>
                                        </xs:simpleContent>
                                    </xs:complexType>
                                </xs:element>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                </xs:all>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- root element -->
    <xs:element name="fe-actions">

        <xs:complexType>
            <xs:sequence>

                <xs:element name="data_version" type="xs:integer">
                    <xs:annotation>
                        <xs:documentation>
                            Версия формата данных. Инкрементируется Созвездием при внесении обратно несовместимых
                            изменений в структуру файла.
                        </xs:documentation>
                    </xs:annotation>
                </xs:element>

                <xs:element name="marketing_actions">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="marketing_action">
                                <xs:complexType>
                                    <xs:all>
                                        <xs:element name="marketing_action_id" type="xs:long">
                                            <xs:annotation>
                                                <xs:documentation>Идентификатор инициативы в портале</xs:documentation>
                                            </xs:annotation>
                                        </xs:element>
                                        <xs:element name="marketing_action_name" type="xs:string">
                                            <xs:annotation>
                                                <xs:documentation>Наименование инициативы</xs:documentation>
                                            </xs:annotation>
                                        </xs:element>
                                        <xs:element name="marketing_action_type" type="pmi:marketing_action_type">
                                            <xs:annotation>
                                                <xs:documentation>Тип инициативы</xs:documentation>
                                            </xs:annotation>
                                        </xs:element>
                                        <xs:element name="date_start" type="xs:date">
                                            <xs:annotation>
                                                <xs:documentation>Дата начала действия инициативы</xs:documentation>
                                            </xs:annotation>
                                        </xs:element>
                                        <xs:element name="date_end" type="xs:date" nillable="true" minOccurs="0">
                                            <xs:annotation>
                                                <xs:documentation>
                                                    Дата окончания действия

                                                    Если дата не задана (акция бессрочная), тег date_end будет пропущен
                                                </xs:documentation>
                                            </xs:annotation>
                                        </xs:element>
                                        <xs:element name="state" type="xs:integer">
                                            <xs:annotation>
                                                <xs:documentation>
                                                    Состояние
                                                    0 - действующая
                                                    1 - закрыта
                                                </xs:documentation>
                                            </xs:annotation>
                                        </xs:element>

                                        <xs:element name="marketing_action_data" type="pmi:marketing_action_data_type"/>

                                        <xs:element name="products">
                                            <xs:annotation>
                                                <xs:documentation>
                                                    Список акционных товаров (промотовары)
                                                </xs:documentation>
                                            </xs:annotation>
                                            <xs:complexType>
                                                <xs:sequence>

                                                    <xs:element name="product" maxOccurs="unbounded">
                                                        <xs:complexType>
                                                            <xs:all>
                                                                <xs:element name="product_id" type="xs:string">
                                                                    <xs:annotation>
                                                                        <xs:documentation>
                                                                            Идентификатор акционного товара
                                                                        </xs:documentation>
                                                                    </xs:annotation>
                                                                </xs:element>
                                                                <xs:element name="product_name" type="xs:string">
                                                                    <xs:annotation>
                                                                        <xs:documentation>
                                                                            Идентификатор акционного товара
                                                                        </xs:documentation>
                                                                    </xs:annotation>
                                                                </xs:element>
                                                                <xs:element name="description" type="xs:string">
                                                                    <xs:annotation>
                                                                        <xs:documentation>
                                                                            Описание

                                                                            На данный момент в это поле записывается
                                                                            наименование контрактодержателя
                                                                        </xs:documentation>
                                                                    </xs:annotation>
                                                                </xs:element>

                                                                <xs:element name="product_data"
                                                                            type="pmi:product_data_type">
                                                                    <xs:annotation>
                                                                        <xs:documentation>
                                                                            Свойства акционного товара. Для каждого типа
                                                                            инициатив свой.
                                                                        </xs:documentation>
                                                                    </xs:annotation>
                                                                </xs:element>

                                                                <xs:element name="nomenclatures">
                                                                    <xs:annotation>
                                                                        <xs:documentation>
                                                                            Список номенклатур акционного товара с
                                                                            параметрами.
                                                                        </xs:documentation>
                                                                    </xs:annotation>
                                                                    <xs:complexType>
                                                                        <xs:sequence>
                                                                            <xs:element name="nomenclature"
                                                                                        maxOccurs="unbounded">
                                                                                <xs:complexType>
                                                                                    <xs:all>
                                                                                        <xs:element
                                                                                                name="nomenclature_id"
                                                                                                type="xs:long">
                                                                                            <xs:annotation>
                                                                                                <xs:documentation>
                                                                                                    Код номенклатуры
                                                                                                    ФармЭталон
                                                                                                </xs:documentation>
                                                                                            </xs:annotation>
                                                                                        </xs:element>
                                                                                        <xs:element
                                                                                                name="nomenclature_name"
                                                                                                type="xs:string">
                                                                                            <xs:annotation>
                                                                                                <xs:documentation>
                                                                                                    Наименование
                                                                                                    номенклатуры
                                                                                                    ФармЭталон
                                                                                                </xs:documentation>
                                                                                            </xs:annotation>
                                                                                        </xs:element>
                                                                                        <xs:element
                                                                                                name="map_nomenclature_code"
                                                                                                type="xs:string">
                                                                                            <xs:annotation>
                                                                                                <xs:documentation>
                                                                                                    Код номенклатуры в
                                                                                                    учётной системе
                                                                                                </xs:documentation>
                                                                                            </xs:annotation>
                                                                                        </xs:element>
                                                                                        <xs:element
                                                                                                name="map_producer_code"
                                                                                                type="xs:string">
                                                                                            <xs:annotation>
                                                                                                <xs:documentation>
                                                                                                    Код производителя в
                                                                                                    учётной системе
                                                                                                </xs:documentation>
                                                                                            </xs:annotation>
                                                                                        </xs:element>
                                                                                        <xs:element
                                                                                                name="map_producer_country_code"
                                                                                                type="xs:string">
                                                                                            <xs:annotation>
                                                                                                <xs:documentation>
                                                                                                    Код страны в учётной
                                                                                                    системе
                                                                                                </xs:documentation>
                                                                                            </xs:annotation>
                                                                                        </xs:element>
                                                                                        <xs:element
                                                                                                name="nomenclature_barcodes"
                                                                                                type="xs:string">
                                                                                            <xs:annotation>
                                                                                                <xs:documentation>
                                                                                                    ЗШК. Заводской
                                                                                                    штрих-код. Может
                                                                                                    быть список через
                                                                                                    запятую
                                                                                                </xs:documentation>
                                                                                            </xs:annotation>
                                                                                        </xs:element>
                                                                                    </xs:all>
                                                                                </xs:complexType>
                                                                            </xs:element>
                                                                        </xs:sequence>
                                                                    </xs:complexType>
                                                                </xs:element>

                                                                <xs:element name="suppliers">
                                                                    <xs:annotation>
                                                                        <xs:documentation>
                                                                            Список поставщиков (при наличии - в
                                                                            инициативу входят только товары, закупленные
                                                                            у указанных поставщиков)
                                                                        </xs:documentation>
                                                                    </xs:annotation>
                                                                    <xs:complexType>
                                                                        <xs:sequence>
                                                                            <xs:element name="supplier" minOccurs="0"
                                                                                        maxOccurs="unbounded">
                                                                                <xs:complexType>
                                                                                    <xs:sequence>
                                                                                        <xs:element name="tin"
                                                                                                    type="xs:string">
                                                                                            <xs:annotation>
                                                                                                <xs:documentation>
                                                                                                    ИНН поставщика
                                                                                                </xs:documentation>
                                                                                            </xs:annotation>
                                                                                        </xs:element>
                                                                                        <xs:element name="id"
                                                                                                    type="xs:long">
                                                                                            <xs:annotation>
                                                                                                <xs:documentation>
                                                                                                    ID поставщика в
                                                                                                    Созвездии
                                                                                                </xs:documentation>
                                                                                            </xs:annotation>
                                                                                        </xs:element>
                                                                                        <xs:element name="name"
                                                                                                    type="xs:string">
                                                                                            <xs:annotation>
                                                                                                <xs:documentation>
                                                                                                    Наименование
                                                                                                    поставщика в
                                                                                                    Созвездии
                                                                                                </xs:documentation>
                                                                                            </xs:annotation>
                                                                                        </xs:element>
                                                                                        <xs:element name="map_code"
                                                                                                    type="xs:string">
                                                                                            <xs:annotation>
                                                                                                <xs:documentation>
                                                                                                    Код поставщика в
                                                                                                    учётной системе
                                                                                                </xs:documentation>
                                                                                            </xs:annotation>
                                                                                        </xs:element>
                                                                                    </xs:sequence>
                                                                                </xs:complexType>
                                                                            </xs:element>
                                                                        </xs:sequence>
                                                                    </xs:complexType>
                                                                </xs:element>

                                                            </xs:all>
                                                        </xs:complexType>
                                                    </xs:element>

                                                </xs:sequence>
                                            </xs:complexType>
                                        </xs:element>

                                        <xs:element name="map_pharmacy_ids"
                                                    nillable="true">
                                            <xs:complexType>
                                                <xs:annotation>
                                                    <xs:documentation>
                                                        Список кодов подразделений, для которых предназначена инициатива
                                                    </xs:documentation>
                                                </xs:annotation>
                                                <xs:sequence>
                                                    <xs:element name="map_pharmacy_id" type="xs:string"
                                                                minOccurs="0"
                                                                maxOccurs="unbounded">
                                                        <xs:annotation>
                                                            <xs:documentation>
                                                                Код аптеки (подразделения) в учётной системе
                                                            </xs:documentation>
                                                        </xs:annotation>
                                                    </xs:element>
                                                </xs:sequence>
                                            </xs:complexType>
                                        </xs:element>

                                        <xs:element name="pharmacies_data"
                                                    minOccurs="0">
                                            <xs:complexType>
                                                <xs:annotation>
                                                    <xs:documentation>
                                                        Условия для конкретных аптек
                                                    </xs:documentation>
                                                </xs:annotation>
                                                <xs:sequence>
                                                    <xs:element name="pharmacy"
                                                                minOccurs="0"
                                                                maxOccurs="unbounded">
                                                        <xs:complexType>
                                                            <xs:sequence>
                                                                <xs:element name="pharmacy_id" type="xs:string" />
                                                                <xs:element name="procurement_plans">
                                                                    <xs:complexType>
                                                                        <xs:sequence>
                                                                            <xs:element name="procurement_plan_amount" maxOccurs="unbounded">
                                                                                <xs:complexType>
                                                                                    <xs:annotation>
                                                                                        <xs:documentation>
                                                                                            План по закупкам для каждой аптеки (в СИП-ценах)
                                                                                        </xs:documentation>
                                                                                    </xs:annotation>
                                                                                    <xs:simpleContent>
                                                                                        <xs:extension base="xs:string">
                                                                                            <xs:attribute name="plan_number" type="xs:string"/>
                                                                                        </xs:extension>
                                                                                    </xs:simpleContent>
                                                                                </xs:complexType>
                                                                            </xs:element>
                                                                        </xs:sequence>
                                                                    </xs:complexType>
                                                                </xs:element>
                                                            </xs:sequence>
                                                        </xs:complexType>
                                                    </xs:element>
                                                </xs:sequence>
                                            </xs:complexType>

                                        </xs:element>
                                    </xs:all>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>

            </xs:sequence>

            <!-- Свойство для транспорта -->
            <xs:attribute name="client_id" type="xs:string" use="required">
                <xs:annotation>
                    <xs:documentation>
                        Код клиента, предоставляется Созвездием
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

</xs:schema>