<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:TiposBasicos" targetNamespace="urn:TiposBasicos" elementFormDefault="qualified">
	<xsd:annotation>
		<xsd:documentation xml:lang="ES">
		XML Schema que contiene definiciones de tipos básicos utilizados en otros esquemas de las distintas interfaces
		</xsd:documentation>
	</xsd:annotation>
	<xsd:simpleType name="OrganoGestorType">
		<xsd:annotation>
			<xsd:documentation xml:lang="ES">Tipo para contener un órgano gestor</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="8"/>
			<xsd:maxLength value="8"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="UnidadTramitadoraType">
		<xsd:annotation>
			<xsd:documentation xml:lang="ES">Tipo para contener una unidad tramitadora</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="7"/>
			<xsd:maxLength value="10"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="TextMin3Max30Type">
		<xsd:annotation>
			<xsd:documentation xml:lang="ES">Tipo para contener CIFs. Se define este tipo con el signficado de Facturae. 
			Sin embargo no se desea enlazar al namespace de Facturae, 
			por si cambian los formatos de factura admitidos en el futuro.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="3"/>
			<xsd:maxLength value="30"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:complexType name="AnexoType">
		<xsd:annotation>
			<xsd:documentation xml:lang="ES">Tipo para contener anexos</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="Documento" type="xsd:base64Binary">
				<xsd:annotation>
					<xsd:documentation xml:lang="ES">El fichero conteniendo el anexo en sí mismo</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
						<xsd:element name="Nombre" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation xml:lang="ES">El nombre del fichero de anexo</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
						<xsd:element name="TipoMIME" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation xml:lang="ES">El tipo MIME (Multipurpose Internet Mail Extensions) del fichero de anexo.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="IdentificadorFacturaType">
		<xsd:annotation>
			<xsd:documentation xml:lang="ES">Tipo para contener identificadores de factura</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="TaxIdentificationNumber" type="tns:TextMin3Max30Type">
				<xsd:annotation>
					<xsd:documentation xml:lang="ES">Número de identificación fiscal del emisor</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="NumeroSerieFactura" nillable="true">
				<xsd:annotation>
					<xsd:documentation xml:lang="ES">Número de serie de la factura</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:minLength value="1"/>
						<xsd:maxLength value="20"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="NumeroFactura">
				<xsd:annotation>
					<xsd:documentation xml:lang="ES">Número de la factura dentro de la serie indicada</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:minLength value="1"/>
						<xsd:maxLength value="20"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="EstadoType">
		<xsd:sequence>
			<xsd:element name="Estado" nillable="false">
				<xsd:annotation>
					<xsd:documentation xml:lang="ES">Tipo de estado de la factura</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:enumeration value="Registrada"/>
						<xsd:enumeration value="Conformada"/>
						<xsd:enumeration value="Rechazada"/>
						<xsd:enumeration value="Propuesta el pago"/>
						<xsd:enumeration value="Devuelta a solicitud  del proveedor"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="InformacionAdicional" type="xsd:string" nillable="true">
				<xsd:annotation>
					<xsd:documentation xml:lang="ES">Información adicional. Por ejemplo para explicar el motivo de rechazo. Campo opcional</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="ErrorType">
		<xsd:annotation>
			<xsd:documentation xml:lang="ES">Tipo para los errores</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="CodigoError">
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:maxLength value="10"/>
						<xsd:minLength value="0"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="DescripcionError" type="xsd:string"/>
		</xsd:sequence>
	</xsd:complexType>
</xsd:schema>
