<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.00"
           xmlns:emcs="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:EMCS:V2.02"
           xmlns:ddtypes="http://www.mf.gov.pl/schematy/EDD/DDTYPES/2020/05/"
           xmlns:tms="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:TMS:V2.02"
           xmlns:tcl="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:TCL:V2.02"
           xmlns:doc="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:DOC:V2.02"
           xmlns:dd817="http://www.mf.gov.pl/schematy/EDD/DD817/2020/05/"
           targetNamespace="http://www.mf.gov.pl/schematy/EDD/DD817/2020/05/">
  <!--=============================================-->
  <!--=====              DD817                =====-->
  <!--===== Powiadomienie o przybyciu wyrobów =====-->
  <!--=============================================-->

  <!--===== Imports =====-->
  <xs:import namespace="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:EMCS:V2.02" schemaLocation="types.xsd" />
  <xs:import namespace="http://www.mf.gov.pl/schematy/EDD/DDTYPES/2020/05/" schemaLocation="ddTypes.xsd" />
  <xs:import namespace="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:TMS:V2.02" schemaLocation="tms.xsd" />
  <xs:import namespace="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:TCL:V2.02" schemaLocation="tcl.xsd" />
  <xs:import namespace="urn:publicid:-:EC:DGTAXUD:EMCS:PHASE3:DOC:V2.02" schemaLocation="doc.xsd" />

  <!--===== Root Element =====-->
  <xs:element name="DD817" type="dd817:DD817Type" />

  <!--===== EMCS Data Groups Declarations =====-->
  <xs:complexType name="DD817Type">
    <xs:sequence>
      <xs:element name="Header" type="tms:HeaderType" />
      <xs:element name="Body" type="dd817:BodyType" />
    </xs:sequence>
  </xs:complexType>

  <!--===== IE Specific Data Groups Declarations =====-->
  <xs:complexType name="BodyType">
    <xs:sequence>
      <xs:element name="DeliveryNotificationForDeliveryDocument" type="dd817:DeliveryNotificationForDeliveryDocumentType" />
    </xs:sequence>
  </xs:complexType>

  <!--==========================================================-->
  <!--=====  Delivery Notification For Delivery Document   =====-->
  <!--==========================================================-->
  <xs:complexType name="DeliveryNotificationForDeliveryDocumentType">
    <xs:sequence>
      <xs:element name="DocumentReference" type="ddtypes:AdministrativeReferenceType" minOccurs="1" maxOccurs="1"/>
      <xs:element name="ConsigneeTrader"   type="ddtypes:DDTraderType" minOccurs="1" maxOccurs="1" />
      <xs:element name="PlaceOfDeliveryTrader" type="ddtypes:DDTraderType" minOccurs="0" />
      <xs:element name="PlaceOfDeliveryCustomsOffice" type="ddtypes:DDCustomsOfficeType" minOccurs="1" maxOccurs="1"/>
      <xs:element name="DeliveryNotification" type="dd817:DeliveryNotificationType" />
    </xs:sequence>
  </xs:complexType>

  <!--==========================================================-->
  <!--=====              Delivery Notification             =====-->
  <!--==========================================================-->
  <xs:complexType name="DeliveryNotificationType">
    <xs:sequence>
      <xs:element name="DateAndTimeOfDelivery" type="emcs:DateTimeType" />
      <xs:element name="DeliveryInformation" type="ddtypes:LSDDDComplementaryInformation350Type" minOccurs="0"/>
      <xs:element name="SealCompromised" type="tcl:Flag" />
    </xs:sequence>
  </xs:complexType>

</xs:schema>