<!--
		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="ScheduleDateType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating>Low</privacyRating>
      </xs:appinfo>
      <xs:documentation>
			Provides information about the schedule that is being followed on a
			specific calendar date at a particular Provider, e.g. Academic Day A from the Term 1
			Schedule using the Periods and their start and end times defined
			in Bell Schedule Day A.
		</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="ScheduleDateRefId" 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="ScheduleDateLocalId" minOccurs="0" nillable="true" type="LocalIdType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Medium</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="CalendarDate" minOccurs="0" type="xs:date">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The actual date the school is in session.</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>The provider, e.g. school, tertiary institution etc, that this schedule date record belongs to.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Term" minOccurs="0" nillable="true" type="ObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The Term in session on this calendar date.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Schedule" minOccurs="0" type="ObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The schedule within the provider to which this ScheduleDate applies.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="AcademicDay" minOccurs="0" type="ObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The academic day from the schedule that is taking place on this calendar date.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="BellSchedule" minOccurs="0" nillable="true" type="ObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The bell schedule that the provider used on this calendar date.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TeachingGroupEventList" minOccurs="0" nillable="true" type="TeachingGroupEventListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>List of generic object references to the set of TeachingGroupEvents that take place on this calendar date.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="SchedulePeriodList" minOccurs="0" nillable="true" type="SchedulePeriodTimeListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>O</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>A list of the periods that took place on this scheduled date and their start and end times.</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="ScheduleDate" type="ScheduleDateType">
    <xs:unique name="ScheduleDateKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./ScheduleDateRefId" />
    </xs:unique>
  </xs:element>

  <xs:complexType name="ScheduleDateCollectionType">
    <xs:sequence>
      <xs:element name="ScheduleDate" type="ScheduleDateType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="ScheduleDates" type="ScheduleDateCollectionType" />

</xs:schema>