<!-- (C) 2020 - FreightTrust and Clearing Corporation
   - SPDX-License-Identifier: MPL-2.0
   - SPDXVersion: SPDX-2.2
   - SPDX-FileCopyrightText
   - This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<xs:schema
    targetNamespace="http://www.freighttrust.com/Schemas/Universal/2020/09"
    version="1.1"
    elementFormDefault="qualified"
    xmlns="http://www.freighttrust.com/Schemas/Universal/2020/09"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
  <xs:include schemaLocation="UniversalCommon.xsd" />
  <xs:include schemaLocation="UniversalTransaction.xsd" />

  <xs:element name="UniversalTransactionBatch" type="UniversalTransactionBatchData" />

  <xs:complexType name="UniversalTransactionBatchData">
    <xs:all>
      <xs:element name="TransactionBatch" type="TransactionBatch" />
    </xs:all>
    <xs:attribute name="version" type="xs:token" />
  </xs:complexType>

  <xs:complexType name="TransactionBatch">
    <xs:all>
      <xs:element name="BatchType" minOccurs="0" type="CodeDescriptionPair" />
      <xs:element name="DataContext" minOccurs="0" type="DataContext" />
      <xs:element name="DateFrom" minOccurs="0" type="emptiable_dateTime" />
      <xs:element name="DateTo" minOccurs="0" type="emptiable_dateTime" />
      <xs:element name="Periodicity" minOccurs="0" type="CodeDescriptionPair" />

      <xs:element name="OrganizationAddressCollection" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="OrganizationAddress" minOccurs="0" maxOccurs="unbounded" type="OrganizationAddress" />
          </xs:sequence>
        </xs:complexType>
      </xs:element>

      <xs:element name="TransactionCollection" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Transaction" minOccurs="0" maxOccurs="unbounded" type="TransactionInfo" />
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:all>
  </xs:complexType>

</xs:schema>
