<?xml version="1.0"?>
<schema targetNamespace="http://ws.infotorg.no/xml/ErgoGroup/AjourDSF/2022-04-01/AjourDSF.xsd"
    xmlns:tns="http://ws.infotorg.no/xml/ErgoGroup/AjourDSF/2022-04-01/AjourDSF.xsd"
    xmlns="http://www.w3.org/2001/XMLSchema">

    <annotation>
        <documentation xml:lang="no">
            © 2022 TIETOEVRY ASA
        </documentation>
    </annotation>

    <simpleType name="KUNDEID">
        <annotation>
            <documentation>Verdi 'KUNDEID'</documentation>
            <documentation>Value 'KUNDEID'</documentation>
        </annotation>
        <restriction base="string">
            <maxLength value="36" />
        </restriction>
    </simpleType>

    <simpleType name="FODSNR">
        <annotation>
            <documentation>Verdi 'FODSNR'. Gyldig fødselsnr eller et idnr tildelt fra EVRY.</documentation>
            <documentation>Value 'FODSNR'. Valid birthnumber or an IDnumber assigned by EVRY.</documentation>
        </annotation>
        <restriction base="string">
            <maxLength value="11" />
        </restriction>
    </simpleType>

    <simpleType name="FORNAVN">
        <annotation>
            <documentation>Fornavn, påkrevd dersom privat tilgang hos Skatt</documentation>
            <documentation>First name</documentation>
        </annotation>
        <restriction base="string" />
    </simpleType>

    <simpleType name="ETTERNAVN">
        <annotation>
            <documentation>Slektsnavn, påkrevd dersom privat tilgang hos Skatt</documentation>
            <documentation>Surname</documentation>
        </annotation>
        <restriction base="string" />
    </simpleType>

    <simpleType name="MELLOMNAVN">
        <annotation>
            <documentation>Mellomnavn</documentation>
            <documentation>Middle name</documentation>
        </annotation>
        <restriction base="string" />
    </simpleType>

    <simpleType name="SAKSREF">
        <annotation>
            <documentation>Verdi 'SAKSREF'</documentation>
            <documentation>Value 'SAKSREF'</documentation>
        </annotation>
        <restriction base="string" />
    </simpleType>

    <simpleType name="OPPDRAGSID">
        <annotation>
            <documentation>Verdi 'OPPDRAGSID' : Identifisering av kundens portefølje</documentation>
            <documentation>Value 'OPPDRAGSID' : Identification of customer portfolio</documentation>
        </annotation>
        <restriction base="string">
            <minLength value="1" />
            <maxLength value="10" />
        </restriction>
    </simpleType>

    <simpleType name="EGENID">
        <annotation>
            <documentation>Verdi 'EGENID' : Kundens uniqe identifisering av personen</documentation>
            <documentation>Value 'EGENID' : Customer uniqe identification of the person</documentation>
        </annotation>
        <restriction base="string">
            <maxLength value="36" />
        </restriction>
    </simpleType>

    <simpleType name="EVRYID">
        <annotation>
            <documentation>Verdi 'EVRYID' : Evrys uniqe identifisering av personen</documentation>
            <documentation>Value 'EVRYID' : Evry uniqe identification of the person</documentation>
        </annotation>
        <restriction base="string">
            <maxLength value="36" />
        </restriction>
    </simpleType>

    <simpleType name="KILDEID">
        <annotation>
            <documentation>Verdi 'KILDEID' : Uniqe identifisering av personen avhengig av verdien i TYPEID</documentation>
            <documentation>Value 'KILDEID' : Uniqe identification of the person depending on the value of TYPEID</documentation>
        </annotation>
        <restriction base="string">
            <minLength value="1" />
            <maxLength value="36" />
        </restriction>
    </simpleType>

    <simpleType name="ANTALL">
        <annotation>
            <documentation>Verdi 'ANTALL' : Antall personer funnet</documentation>
            <documentation>Value 'ANTALL' : Number of persons found</documentation>
        </annotation>
        <restriction base="int">
        </restriction>
    </simpleType>

    <simpleType name="TYPEID">
        <restriction base="string">
            <maxLength value="1" />
            <enumeration value="F">
                <annotation>
                    <documentation>Fødselsnr</documentation>
                    <documentation>Birthnumber</documentation>
                </annotation>
            </enumeration>
           <enumeration value="K">
                <annotation>
                    <documentation>Kryptert fødselsnr(EDB fiktivt personnr)</documentation>
                    <documentation>Encrypted birthnumber (EDB fictitious personnumber)</documentation>
                </annotation>
            </enumeration>
           <enumeration value="E">
                <annotation>
                    <documentation>Egenid (kundens id)</documentation>
                    <documentation>Egenid (customer id)</documentation>
                </annotation>
            </enumeration>
           <enumeration value="U">
                <annotation>
                    <documentation>Evryid (Evrys unike identifikasjon)</documentation>
                    <documentation>Evryid (Evrys unique identification)</documentation>
                </annotation>
            </enumeration>
        </restriction>
    </simpleType>

    <simpleType name="DATOENDR">
        <annotation>
            <documentation>Verdi 'DATOENDR' : ÅÅÅÅMMDD Dato for siste endring</documentation>
            <documentation>Value 'DATOENDR' : YYYYMMDD Date of last change</documentation>
        </annotation>
        <restriction base="string">
           <maxLength value="8" />
        </restriction>
    </simpleType>

    <simpleType name="STATUSKODE">
        <annotation>
            <documentation>Verdi 'STATUSKODE' : 1=Bosatt 2=Utflyttet (ikke i bruk) 3=Utvandret 4=Forsvunnet 5=Død 6=Utgått fødsnr 7=Fødselsreg. 8=Annulert tilg. 9=Uregistrert person</documentation>
            <documentation>Value 'STATUSKODE' : 1=Resident 2=Relocated (not in use) 3=Emigrated 4=Disappeared 5=Dead 6=Emanated birthnumber 7=Birthregistered 8=Canceled access 9=Not registered person</documentation>
        </annotation>
        <restriction base="string">
            <maxLength value="1" />
        </restriction>
    </simpleType>

    <simpleType name="STATUSTEKST">
        <annotation>
            <documentation>Verdi 'STATUSTEKST' : Status i klartekst</documentation>
            <documentation>Value 'STATUSTEKST' : Status in plain text</documentation>
        </annotation>
        <restriction base="string">
           <maxLength value="40" />
        </restriction>
    </simpleType>

    <element name="hentPortefoeljeOppdaterPerson">
        <complexType>
            <sequence>
                <element minOccurs="0" maxOccurs="1" name="request" type="tns:REQUEST"/>
            </sequence>
        </complexType>
    </element>

    <element name="hentPortefoeljeLesPerson">
        <complexType>
            <sequence>
                <element minOccurs="0" maxOccurs="1" name="request" type="tns:LESREQUEST"/>
            </sequence>
        </complexType>
    </element>

    <element name="hentPortefoeljeSlettPerson">
        <complexType>
            <sequence>
                <element minOccurs="0" maxOccurs="1" name="request" type="tns:SLETTREQUEST"/>
            </sequence>
        </complexType>
    </element>

    <complexType name="REQUEST">
        <sequence>
            <element name="oppdragsid" type="tns:OPPDRAGSID" minOccurs="1"  maxOccurs="1"/>
            <element name="kundeid" type="tns:KUNDEID" minOccurs="1"  maxOccurs="1"/>
            <element name="typeid" type="tns:TYPEID" minOccurs="0"  maxOccurs="1"/>
            <element name="kildeid" type="tns:KILDEID" minOccurs="1"  maxOccurs="1"/>

            <element name="etternavn" type="tns:ETTERNAVN" minOccurs="0"  maxOccurs="1"/>
            <element name="fornavn" type="tns:FORNAVN" minOccurs="0"  maxOccurs="1"/>
            <element name="mellomnavn" type="tns:MELLOMNAVN" minOccurs="0"  maxOccurs="1"/>

            <element name="saksref" type="tns:SAKSREF" minOccurs="0"  maxOccurs="1"/>
        </sequence>
    </complexType>

    <complexType name="LESREQUEST">
        <sequence>
            <element name="oppdragsid" type="tns:OPPDRAGSID" minOccurs="1"  maxOccurs="1"/>
            <element name="typeid" type="tns:TYPEID" minOccurs="1"  maxOccurs="1"/>
            <element name="kildeid" type="tns:KILDEID" minOccurs="1"  maxOccurs="1"/>

            <element name="etternavn" type="tns:ETTERNAVN" minOccurs="0"  maxOccurs="1"/>
            <element name="fornavn" type="tns:FORNAVN" minOccurs="0"  maxOccurs="1"/>
            <element name="mellomnavn" type="tns:MELLOMNAVN" minOccurs="0"  maxOccurs="1"/>
        </sequence>
    </complexType>

    <complexType name="SLETTREQUEST">
        <sequence>
            <element name="oppdragsid" type="tns:OPPDRAGSID" minOccurs="1"  maxOccurs="1"/>
            <element name="kundeid" type="tns:KUNDEID" minOccurs="1"  maxOccurs="1"/>

            <element name="etternavn" type="tns:ETTERNAVN" minOccurs="0"  maxOccurs="1"/>
            <element name="fornavn" type="tns:FORNAVN" minOccurs="0"  maxOccurs="1"/>
            <element name="mellomnavn" type="tns:MELLOMNAVN" minOccurs="0"  maxOccurs="1"/>

            <element name="saksref" type="tns:SAKSREF" minOccurs="0"  maxOccurs="1"/>
        </sequence>
    </complexType>

    <element name="PortefoeljeOppdaterPerson">
        <complexType>	
            <sequence>
                <element minOccurs="0" maxOccurs="1" name="response" type="tns:RESPONSE"/>
            </sequence>
        </complexType>
    </element>

    <element name="PortefoeljeLesPerson">
        <complexType>	
            <sequence>
                <element minOccurs="0" name="response" type="tns:LESRESPONSE"/>
            </sequence>
        </complexType>
    </element>

    <element name="PortefoeljeSlettPerson">
        <complexType>	
            <sequence>
                <element minOccurs="0" name="response" type="tns:SLETTRESPONSE"/>
            </sequence>
        </complexType>
    </element>

    <complexType name="RESPONSE">
        <sequence>
            <element minOccurs="0" maxOccurs="1" name="oppdragsid" type="tns:OPPDRAGSID"/>
            <element minOccurs="0" maxOccurs="1" name="kundeid" type="tns:KUNDEID"/>
            <element minOccurs="0" maxOccurs="1" name="typeid" type="tns:TYPEID"/>
            <element minOccurs="0" maxOccurs="1" name="kildeid" type="tns:KILDEID"/>
	          <element minOccurs="0" maxOccurs="1" name="saksref" type="tns:SAKSREF"/>
        </sequence>
    </complexType>

    <complexType name="LESRESPONSE">
        <sequence>
            <element minOccurs="0" maxOccurs="unbounded" name="person">
                <complexType>	
                    <sequence>
                        <element minOccurs="1" maxOccurs="1" name="egenid" type="tns:EGENID"/>
                        <element minOccurs="1" maxOccurs="1" name="evryid" type="tns:EVRYID"/>
                        <element minOccurs="1"  maxOccurs="1" name="typeid" type="tns:TYPEID"/>
                        <element minOccurs="1"  maxOccurs="1" name="kildeid" type="tns:KILDEID"/>
                        <element minOccurs="1"  maxOccurs="1" name="datoendr" type="tns:DATOENDR"/>
                        <element minOccurs="1"  maxOccurs="1" name="statuskode" type="tns:STATUSKODE"/>
                        <element minOccurs="1"  maxOccurs="1" name="statustekst" type="tns:STATUSTEKST"/>
                    </sequence>
                </complexType>
            </element>
            <element minOccurs="1" maxOccurs="1" name="oppdragsid" type="tns:OPPDRAGSID"/>  
            <element minOccurs="1" maxOccurs="1" name="antall" type="tns:ANTALL"/>
        </sequence>
    </complexType>

    <complexType name="SLETTRESPONSE">
        <sequence>
            <element minOccurs="0" maxOccurs="1" name="oppdragsid" type="tns:OPPDRAGSID"/>
            <element minOccurs="0" maxOccurs="1" name="kundeid" type="tns:KUNDEID"/>
            <element minOccurs="0" maxOccurs="1" name="typeid" type="tns:TYPEID"/>
            <element minOccurs="0" maxOccurs="1" name="kildeid" type="tns:KILDEID"/>
	          <element minOccurs="0" maxOccurs="1" name="saksref" type="tns:SAKSREF"/>
        </sequence>
    </complexType>

</schema>
