<xs:schema xmlns="http://ivis.eps.gov.lv/XMLSchemas/100580/AccountRegister/v1-0" xmlns:accreg="http://ivis.eps.gov.lv/XMLSchemas/100580/AccountRegister/v1-0" xmlns:pers="http://ivis.eps.gov.lv/XMLSchemas/100001/Person/v1-0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vidc="http://ivis.eps.gov.lv/XMLSchemas/100580/Comm/v1-0" targetNamespace="http://ivis.eps.gov.lv/XMLSchemas/100580/AccountRegister/v1-0" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0" id="AccountRegisterTypes.xsd">
  <xs:annotation>
    <xs:appinfo>
      <Metadata xmlns="http://ivis.eps.gov.lv/XMLSchemas/100001/IVIS/v1-0">
        <Contributor CodeListCodeValue="100580" Href="https://www.vid.gov.lv">VALSTS IEŅĒMUMU DIENESTS</Contributor>
        <Creator CodeListCodeValue="100580" Href="https://www.vid.gov.lv">VALSTS IEŅĒMUMU DIENESTS</Creator>
        <Date>
          <Created>2017-08-29Z</Created>
          <Modified>2020-05-11Z</Modified>
        </Date>
        <Description>
          <Default>Kontu informācijas datu iesniegšana</Default>
        </Description>
        <Format>
          <Default>text/xml</Default>
        </Format>
        <Identifier Scheme="URN">URN:IVIS:100001:XSD-AccountRegister-AccountRegisterTypes-v1-0</Identifier>
        <Language>LV</Language>
        <Publisher CodeListCodeValue="100001">Valsts informācijas sistēmu savietotājs (VISS)</Publisher>
        <Relation>
          <ConformsTo Href="URN:IVIS:100001:DOC-FR-XML">XML shēmu izstrādes vadlīnijas</ConformsTo>
        </Relation>
        <Status>
          <Default>PUBLISHED</Default>
          <Version>1.0</Version>
        </Status>
        <Subject>
          <Category>Nodokļi</Category>
          <Keyword>Valsts ieņēmumu dienests</Keyword>
          <Keyword>VID</Keyword>
          <Keyword>datu apmaiņa</Keyword>
        </Subject>
        <Title>
          <Default>AccountRegisterTypes</Default>
        </Title>
      </Metadata>
    </xs:appinfo>
  </xs:annotation>
  <xs:import namespace="http://ivis.eps.gov.lv/XMLSchemas/100580/Comm/v1-0" schemaLocation="http://ivis.eps.gov.lv/XMLSchemas/100580/Comm/v1-0/Comm.xsd" />
  <xs:import namespace="http://ivis.eps.gov.lv/XMLSchemas/100001/Person/v1-0" schemaLocation="http://ivis.eps.gov.lv/XMLSchemas/100001/Person/v1-0/Person.xsd" />
  <xs:simpleType name="OrderIdType">
    <xs:restriction base="xs:token">
      <xs:length value="30" />
      <xs:pattern value=".{1,30}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="OrderNumberType">
    <xs:restriction base="xs:token">
      <xs:length value="20" />
      <xs:pattern value=".{1,20}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ARTaxPayerNameType">
    <xs:restriction base="vidc:TaxPayerNameType">
      <xs:minLength value="1" />
      <xs:maxLength value="200" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ARTaxPayerNumberType">
    <xs:restriction base="vidc:NonEmptyStringType">
      <xs:minLength value="1" />
      <xs:maxLength value="200" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ARDocumentNumberType">
    <xs:restriction base="vidc:NonEmptyStringType">
      <xs:minLength value="1" />
      <xs:maxLength value="200" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ARTokenType">
    <xs:annotation>
      <xs:documentation xml:lang="lv">Token tipa mainīgais ar minimālo garumu 1 un maksimālo garumu 200</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:minLength value="1" />
      <xs:maxLength value="200" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="TINStructure">
    <xs:annotation>
      <xs:documentation xml:lang="lv">Nodokļa maksātāja identifikācijas numurs. Atribūts  'issuedBy'  apraksta identifikācijas numura izdevēju. </xs:documentation>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="ARTaxPayerNumberType">
        <xs:attribute name="IssuedBy" type="vidc:CountryCodeType" use="optional">
          <xs:annotation>
            <xs:documentation xml:lang="lv">Valsts, kura piešķīrusi identifikatoru (2 simbolu kods ISO 3166)</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="DocumentStructure">
    <xs:sequence>
      <xs:element name="DocumentNumber" type="ARDocumentNumberType">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Personu apliecinoša dokumenta numurs</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="IssueCountryCode" type="vidc:CountryCodeStructure">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Personu apliecinoša dokumenta izsniedzējas valsts nosaukums un 2 simbolu koda tips saskaņā ar ISO 3166-1 alpha-2</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="PersonResidentStructure">
    <xs:annotation>
      <xs:documentation xml:lang="lv">Fiziskās personas rezidenta struktūra</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="FirstName" type="vidc:ForeignFirstNameType" nillable="true">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Vārds (t.sk. citi vārdi)</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="LastName" type="vidc:ForeignLastNameType">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Uzvārds</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="PersonCode" type="pers:PersonCodeType">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Personas kods</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="PreviousPersonCode" type="pers:PersonCodeType" minOccurs="0">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Iepriekšējais personas kods</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="PersonNonResidentStructure">
    <xs:annotation>
      <xs:documentation xml:lang="lv">Fiziskās personas nerezidenta struktūra</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="FirstName" type="vidc:ForeignFirstNameType" nillable="true">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Vārds (t.sk. citi vārdi)</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="LastName" type="vidc:ForeignLastNameType" nillable="true">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Uzvārds</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="BirthDate" type="xs:date">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Dzimšanas datums</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="IdentityDocument" type="DocumentStructure" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Personu apliecinošu dokumentu saraksts.
