<!--
		SIF Implementation Specification (New Zealand) 3.1
		(8 December, 2020
)
		
		Infrastructure Version: v3.1
	-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sifassociation.org/datamodel/nz/3.1" targetNamespace="http://www.sifassociation.org/datamodel/nz/3.1" elementFormDefault="qualified" version="3.1 (rc 5)">
  <xs:complexType name="OrganisationType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating>Low</privacyRating>
      </xs:appinfo>
      <xs:documentation>
			A generic organisation that operates within the education sector; but doesn’t provide education 
			services. e.g. Communities of Learning | Kāhui Ako, Ministry local offices, 
			Industry training organisations, etc. 
		</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="EduOrganisationType">
        <xs:sequence>
          <xs:element name="OrganisationRefId" type="MoEOrgIdType">
            <xs:annotation>
              <xs:appinfo>
                <sifChar>M</sifChar>
                <privacyRating>Low</privacyRating>
              </xs:appinfo>
              <xs:documentation>1 to 5 digit Ministry Organisation Id for the Organisation, without leading zeros</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="RecordAudit" minOccurs="0" nillable="true" type="RecordAuditType">
            <xs:annotation>
              <xs:appinfo>
                <sifChar>O</sifChar>
                <privacyRating>Low</privacyRating>
              </xs:appinfo>
              <xs:documentation>The audit details for a record, e.g. Created/Last Updated DateTime and Created/Last Updated By.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:element name="Organisation" type="OrganisationType">
    <xs:key name="OrganisationKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./OrganisationRefId" />
    </xs:key>
  </xs:element>

  <xs:complexType name="OrganisationCollectionType">
    <xs:sequence>
      <xs:element name="Organisation" type="OrganisationType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="Organisations" type="OrganisationCollectionType" />

</xs:schema>