<!--
		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="BellScheduleType">
    <xs:annotation>
      <xs:appinfo>
        <sifChar />
        <privacyRating>Low</privacyRating>
      </xs:appinfo>
      <xs:documentation>
			Defines bell schedules, each of which is a collection of periods
			within an academic day with start and end times associated. These bell
			schedules are assigned to calendar dates
			on which the school is in session using ScheduleDate in order to
			specify the school schedule on those dates. These bell schedules
			should generally only be used to define standard day
			types. Exception days (unless they repeat multiple times and
			follow a common template) are defined using ScheduleEvent and
			ScheduleCustomDayEvent.
		</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="BellScheduleRefId" 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="BellScheduleLocalId" 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="BellScheduleName" type="xs:normalizedString">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The name of the Bell Schedule.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Provider" type="ProviderObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The provider the bell schedule belongs to.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Schedule" type="ObjectReferenceType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>The provider schedule the bell schedule belongs to.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="SchedulePeriodList" type="SchedulePeriodTimeListType">
        <xs:annotation>
          <xs:appinfo>
            <sifChar>M</sifChar>
            <privacyRating>Low</privacyRating>
          </xs:appinfo>
          <xs:documentation>A list of periods that make up this academic day, e.g. Period 1, Period 2 etc.</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="BellSchedule" type="BellScheduleType">
    <xs:key name="BellScheduleKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./BellScheduleRefId" />
    </xs:key>
  </xs:element>

  <xs:complexType name="BellScheduleCollectionType">
    <xs:sequence>
      <xs:element name="BellSchedule" type="BellScheduleType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="BellSchedules" type="BellScheduleCollectionType" />

</xs:schema>