Ja nav spēkā esošu dokumentu, tad norāda pēdējo aktuālo</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TIN" type="TINStructure" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Nodokļu maksātāja identifikatoru saraksts, kuru izmanto nodokļu administrēšanas iestāde, lai identificētu personu</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="LegalEntityResidentStructure">
    <xs:annotation>
      <xs:documentation xml:lang="lv">Juridiskās personas rezidenta struktūra</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Name" type="ARTaxPayerNameType">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Nosaukums</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="LegalEntityNumber" type="vidc:TaxPayerNumberType">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Reģistrācijas numurs</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="LegalEntityNonResidentStructure">
    <xs:annotation>
      <xs:documentation xml:lang="lv">Juridiskās personas nerezidenta struktūra</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Name" type="ARTokenType" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Nosaukums (var būt vairāki)</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="RegistrationNumber" type="ARTokenType">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Reģistrācijas numurs </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="RegistrationCountryCode" type="vidc:CountryCodeStructure" minOccurs="0">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Reģistrācijas valsts nosaukums un 2 simbolu kods saskaņā ar ISO 3166-1 alpha-2</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TIN" type="TINStructure" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Nodokļu maksātāja identifikatoru saraksts, kuru izmanto nodokļu administrēšanas iestāde, lai identificētu personu</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="PersonStructure">
    <xs:annotation>
      <xs:documentation xml:lang="lv">Fiziskās un juriskās persona rezidenta un nerezidenta struktūra </xs:documentation>
    </xs:annotation>
    <xs:choice>
      <xs:element name="LegalEntityResident" type="LegalEntityResidentStructure">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Juridiskā persona, kas ir Latvijas Republikas rezidents vai nerezidenta pastāvīgā pārstāvniecība Latvijā </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="LegalEntityNonResident" type="LegalEntityNonResidentStructure">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Juridiskā persona, kas ir Latvijas Republikas nerezidents</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="PersonResident" type="PersonResidentStructure">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Fiziskā persona, kas ir Latvijas Republikas rezidents </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="PersonNonResident" type="PersonNonResidentStructure">
        <xs:annotation>
          <xs:documentation xml:lang="lv">Fiziskā persona, kas ir Latvijas Republikas nerezidents </xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:choice>
  </xs:complexType>
</xs:schema>