<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="27.0">
	<xs:include schemaLocation = "../enum/periodTypeEnum.xsd"/>
	<xs:element name="propertyMetrics" type="propertyMetricsType">
		<xs:annotation>
			<xs:documentation>All metrics reflect the 12 months ending on the given month and year.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:complexType name="propertyMetricsType">
		<xs:sequence>
			<xs:element name="metric" type="metric" minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
		<xs:attribute name="year" type="xs:integer">
			<xs:annotation>
				<xs:documentation>The year of the period ending date for the set of metrics.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="month">
			<xs:annotation>
				<xs:documentation>The month of the period ending date for the set of metrics.</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:integer">
					<xs:minInclusive value="1"/>
					<xs:maxInclusive value="12"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="periodType" type="periodType">
			<xs:annotation>
				<xs:documentation>The predefined period type used to generate the report metric</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="propertyId" type="xs:long">
			<xs:annotation>
				<xs:documentation>The id of the property.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>

	<xs:complexType name="metric">
		<xs:sequence>
			<xs:element name="monthlyMetric" type="reportMetricValuesWs" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>The value of the Monthly metric.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="value" nillable="true" type="xs:string" minOccurs="0">
				<xs:annotation>
					<xs:documentation>The value of the Non-Monthly metric.</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="name" type="xs:string">
			<xs:annotation>
				<xs:documentation>The name of the metric.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="id" type="xs:long" >
			<xs:annotation>
				<xs:documentation>The id of the metric.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="uom" type="xs:string">
			<xs:annotation>
				<xs:documentation>The unit of measure of the metric.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="dataType" type="dataType">
			<xs:annotation>
				<xs:documentation>The data type of the value for the metric (i.e., string, numeric, date).</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="autoGenerated" type="xs:boolean">
			<xs:annotation>
				<xs:documentation>Indicates whether the metric is automatically generated by the system.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>

	<xs:complexType name="reportMetricValuesWs">
		<xs:sequence>
			<xs:element name="value" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>The value of the Monthly metric.</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="month" type="xs:string">
			<xs:annotation>
				<xs:documentation>The month of the period ending date for the set of metrics.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="year" type="xs:string">
			<xs:annotation>
				<xs:documentation>The year of the period ending date for the set of metrics.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="periodType" type="periodType">
			<xs:annotation>
				<xs:documentation>The predefined period type used to generate the report metric</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="autoGenerated" type="xs:boolean">
			<xs:annotation>
				<xs:documentation>Indicates whether the metric is automatically generated by the system.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>

	<xs:simpleType name="dataType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="date"/>
			<xs:enumeration value="numeric"/>
			<xs:enumeration value="string"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>
