<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns:tns="http://minameddelanden.gov.se/schema/Authority/v4"
        xmlns:commonv4="http://minameddelanden.gov.se/schema/Common/v4"
        targetNamespace="http://minameddelanden.gov.se/schema/Authority/v4"
        elementFormDefault="qualified"
        xmlns="http://www.w3.org/2001/XMLSchema">

    <import namespace="http://minameddelanden.gov.se/schema/Common/v4" schemaLocation="Common.xsd"/>

    <element name="signatureAuthorizationResult">
        <complexType>
            <sequence>
                <element ref="commonv4:recipientId" minOccurs="0">
                    <annotation>
                        <documentation xml:lang="sv">Mottagaridentitet</documentation>
                    </annotation>
                </element>
                <element name="signedBy" type="commonv4:signerType" minOccurs="0" maxOccurs="unbounded">
                    <annotation>
                        <documentation xml:lang="sv">Lista med personer som har signerat.</documentation>
                    </annotation>
                </element>
                <element name="authorizationStatus" type="tns:authorizationStatusType" minOccurs="0">
                    <annotation>
                        <documentation xml:lang="sv">Complete om firmateckning uppfylls,
                            Incomplete om det behövs fler signaturer.
                            Om firmateckningsreglerna inte stöds är
                            status RulesNotSupported.
                        </documentation>
                    </annotation>
                </element>
                <element name="Timestamp" type="dateTime" minOccurs="0">
                    <annotation>
                        <documentation xml:lang="sv">Tidstämpel för senaste signering.</documentation>
                    </annotation>
                </element>
                <element name="text" type="string" minOccurs="0">
                    <annotation>
                        <documentation xml:lang="sv">Firmateckningskonstruktion i klartext.
                            Uppgifterna tas från Bolagsverkets
                            register över firmatecknare.
                        </documentation>
                    </annotation>
                </element>
                <element name="possibleSigners" type="commonv4:signerType" minOccurs="0" maxOccurs="unbounded">
                    <annotation>
                        <documentation xml:lang="sv">Lista med personer vars underskrift ff.
                            kan krävas för att firmateckning skall
                            uppfyllas enligt Bolagsverkets register.
                        </documentation>
                    </annotation>
                </element>
            </sequence>
        </complexType>
    </element>

    <simpleType name="authorizationStatusType">
        <annotation>
            <documentation xml:lang="en"></documentation>
            <documentation xml:lang="sv">Anger om avtalet är komplett signerat, dvs om de signaturer som hittills
                inkommit i kombination med signatur från den omfrågade gör att firmateckningsreglerna uppfylls
                (detta innebär dock inte att kontot redan är aktivt).
            </documentation>
        </annotation>
        <restriction base="string">
            <enumeration value="Complete">
                <annotation>
                    <documentation xml:lang="en">The provided data is sufficient for complete signing of the document.
                    </documentation>
                    <documentation xml:lang="sv">Inskickad data är tillräcklig för fullständig firmateckning
                    </documentation>
                </annotation>
            </enumeration>
            <enumeration value="Incomplete">
                <annotation>
                    <documentation xml:lang="en">The provided data is insufficient for complete signing of the
                        document.
                    </documentation>
                    <documentation xml:lang="sv">Inskickad data måste kompletteras för fullständig firmateckning.
                    </documentation>
                </annotation>
            </enumeration>
            <enumeration value="RulesNotSupported">
                <annotation>
                    <documentation xml:lang="en">The provided data could not be interpreted.</documentation>
                    <documentation xml:lang="sv">Firmateckningsreglerna går inte att tolka.</documentation>
                </annotation>
            </enumeration>
        </restriction>
    </simpleType>

</schema>
