<!-- (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/Native/2020/09"
    version="2.0"
    elementFormDefault="qualified"
    xmlns="http://www.freighttrust.com/Schemas/Native/2020/09"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
  <xs:include schemaLocation="Native.xsd" />
  <xs:element name="CurrencyExchangeRate" type="CurrencyExchangeRateData" />
  <xs:complexType name="CurrencyExchangeRateData">
    <xs:all>
      <xs:element name="RefExchangeRate" type="NativeCurrencyExchangeRate" />
    </xs:all>
    <xs:attribute name="version" type="xs:token" />
  </xs:complexType>
  <xs:complexType name="NativeCurrencyExchangeRate">
    <xs:all>
      <xs:element name="PK" minOccurs="0" type="xs:string" />
      <xs:element name="ExRateType" minOccurs="0">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:maxLength value="3" />
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="StartDate" minOccurs="0" type="emptiableDateTime" />
      <xs:element name="ExpiryDate" minOccurs="0" type="emptiableDateTime" />
      <xs:element name="SellRate" minOccurs="0" type="xs:decimal" />
      <xs:element name="IsSystem" minOccurs="0" type="xs:boolean" />
      <xs:element name="RefCurrency" minOccurs="0">
        <xs:complexType>
          <xs:all>
            <!-- Candidate Key: Code -->
            <xs:element name="Code" minOccurs="0">
              <xs:simpleType>
                <xs:restriction base="xs:string">
                  <xs:maxLength value="3" />
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
            <xs:element name="PK" minOccurs="0" type="xs:string" />
          </xs:all>
          <xs:attribute name="Action" type="Action" />
        </xs:complexType>
      </xs:element>
      <xs:element name="Client" minOccurs="0">
        <xs:complexType>
          <xs:all>
            <!-- Candidate Key: Code -->
            <xs:element name="Code" minOccurs="0">
              <xs:simpleType>
                <xs:restriction base="xs:string">
                  <xs:maxLength value="12" />
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
            <xs:element name="PK" minOccurs="0" type="xs:string" />
          </xs:all>
          <xs:attribute name="Action" type="Action" />
          <xs:attribute name="TableName" type="xs:string" />
        </xs:complexType>
      </xs:element>
      <xs:element name="GlbCompany" minOccurs="0">
        <xs:complexType>
          <xs:all>
            <!-- Candidate Key: Code -->
            <xs:element name="Code" minOccurs="0">
              <xs:simpleType>
                <xs:restriction base="xs:string">
                  <xs:maxLength value="3" />
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
            <xs:element name="PK" minOccurs="0" type="xs:string" />
          </xs:all>
          <xs:attribute name="Action" type="Action" />
        </xs:complexType>
      </xs:element>
    </xs:all>
    <xs:attribute name="Action" type="Action" />
  </xs:complexType>
</xs:schema>
