<!--
		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="ScheduleEventType">
    <xs:sequence>
      <xs:element name="ScheduleEventRefId" minOccurs="0" nillable="true" type="RefIdType" />
      <xs:element name="ScheduleEventLocalId" minOccurs="0" nillable="true" type="LocalIdType" />
      <xs:element name="Provider" minOccurs="0" type="ProviderObjectReferenceType" />
      <xs:element name="EventDate" minOccurs="0" type="xs:date" />
      <xs:element name="EventEndDate" minOccurs="0" nillable="true" type="xs:date" />
      <xs:element name="Duration" minOccurs="0" nillable="true" type="xs:int" />
      <xs:element name="EventTime" minOccurs="0" nillable="true" type="xs:time" />
      <xs:element name="EventName" minOccurs="0" type="xs:normalizedString" />
      <xs:element name="Location" minOccurs="0" nillable="true" type="xs:normalizedString" />
      <xs:element name="ScheduleEffect" minOccurs="0" type="NZCodeSetsScheduleEffectType" />
      <xs:element name="ScheduleList" minOccurs="0" nillable="true" type="ScheduleListType" />
      <xs:element name="ScheduleDayList" minOccurs="0" nillable="true" type="ScheduleDayListType" />
      <xs:element name="RemoveScheduleDayList" minOccurs="0" nillable="true" type="ScheduleDayListType" />
      <xs:element name="BellScheduleList" minOccurs="0" nillable="true" type="BellScheduleListType" />
      <xs:element name="RemoveBellScheduleList" minOccurs="0" nillable="true" type="BellScheduleListType" />
      <xs:element name="ScheduleTermList" minOccurs="0" nillable="true" type="ScheduleTermListType" />
      <xs:element name="CustomPeriodList" minOccurs="0" nillable="true" type="ScheduleCustomDayPeriodListType" />
      <xs:element name="RecordAudit" minOccurs="0" nillable="true" type="RecordAuditType" />
    </xs:sequence>
  </xs:complexType>

  <xs:element name="ScheduleEvent" type="ScheduleEventType">
    <xs:unique name="ScheduleEventKey1">
      <xs:selector xpath="." />
      <xs:field xpath="./ScheduleEventRefId" />
    </xs:unique>
  </xs:element>

  <xs:complexType name="ScheduleEventCollectionType">
    <xs:sequence>
      <xs:element name="ScheduleEvent" type="ScheduleEventType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="ScheduleEvents" type="ScheduleEventCollectionType" />

</xs:schema>