<!--
		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="StaffTeachingGroupAssignmentType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating />
      </xs:appinfo>
      <xs:documentation>Records assignment of a Staff member to a particular role with a particular 
        TeachingGroup at a Provider</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="StaffTeachingGroupAssignmentRefId" minOccurs="0" nillable="true" type="RefIdType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The universally unique identifier for the data object record that is used across systems.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="StaffTeachingGroupAssignmentLocalId" minOccurs="0" nillable="true" type="LocalIdType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The Id of the data object record that was provided by the system that the information 
			was originally sourced from.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Status" minOccurs="0" type="NZCodeSetsStaffTeachingGroupAssignmentStatusType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>High</privacyRating>
          </xs:appinfo>
          <xs:documentation>States whether or not this is an inactive or active assignment for a staff member.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="StaffMember" minOccurs="0" type="ObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Generic object reference to the staff member, as represented in the StaffPersonal object. </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Provider" minOccurs="0" type="ProviderObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>A generic object reference to the Provider making the assignment.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TeachingGroup" minOccurs="0" type="ObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>A generic object reference to the TeachingGroup that the staff member is assigned to.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Role" minOccurs="0" type="NZCodeSetsStaffTeachingGroupRoleType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>Code denoting the role the staff member plays within the TeachingGroup, eg. ClassroomTeacher, SubjectTeacher, 
        ClassroomAide, etc.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="StartDate" minOccurs="0" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>This is the date from which the staff assignment is valid (inclusive).</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="EndDate" minOccurs="0" nillable="true" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>This is the date through which the staff assignment is valid (inclusive). This
          can be NULL when the staff member's assignment to a particular role is open-ended.</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:complexType>

  <xs:element name="StaffTeachingGroupAssignment" type="StaffTeachingGroupAssignmentType">
    <xs:unique name="StaffTeachingGroupAssignmentKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./StaffTeachingGroupAssignmentRefId" />
    </xs:unique>
  </xs:element>

  <xs:complexType name="StaffTeachingGroupAssignmentCollectionType">
    <xs:sequence>
      <xs:element name="StaffTeachingGroupAssignment" type="StaffTeachingGroupAssignmentType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="StaffTeachingGroupAssignments" type="StaffTeachingGroupAssignmentCollectionType" />

</xs:schema>