<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tx="http://www.gsis.gr/cpaauditreports/v10" targetNamespace="http://www.gsis.gr/cpaauditreports/v10" elementFormDefault="qualified" version="1.0">
	<xs:element name="taxComplianceReports">
		<xs:annotation>
			<xs:documentation>Main Element for Cpa Audit Reports. reportDate Contains the report genaration date,  userName the user's name,  the criteria used for searching
			and a list containing all user submissions that fits the criteria and contains Cpa Audit Reports. Choice has been used in order to fit other future needs</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="reportDate" type="xs:date"/>
				<xs:element name="userName" type="xs:string"/>
				<xs:element name="usedCriteria" type="xs:string"/>
				<xs:choice>
					<xs:element name="taxComplianceSubmissionsList" type="tx:taxComplianceSubmissionsList_Type"/>
					<xs:element name="taxComplianceAssignementList" type="tx:taxComplianceAssignementList_Type"/>					
				</xs:choice>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:complexType name="taxComplianceSubmissionsList_Type">
		<xs:annotation>
			<xs:documentation>The submissions list
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="taxComplianceSubmissionListElement" type="tx:taxComplianceSubmissionListElement_Type" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="taxComplianceSubmissionListElement_Type">
		<xs:sequence>
			<xs:element name="submissionId" type="xs:integer"/>
			<xs:element name="submissionDate" type="xs:dateTime"/>
			<xs:element name="submissionState" type="xs:string"/>
			<xs:element name="auditFromPeriod" type="xs:date"/>
			<xs:element name="auditToPeriod" type="xs:date"/>
			<xs:element name="companyVatNumber" type="tx:vatNumber_type"/>
			<xs:element name="auditorVatNumber" type="tx:vatNumber_type"/>
			<xs:element name="uri" type="xs:anyURI"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="taxComplianceAssignementList_Type">
		<xs:annotation>
			<xs:documentation>The assignments  list
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="taxComplianceAssignementListElement" type="tx:taxComplianceAssignementListElement_Type" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="taxComplianceAssignementListElement_Type">
		<xs:sequence>
			<xs:element name="logId" type="xs:integer"/>
			<xs:element name="logDate" type="xs:dateTime"/>
			<xs:element name="username" type="xs:string"/>
			<xs:element name="action" type="xs:string"/>
			<xs:element name="auditFromPeriod" type="xs:date"/>
			<xs:element name="auditToPeriod" type="xs:date"/>
			<xs:element name="companyVatNumber" type="tx:vatNumber_type"/>
			<xs:element name="auditorVatNumber" type="tx:vatNumber_type"/>
			<xs:element name="uri" type="xs:anyURI"/>
		</xs:sequence>
	</xs:complexType>
	<xs:simpleType name="DecimalAmount">
		<xs:restriction base="xs:decimal">
			<xs:whiteSpace value="collapse"/>
			<xs:fractionDigits value="2"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="vatNumber_type">
		<xs:annotation>
			<xs:documentation>
          ΑΦΜ - Αριθμός Φορολογικού Μητρώου
           </xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:whiteSpace value="preserve"/>
			<xs:pattern value="([0-9]{8}[1-9])|([0-9]{7}[1-9][0-9])|([0-9]{6}[1-9][0-9]{2})|([0-9]{5}[1-9][0-9]{3})|([0-9]{4}[1-9][0-9]{4})|([0-9]{3}[1-9][0-9]{5})|([0-9]{2}[1-9][0-9]{6})|([0-9][1-9][0-9]{7})|([1-9][0-9]{8})"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>
