<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
  <edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.xml">
    <edmx:Include Namespace="Org.OData.Core.V1" Alias="Core"/>
  </edmx:Reference>
  <edmx:DataServices>
    <Schema Namespace="ZazukoShop.Orders" xmlns="http://docs.oasis-open.org/odata/ns/edm">
      <EntityType Name="Order">
        <Key><PropertyRef Name="OrderID"/></Key>
        <Property Name="OrderID" Type="Edm.String" Nullable="false" MaxLength="10"/>
        <Property Name="CustomerID" Type="Edm.String" Nullable="false" MaxLength="10">
          <Annotation Term="Core.Description" String="References a customer of the Customers REST API (/api/v1/customers/{id})"/>
        </Property>
        <Property Name="OrderDate" Type="Edm.Date" Nullable="false"/>
        <Property Name="Status" Type="Edm.String" Nullable="false">
          <Annotation Term="Core.Description" String="OPEN | PROCESSING | SHIPPED | DELIVERED | CANCELLED"/>
        </Property>
        <Property Name="Currency" Type="Edm.String" Nullable="false" MaxLength="3"/>
        <Property Name="TotalAmount" Type="Edm.Decimal" Nullable="false" Precision="12" Scale="2"/>
        <Property Name="ItemCount" Type="Edm.Int32" Nullable="false"/>
        <NavigationProperty Name="Items" Type="Collection(ZazukoShop.Orders.OrderItem)" Partner="Order">
        </NavigationProperty>
      </EntityType>
      <EntityType Name="OrderItem">
        <Key><PropertyRef Name="ItemID"/></Key>
        <Property Name="ItemID" Type="Edm.String" Nullable="false" MaxLength="16"/>
        <Property Name="OrderID" Type="Edm.String" Nullable="false" MaxLength="10"/>
        <Property Name="LineNo" Type="Edm.Int32" Nullable="false"/>
        <Property Name="ProductID" Type="Edm.String" Nullable="false" MaxLength="10">
          <Annotation Term="Core.Description" String="References a product of the Products GraphQL API (product(id:))"/>
        </Property>
        <Property Name="Quantity" Type="Edm.Int32" Nullable="false"/>
        <Property Name="UnitPrice" Type="Edm.Decimal" Nullable="false" Precision="12" Scale="2"/>
        <Property Name="LineAmount" Type="Edm.Decimal" Nullable="false" Precision="12" Scale="2"/>
        <NavigationProperty Name="Order" Type="ZazukoShop.Orders.Order" Partner="Items" Nullable="false">
          <ReferentialConstraint Property="OrderID" ReferencedProperty="OrderID"/>
        </NavigationProperty>
      </EntityType>
      <EntityContainer Name="OrderService">
        <EntitySet Name="Orders" EntityType="ZazukoShop.Orders.Order">
          <NavigationPropertyBinding Path="Items" Target="OrderItems"/>
        </EntitySet>
        <EntitySet Name="OrderItems" EntityType="ZazukoShop.Orders.OrderItem">
          <NavigationPropertyBinding Path="Order" Target="Orders"/>
        </EntitySet>
      </EntityContainer>
    </Schema>
  </edmx:DataServices>
</edmx:Edmx>
