<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ie="http://www.icisnet.gr/emcs/phase3/v2.00/gr839/ie" xmlns:emcs="http://www.icisnet.gr/emcs/phase3/v2.00/types" xmlns:tms="http://www.icisnet.gr/emcs/phase3/v2.00/tms" xmlns:tcl="http://www.icisnet.gr/emcs/phase3/v2.00/tcl" xmlns:doc="http://www.icisnet.gr/emcs/phase3/v2.00/doc" targetNamespace="http://www.icisnet.gr/emcs/phase3/v2.00/gr839/ie" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.00">
  <!--=========================================-->
  <!--===== GR839:C_GR_CUS_REJ -->
  <!--===== CUSTOMS REJECTION OF E-AD -->
  <!--=========================================-->
  <!--===== Imports =====-->
  <xs:import namespace="http://www.icisnet.gr/emcs/phase3/v2.00/types" schemaLocation="types.xsd" />
  <xs:import namespace="http://www.icisnet.gr/emcs/phase3/v2.00/tms" schemaLocation="tms.xsd" />
  <xs:import namespace="http://www.icisnet.gr/emcs/phase3/v2.00/tcl" schemaLocation="tcl.xsd" />
  <xs:import namespace="http://www.icisnet.gr/emcs/phase3/v2.00/doc" schemaLocation="doc.xsd" />
  <!--===== Root Element =====-->
  <xs:element name="GR839A" type="ie:GR839AType" />
  <!--===== EMCS Data Groups Declarations =====-->
  <xs:complexType name="GR839AType">
    <xs:sequence>
      <xs:element name="Header" type="tms:HeaderType" />
      <xs:element name="Body" type="ie:BodyType" />
    </xs:sequence>
  </xs:complexType>
  <!--===== IE Specific Data Groups Declarations =====-->
  <xs:complexType name="BodyType">
    <xs:sequence>
      <xs:element name="RefusalByCustoms" type="ie:RefusalByCustomsType" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="RefusalByCustomsType">
    <xs:sequence>
      <xs:element name="Attributes" type="ie:AttributesType" />
      <xs:element name="ConsigneeTrader" type="ie:ConsigneeTraderType" minOccurs="0" />
      <xs:element name="ExportPlaceCustomsOffice" type="ie:ExportPlaceCustomsOfficeType" minOccurs="0" />
      <xs:element name="ExportCrossCheckingDiagnoses" type="ie:ExportCrossCheckingDiagnosesType" minOccurs="0" />
      <xs:element name="Rejection" type="ie:RejectionType" />
      <xs:element name="CEadVal" type="ie:CEadValType" minOccurs="0" maxOccurs="99" />
      <xs:element name="NEadSub" type="ie:NEadSubType" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="AttributesType">
    <xs:sequence>
      <xs:element name="DateAndTimeOfIssuance" type="emcs:DateTimeType" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ConsigneeTraderType">
    <xs:annotation>
      <xs:documentation>
        <doc:description value="(CONSIGNEE) TRADER" />
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Traderid" type="emcs:TraderidType" minOccurs="0" />
      <xs:element name="TraderName" type="emcs:TraderNameType" />
      <xs:element name="StreetName" type="emcs:StreetNameType" />
      <xs:element name="StreetNumber" type="emcs:StreetNumberType" minOccurs="0" />
      <xs:element name="Postcode" type="emcs:PostcodeType" />
      <xs:element name="City" type="emcs:CityType" />
	  <xs:element name="EoriNumber" type="emcs:EoriNumberType" minOccurs="0" />
    </xs:sequence>
    <xs:attribute name="language" type="emcs:LanguageCodeType" use="required" />
  </xs:complexType>
  <xs:complexType name="ExportPlaceCustomsOfficeType">
    <xs:annotation>
      <xs:documentation>
        <doc:description value="(EXPORT PLACE) CUSTOMS OFFICE" />
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="ReferenceNumber" type="emcs:ExciseOfficeCodeType" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ExportCrossCheckingDiagnosesType">
    <xs:annotation>
      <xs:documentation>
        <doc:description value="EXPORT CROSS CHECKING DIAGNOSES" />
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="LocalReferenceNumber" type="emcs:LocalReferenceNumberType" minOccurs="0" />
      <xs:element name="DocumentReferenceNumber" type="emcs:DocumentReferenceNumberType" minOccurs="0" />
      <xs:element name="Diagnosis" type="ie:DiagnosisType" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="DiagnosisType">
    <xs:annotation>
      <xs:documentation>
        <doc:description value="DIAGNOSIS" />
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="AdministrativeReferenceCode" type="emcs:AdministrativeReferenceCodeType" />
      <xs:element name="BodyRecordUniqueReference" type="emcs:BodyRecordUniqueReferenceType" />
      <xs:element name="DiagnosisCode" type="tcl:DiagnosisCode" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="RejectionType">
    <xs:annotation>
      <xs:documentation>
        <doc:description value="REJECTION" />
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="RejectionDateAndTime" type="emcs:DateTimeType" />
      <xs:element name="RejectionReasonCode" type="tcl:CustomsRejectionReasonCode" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="CEadValType">
    <xs:annotation>
      <xs:documentation>
        <doc:description value="C_EAD_VAL" />
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="AdministrativeReferenceCode" type="emcs:AdministrativeReferenceCodeType" />
      <xs:element name="SequenceNumber" type="emcs:SequenceNumberType" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="NEadSubType">
    <xs:annotation>
      <xs:documentation>
        <doc:description value="N_EAD_SUB" />
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="LocalReferenceNumber" type="emcs:LocalReferenceNumberType" />
    </xs:sequence>
  </xs:complexType>
</xs:schema>

