<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<xsd:annotation>
		<xsd:documentation>This schema file is part of the aseXML schema set, and is subject to the terms and conditions that are detailed in the aseXML_r*.xsd schema file with which this file is used</xsd:documentation>
	</xsd:annotation>
	<xsd:annotation>
		<xsd:documentation>
Purpose - Define the contents of the aseXML message header
Detail - Every aseXML message carries a header. It is used to indicate information pertaining to the message as a whole.
</xsd:documentation>
	</xsd:annotation>
	<!-- Support Types -->
	<xsd:simpleType name="MessageIdentifier">
		<xsd:annotation>
			<xsd:documentation>
Purpose - Uniquely identify every message generated by the message sender
Detail - Note that message identifiers do not have to be globally unique, only unique to a particular sender. However, the length has been chosen such that UUIDs can be used as message identifiers if considered appropriate, guaranteeing global uniqueness. 

A message acknowledgement identifies which message it is acknowledging by providing the message identifier as an attribute.
</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="1"/>
			<xsd:maxLength value="36"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="TransactionGroup">
		<xsd:annotation>
			<xsd:documentation>
Purpose - Provide the transaction group to which all the contained transactions or transaction acknowledgments belong
Detail - The target application is at liberty to reject any transactions within the message that do not belong to the stated TransactionGroup. Where only message acknowledgements are carried, a transaction group of "MSGS" should be used.
The following groups are B2B process related:
FLTS - Faults and Outages
SORD - Service order, planned works
NETB - Network billing
MTRD - Meter data 
CUST - Customer related
NOTF - Notifications (broadcast)
MKTW - Wholesale market operations
HSMD - High Speed Monitoring system
OWNP - Own Way Notification
	</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="CATS"/>
			<xsd:enumeration value="MDMT"/>
			<xsd:enumeration value="MSGS"/>
			<xsd:enumeration value="NMID"/>
			<xsd:enumeration value="FLTS"/>
			<xsd:enumeration value="SORD"/>
			<xsd:enumeration value="NETB"/>
			<xsd:enumeration value="MTRD"/>
			<xsd:enumeration value="CUST"/>
			<xsd:enumeration value="NOTF"/>
			<xsd:enumeration value="SITE"/>
			<xsd:enumeration value="FLDW"/>
			<xsd:enumeration value="OUTG"/>
			<xsd:enumeration value="BAR"/>
			<xsd:enumeration value="NMIF"/>
			<xsd:enumeration value="MKTW"/>
			<xsd:enumeration value="HSMD"/>
			<xsd:enumeration value="OWNP"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="TransactionPriority">
		<xsd:annotation>
			<xsd:documentation>
Purpose - Provide the processing priority desired by the sender
Detail - The sender can indicate their preference in terms of timeliness of processing for the payload. It is left to the discretion of the receiver to determine whether and how to honour the requested priority.
	</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="Priority">
			<xsd:enumeration value="High"/>
			<xsd:enumeration value="Medium"/>
			<xsd:enumeration value="Low"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="MessageSecurityContext">
		<xsd:annotation>
			<xsd:documentation>
Purpose - Provide the processing priority desired by the sender
Detail - The sender can indicate information needed by the receiver to determine whether or not the sender is authorised to submit the transactions within the message. 

For the Market Settlement And Transfer System (MSATS), this will be used to hold the participant userid from which the context for transaction processing is determined.
</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="15"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="EnergyMarket">
		<xsd:annotation>
			<xsd:documentation>
Purpose -Indicate the energy market to which the message belongs
Detail - Markets are currently defined for the National Electricity Market, the NSW Gas Market and the Victorian Gas Market.
</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="AATELEC"/>
			<xsd:enumeration value="ACTELEC"/>
			<xsd:enumeration value="NEM"/>
			<xsd:enumeration value="NSWELEC"/>
			<xsd:enumeration value="NTELEC"/>
			<xsd:enumeration value="QLDELEC"/>
			<xsd:enumeration value="SAELEC"/>
			<xsd:enumeration value="TASELEC"/>
			<xsd:enumeration value="VICELEC"/>
			<xsd:enumeration value="WAELEC"/>
			<xsd:enumeration value="AATGAS"/>
			<xsd:enumeration value="ACTGAS"/>
			<xsd:enumeration value="NSWGAS"/>
			<xsd:enumeration value="NTGAS"/>
			<xsd:enumeration value="QLDGAS"/>
			<xsd:enumeration value="SAGAS"/>
			<xsd:enumeration value="TASGAS"/>
			<xsd:enumeration value="VICGAS"/>
			<xsd:enumeration value="WAGAS"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- Main Types -->
	<xsd:complexType name="Header">
		<xsd:annotation>
			<xsd:documentation>
Purpose - Define the contents of the aseXML message header
Detail - Every aseXML message carries a header. It is used to indicate information pertaining to the message as a whole.
When not provided, a default value of NEM will be assumed for the market.  
</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="From" type="PartyIdentifier"/>
			<xsd:element name="To" type="PartyIdentifier"/>
			<xsd:element name="MessageID" type="MessageIdentifier"/>
			<xsd:element name="MessageDate" type="xsd:dateTime"/>
			<xsd:element name="TransactionGroup" type="TransactionGroup"/>
			<xsd:element name="Priority" type="TransactionPriority" minOccurs="0"/>
			<xsd:element name="SecurityContext" type="MessageSecurityContext" minOccurs="0"/>
			<xsd:element name="Market" type="EnergyMarket" default="NEM" minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
</xsd:schema>
