<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema id="Schema"
    targetNamespace="http://sid.si"
    elementFormDefault="qualified"
    xmlns="http://tempuri.org/Schema.xsd"
    xmlns:mstns="http://tempuri.org/Schema.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:sid="http://sid.si">
	
	<xs:element name="Porocilo">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Glava">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="posiljatelj" minOccurs="1">
								<xs:annotation>
									<xs:documentation>
										Pošiljatelj je obvezen podatek.
										Najadaljši možen vnos je 100 znakov.
									</xs:documentation>
								</xs:annotation>
						
								<xs:simpleType>
									<xs:restriction base="xs:string">
										<xs:minLength value="8" />
										<xs:maxLength value="100" />
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							
							<xs:element name="datumPorocila" type="xs:date" minOccurs="1" />
							<xs:element name="datumPorocanja" type="xs:date" minOccurs="1" />
								  
							<xs:element name="davcnaStevilkaBanke" minOccurs="1">
								<xs:annotation>
									<xs:documentation>
										Davčna številka je omejena na dolžino točno 8 znakov.
									</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="xs:string">
										<xs:length value="8" />
										<xs:pattern value="[0-9]{1,8}"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
		
				<xs:element name="Zapis" maxOccurs="unbounded">
					<xs:complexType>
						<xs:choice>	
							<xs:element name="PravnaOseba" type="sid:pravnaOseba" />
						</xs:choice>
					</xs:complexType>
				</xs:element>
				
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	
	<xs:complexType name="pravnaOseba">
		<xs:annotation>
			<xs:documentation>
				Pri pravni osebi so naslednji podatki opcijski:
				 * KMG-MID prejemnika;
				 * Številka kreditne pogodbe, ki se poplačuje;
				 * Euribor.
			</xs:documentation>
		</xs:annotation>
	  
		<xs:sequence>
			<xs:element name="davcnaStevilkaKreditojemalca" minOccurs="1">
				<xs:annotation>
					<xs:documentation>
						Davčna številka je omejena na dolžino točno 8 znakov.
					</xs:documentation>
				</xs:annotation>
				
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:length value="8" />
						<xs:pattern value="[0-9]{1,8}"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
	  
			<xs:element name="mIdPrejemnika" minOccurs="0">
				<xs:annotation>
					<xs:documentation>
						KMG-MID je enolična in neponovljiva 9 mestna identifikacijska številka kmetijskega gospodarstva.
					</xs:documentation>
				</xs:annotation>
				
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:length value="9" />
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			
			<xs:element name="velikostPodjetja" minOccurs="1">
				<xs:annotation>
					<xs:documentation>
						Nabor vrednosti za velikost podjetja:
						 1. MSP;
						 2. Veliko podjetje.
					</xs:documentation>
				</xs:annotation>
			  
				<xs:simpleType>
					<xs:restriction base="xs:integer">
						<xs:enumeration value="1" />
						<xs:enumeration value="2" />
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
		  
			<xs:element name="namenKredita" minOccurs="1">
				<xs:annotation>
					<xs:documentation>
						Nabor vrednosti za namen kredita:
						 04 - Financiranje dolga (Refinanciranje obveznosti iz kreditne pogodbe od 12.03.2020 dalje)
						 07 - Investicije v osnovna sredstva;
						 08 - Obratna sredstva.
					</xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:enumeration value="04" />
						<xs:enumeration value="07" />
						<xs:enumeration value="08" />
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			
			<xs:element name="stevilkaKreditnePogodbeKiSePoplacuje" minOccurs="0">
				<xs:annotation>
					<xs:documentation>
						Številka kreditne pogodbe, ki se poplačuje je omejena na 100 znakov.
					</xs:documentation>
				</xs:annotation>
				
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:minLength value="1" />
						<xs:maxLength value="100" />
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			  
			<xs:element name="stevilkaKreditnePogodbe" minOccurs="1">
				<xs:annotation>
					<xs:documentation>
						Številka kreditne pogodbe je omejena na 100 znakov.
					</xs:documentation>
				</xs:annotation>
				
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:minLength value="1" />
						<xs:maxLength value="100" />
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			
			<xs:element name="pogodbeniZnesekGlavniceVEur" minOccurs="1">
				<xs:annotation>
					<xs:documentation>
						Pogodbeni znesek glavnice mora biti pozitiven.
						Natančnost podatka je omejena na 2 decimalni mesti.
					</xs:documentation>
				</xs:annotation>
				
				<xs:simpleType>
					<xs:restriction base="xs:decimal">
						<xs:minInclusive value="0" />
						<xs:fractionDigits value="2" />
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			  
			<xs:element name="valuta" minOccurs="1">
				<xs:annotation>
					<xs:documentation>
						Valuta je sestavljena iz 3 velikih črk angleške abecede.
						Dovoljena vrednost EUR.
					</xs:documentation>
				</xs:annotation>
				
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:pattern value="[A-Z][A-Z][A-Z]" />
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			  
			<xs:element name="odstotekPorostvaRS" minOccurs="1">
				<xs:annotation>
					<xs:documentation>
							Nabor vrednosti za odstotek poroštva RS:
								 70;
								 80.
					</xs:documentation>
				</xs:annotation>
				
				<xs:simpleType>
					<xs:restriction base="xs:integer">
						<xs:enumeration value="70" />
						<xs:enumeration value="80" />
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			
			<xs:element name="periodaOdplacilaGlavnice" minOccurs="1">
				<xs:annotation>
					<xs:documentation>
						Nabor vrednosti za skupino kreditojemalca za fizično osebo:
						 01 - Mesečno
						 02 - Četrtletno
						 03 - Polletno
						 04 - Letno
						 05 - Glavnica pri zadnjem obroku (bullet)
						 07 - Drugo
					</xs:documentation>
				</xs:annotation>
			  
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:enumeration value="01" />
						<xs:enumeration value="02" />
						<xs:enumeration value="03" />
						<xs:enumeration value="04" />
						<xs:enumeration value="05" />
						<xs:enumeration value="07" />
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			  
			<xs:element name="datumOdobritve" type="xs:date" minOccurs="1" />
			<xs:element name="datumSklenitveKreditnePogodbe" type="xs:date" minOccurs="1" />
			<xs:element name="skrajniDatumZaCrpanje" type="xs:date" minOccurs="1" />
			<xs:element name="datumZapadlostiPrvegaObrokaGlavnice" type="xs:date" minOccurs="1" />
			<xs:element name="datumKoncneZapadlostiKredita" type="xs:date" minOccurs="1" />
			  
			<xs:element name="tipObrestneMere" minOccurs="1">
				<xs:annotation>
					<xs:documentation>
						Nabor vrednosti za polje tip obrestne mere in preslikave:
						 01 - Variabilna
						 04 - Fiksna
						 05 - Fiksna
						 06 - Fiksna
						 07 - Fiksna
						 08 - Fiksna
						 09 - Fiksna
						 10 - Fiksna
					</xs:documentation>
				</xs:annotation>
			  
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:enumeration value="01" />
						<xs:enumeration value="04" />
						<xs:enumeration value="05" />
						<xs:enumeration value="06" />
						<xs:enumeration value="07" />
						<xs:enumeration value="08" />
						<xs:enumeration value="09" />
						<xs:enumeration value="10" />
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			
			<xs:element name="euribor" minOccurs="0">
				<xs:annotation>
					<xs:documentation>
						Polje EURIBOR je obvezno za vnos, kadar je izbrana V - variabilna obrestna mera (to se določi na podlagi šifranta tipov obrestnih mer).
						Nabor vrednosti za polje EURIBOR:
						 013 - Obrestna mera LIBOR EUR 1 mesec
						 014 - Obrestna mera LIBOR EUR 2 meseca
						 015 - Obrestna mera LIBOR EUR 3 mesece
						 016 - Obrestna mera LIBOR EUR 6 mesecev
						 017 - Obrestna mera LIBOR EUR 9 mesecev
						 018 - Obrestna mera LIBOR EUR 1 leto
						 019 - Obrestna mera LIBOR USD 1 mesec
						 020 - Obrestna mera LIBOR USD 2 meseca
						 021 - Obrestna mera LIBOR USD 3 mesece
						 022 - Obrestna mera LIBOR USD 6 mesecev
						 023 - Obrestna mera LIBOR USD 9 mesecev
						 024 - Obrestna mera LIBOR USD 1 leto
						 025 - Obrestna mera LIBOR CHF 1 mesec
						 026 - Obrestna mera LIBOR CHF 2 meseca
						 027 - Obrestna mera LIBOR CHF 3 mesece
						 028 - Obrestna mera LIBOR CHF 6 mesecev
						 029 - Obrestna mera LIBOR CHF 9 mesecev
						 030 - Obrestna mera LIBOR CHF 1 leto
						 031 - Obrestna mera LIBOR JPY 1 mesec
						 032 - Obrestna mera LIBOR JPY 2 meseca
						 033 - Obrestna mera LIBOR JPY 3 mesece
						 034 - Obrestna mera LIBOR JPY 6 mesecev
						 035 - Obrestna mera LIBOR JPY 9 mesecev
						 036 - Obrestna mera LIBOR JPY 1 leto
						 037 - Obrestna mera WIBOR PLN 3 mesece
						 038 - Tržna obrestna mera za CHF 1 mesec
						 039 - Tržna obrestna mera za SEK 1 mesec
						 041 - Obrestna mera ameriške konzorcijske banke AKA
						 042 - Slovenska medbančna obrestna mera 1 mesec (SITIBOR)
						 043 - Slovenska medbančna obrestna mera 3 mesece (SITIBOR)
						 044 - Obrestna mera SKB banke SIOM
						 045 - Prvovrstna obrestna mera NLB
						 046 - Izhodiščna obrestna mera NLB
						 047 - Izhodiščna obrestna mera Bank Austria Creditanstalt
						 048 - Temeljna obrestna mera TOM kot navadna referenčna obrestna mera
						 053 - Obrestna mera LIBOR AUD 6 mesecev
						 054 - Obrestna mera LIBOR AUD 1 leto
						 055 - Obrestna mera LIBOR CAD 6 mesecev
						 056 - Obrestna mera LIBOR CAD 1 leto
						 057 - Obrestna mera LIBOR GBP 6 mesecev
						 058 - Obrestna mera LIBOR GBP 1 leto
						 059 - Obrestna mera STIBOR SEK 6 mesecev
						 060 - Obrestna mera STIBOR SEK 1 leto
						 061 - Obrestna mera PRIBOR CZK 6 mesecev 
						 062 - Obrestna mera PRIBOR CZK 3 mesece 
						 063 - Obrestna mera LIBOR AUD 1 mesec 
						 064 - Obrestna mera LIBOR AUD 3 mesece 
						 065 - Obrestna mera LIBOR CAD 1 mesec 
						 066 - Obrestna mera LIBOR CAD 3 mesece 
						 067 - Obrestna mera LIBOR GBP 1 mesec
						 068 - Obrestna mera LIBOR GBP 3 mesece
						 069 - Tržna obrestna mera za GBP 1 mesec
						 072 - Tržna obrestna mera za EUR 1 mesec
						 073 - Tržna obrestna mera za EUR 6 mesecev
						 074 - Tržna obrestna mera za USD 1 mesec
						 076 - Obrestna mera EIB
						 077 - Obrestna mera ECB za refinanciranje 
						 078 - Obrestna mera vezana na indeks cen delnic/obveznic
						 079 - Obrestna mera ZIBOR HRK 3 mesece
						 080 - Obrestna mera ZIBOR HRK 6 mesecev
						 081 - Swap rate EUR 2 leti
						 082 - Swap rate EUR 3 leta
						 085 - Indeks bruto donosov 6M italijanskih ZM (GBOTG6M Index)
						 086 - LIBOR SEK 6M 
						 087 - (EURIBOR 1M + EURIBOR 3M)/2
						 088 - Madžarska medbančna obrestna mera BUBOR O/N
						 089 - Obrestna mera FED FUNDS O/N
						 090 - Obrestna mera LIBID EUR O/N
						 091 - Obrestna mera EURIBOR 43 dni
						 092 - Obrestna mera PRIBOR CZK 1 mesec
						 093 - Zakonska zamudna obrestna mera 
						 094 - Obrestna mera LIBOR SEK 1 leto
						 095 - Obrestna mera TOIS - CHF TOM Next Index Swaps
						 096 - Obrestna mera LIBOR CHF 7 mesecev (velja od 1. 6. 2011)
						 097 - Obrestna mera ZIBOR HRK 1 mesec (velja od 01.03.2012)
						 098 - Obrestna mera Deutsche Bank Administered AAA rated EUR MMF (velja od 01.11.2012)
						 100 - Obrestna mera EONIA 
						 101 - Obrestna mera EURIBOR 1 teden 
						 102 - Obrestna mera EURIBOR 1 mesec 
						 103 - Obrestna mera EURIBOR 2 mesec 
						 104 - Obrestna mera EURIBOR 3 mesec 
						 105 - Obrestna mera EURIBOR 4 mesec 
						 106 - Obrestna mera EURIBOR 6 mesec 
						 107 - Obrestna mera EURIBOR 9 mesec 
						 108 - Obrestna mera EURIBOR 1 leto 
						 109 - Obrestna mera EURIBOR 5 mesecev (velja od 1. 8. 2010)
						 110 - Obrestna mera EURIBOR 2 tedna (velja od 1. 3. 2011)
						 111 - Obrestna mera ECB za mejni depozit (velja od 1. 6. 2016)
						 112 - Donos na delniški kapital izdajatelja (ROE) (velja od 1. 9. 2016)
						 099 - Drugo
					</xs:documentation>
				</xs:annotation>
			  
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:enumeration value="013" />
						<xs:enumeration value="014" />
						<xs:enumeration value="015" />
						<xs:enumeration value="016" />
						<xs:enumeration value="017" />
						<xs:enumeration value="018" />
						<xs:enumeration value="019" />
						<xs:enumeration value="020" />
						<xs:enumeration value="021" />
						<xs:enumeration value="022" />
						<xs:enumeration value="023" />
						<xs:enumeration value="024" />
						<xs:enumeration value="025" />
						<xs:enumeration value="026" />
						<xs:enumeration value="027" />
						<xs:enumeration value="028" />
						<xs:enumeration value="029" />
						<xs:enumeration value="030" />
						<xs:enumeration value="031" />
						<xs:enumeration value="032" />
						<xs:enumeration value="033" />
						<xs:enumeration value="034" />
						<xs:enumeration value="035" />
						<xs:enumeration value="036" />
						<xs:enumeration value="037" />
						<xs:enumeration value="038" />
						<xs:enumeration value="039" />
						<xs:enumeration value="041" />
						<xs:enumeration value="042" />
						<xs:enumeration value="043" />
						<xs:enumeration value="044" />
						<xs:enumeration value="045" />
						<xs:enumeration value="046" />
						<xs:enumeration value="047" />
						<xs:enumeration value="048" />
						<xs:enumeration value="053" />
						<xs:enumeration value="054" />
						<xs:enumeration value="055" />
						<xs:enumeration value="056" />
						<xs:enumeration value="057" />
						<xs:enumeration value="058" />
						<xs:enumeration value="059" />
						<xs:enumeration value="060" />
						<xs:enumeration value="061" />
						<xs:enumeration value="062" />
						<xs:enumeration value="063" />
						<xs:enumeration value="064" />
						<xs:enumeration value="065" />
						<xs:enumeration value="066" />
						<xs:enumeration value="067" />
						<xs:enumeration value="068" />
						<xs:enumeration value="069" />
						<xs:enumeration value="072" />
						<xs:enumeration value="073" />
						<xs:enumeration value="074" />
						<xs:enumeration value="076" />
						<xs:enumeration value="077" />
						<xs:enumeration value="078" />
						<xs:enumeration value="079" />
						<xs:enumeration value="080" />
						<xs:enumeration value="081" />
						<xs:enumeration value="082" />
						<xs:enumeration value="085" />
						<xs:enumeration value="086" />
						<xs:enumeration value="087" />
						<xs:enumeration value="088" />
						<xs:enumeration value="089" />
						<xs:enumeration value="090" />
						<xs:enumeration value="091" />
						<xs:enumeration value="092" />
						<xs:enumeration value="093" />
						<xs:enumeration value="094" />
						<xs:enumeration value="095" />
						<xs:enumeration value="096" />
						<xs:enumeration value="097" />
						<xs:enumeration value="098" />
						<xs:enumeration value="100" />
						<xs:enumeration value="101" />
						<xs:enumeration value="102" />
						<xs:enumeration value="103" />
						<xs:enumeration value="104" />
						<xs:enumeration value="105" />
						<xs:enumeration value="106" />
						<xs:enumeration value="107" />
						<xs:enumeration value="108" />
						<xs:enumeration value="109" />
						<xs:enumeration value="110" />
						<xs:enumeration value="111" />
						<xs:enumeration value="112" />
						<xs:enumeration value="099" />
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			
			<xs:element name="pribitekNadVariabilnoObrestnoMero" minOccurs="1">
				<xs:annotation>
					<xs:documentation>
						Pribitek nad variabilno obrestno mero je omejen med 0 in 100 odstotki.
						Natančnost podatka je omejena na 2 decimalni mesti.
					</xs:documentation>
				</xs:annotation>
				
				<xs:simpleType>
					<xs:restriction base="xs:decimal">
						<xs:minInclusive value="0" />
						<xs:maxInclusive value="100" />
						<xs:fractionDigits value="2" />
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			
			<xs:element name="hipoteticniPribitekNadVariabilnoObrestnoMero" minOccurs="1">
				<xs:annotation>
					<xs:documentation>
						Hipotetični pribitek nad variabilno obrestno mere je omejen med 0 in 100 odstotki.
						Natančnost podatka je omejena na 2 decimalni mesti.
					</xs:documentation>
				</xs:annotation>
				
				<xs:simpleType>
					<xs:restriction base="xs:decimal">
						<xs:minInclusive value="0" />
						<xs:maxInclusive value="100" />
						<xs:fractionDigits value="2" />
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			
			<xs:element name="ocenaVerjetnostiNeplacila" minOccurs="1">
				<xs:annotation>
					<xs:documentation>
						Ocena verjetnosti neplačila je omejena med 0 in 100 odstotki.
						Natančnost podatka je omejena na 2 decimalni mesti.
					</xs:documentation>
				</xs:annotation>
				
				<xs:simpleType>
					<xs:restriction base="xs:decimal">
						<xs:minInclusive value="0" />
						<xs:maxInclusive value="100" />
						<xs:fractionDigits value="2" />
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			  
			<xs:element name="storno" minOccurs="1">
				<xs:annotation>
					<xs:documentation>
						Dovoljeni sta samo vrednosti "" in "S".
						Status zapisa. Če je polje prazno se podatek zapiše, če je označeno s "S" pomeni brisanje oziroma storno.
						S pomeni storniranje že poslanega zapisa.
						Banka poroča "S" (storno) v primerih, ko:
						- je pomotoma poslala zapis, in ga želi izločiti iz poroštvene sheme,
						- želi sporočiti popravek kateregakoli polja v že poslanem zapisu / vrstici (stornira in pošlje nov zapis)
						- če skrajša "Odlog plačila do", ga na ta način stornira in pošlje nov zapis z novim podatkom.
					</xs:documentation>
				</xs:annotation>
				  
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:enumeration value="" />
						<xs:enumeration value="S" />
					</xs:restriction>
				</xs:simpleType>
			</xs:element>

		</xs:sequence>
	</xs:complexType>
	
</xs:schema>