<?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.Capabilities.V1.xml">
    <edmx:Include Alias="Capabilities" Namespace="Org.OData.Capabilities.V1"/>
  </edmx:Reference>
  <edmx:Reference Uri="https://sap.github.io/odata-vocabularies/vocabularies/Common.xml">
    <edmx:Include Alias="Common" Namespace="com.sap.vocabularies.Common.v1"/>
  </edmx:Reference>
  <edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.xml">
    <edmx:Include Alias="Core" Namespace="Org.OData.Core.V1"/>
  </edmx:Reference>
  <edmx:Reference Uri="https://sap.github.io/odata-vocabularies/vocabularies/UI.xml">
    <edmx:Include Alias="UI" Namespace="com.sap.vocabularies.UI.v1"/>
  </edmx:Reference>
  <edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Validation.V1.xml">
    <edmx:Include Alias="Validation" Namespace="Org.OData.Validation.V1"/>
  </edmx:Reference>
  <edmx:DataServices>
    <Schema Namespace="BatchService" xmlns="http://docs.oasis-open.org/odata/ns/edm">
      <Annotation Term="Core.Links">
        <Collection>
          <Record>
            <PropertyValue Property="rel" String="author"/>
            <PropertyValue Property="href" String="https://cap.cloud.sap"/>
          </Record>
        </Collection>
      </Annotation>
      <EntityContainer Name="EntityContainer">
        <EntitySet Name="Batches" EntityType="BatchService.Batches">
          <NavigationPropertyBinding Path="lines" Target="Lines"/>
        </EntitySet>
        <EntitySet Name="Lines" EntityType="BatchService.Lines">
          <NavigationPropertyBinding Path="batch" Target="Batches"/>
        </EntitySet>
        <EntitySet Name="BatchSummary" EntityType="BatchService.BatchSummary"/>
      </EntityContainer>
      <EntityType Name="Batches">
        <Key>
          <PropertyRef Name="ID"/>
        </Key>
        <Property Name="ID" Type="Edm.Guid" Nullable="false"/>
        <Property Name="createdAt" Type="Edm.DateTimeOffset" Precision="7"/>
        <Property Name="createdBy" Type="Edm.String" MaxLength="255"/>
        <Property Name="modifiedAt" Type="Edm.DateTimeOffset" Precision="7"/>
        <Property Name="modifiedBy" Type="Edm.String" MaxLength="255"/>
        <Property Name="batchName" Type="Edm.String" MaxLength="100"/>
        <Property Name="docType" Type="Edm.String" MaxLength="10"/>
        <Property Name="status" Type="Edm.String" MaxLength="12" DefaultValue="Uploaded"/>
        <Property Name="idempotencyKey" Type="Edm.String" MaxLength="100"/>
        <Property Name="docRef" Type="Edm.String" MaxLength="100"/>
        <Property Name="cardCode" Type="Edm.String" MaxLength="50"/>
        <Property Name="warehouse" Type="Edm.String" MaxLength="20"/>
        <Property Name="baseDocRef" Type="Edm.String" MaxLength="50"/>
        <Property Name="operator" Type="Edm.String" MaxLength="100"/>
        <Property Name="comments" Type="Edm.String" MaxLength="255"/>
        <Property Name="sourceHost" Type="Edm.String" MaxLength="100"/>
        <Property Name="uploadedAt" Type="Edm.DateTimeOffset" Precision="7"/>
        <Property Name="approvedBy" Type="Edm.String" MaxLength="100"/>
        <Property Name="approvedAt" Type="Edm.DateTimeOffset" Precision="7"/>
        <Property Name="approvalComment" Type="Edm.String" MaxLength="500"/>
        <Property Name="sapDocEntry" Type="Edm.Int32"/>
        <Property Name="sapDocNum" Type="Edm.Int32"/>
        <Property Name="lastError" Type="Edm.String" MaxLength="1000"/>
        <NavigationProperty Name="lines" Type="Collection(BatchService.Lines)" Partner="batch">
          <OnDelete Action="Cascade"/>
        </NavigationProperty>
      </EntityType>
      <EntityType Name="Lines">
        <Key>
          <PropertyRef Name="ID"/>
        </Key>
        <Property Name="ID" Type="Edm.Guid" Nullable="false"/>
        <NavigationProperty Name="batch" Type="BatchService.Batches" Partner="lines">
          <ReferentialConstraint Property="batch_ID" ReferencedProperty="ID"/>
        </NavigationProperty>
        <Property Name="batch_ID" Type="Edm.Guid"/>
        <Property Name="lineNo" Type="Edm.Int32"/>
        <Property Name="scannedBarcode" Type="Edm.String" MaxLength="100"/>
        <Property Name="itemCode" Type="Edm.String" MaxLength="50"/>
        <Property Name="itemName" Type="Edm.String" MaxLength="200"/>
        <Property Name="quantity" Type="Edm.Decimal" Precision="15" Scale="4"/>
        <Property Name="uom" Type="Edm.String" MaxLength="20"/>
        <Property Name="warehouse" Type="Edm.String" MaxLength="20"/>
        <Property Name="batchNumber" Type="Edm.String" MaxLength="50"/>
        <Property Name="serial" Type="Edm.String" MaxLength="50"/>
        <Property Name="unitPrice" Type="Edm.Decimal" Precision="15" Scale="4"/>
        <Property Name="scannedBy" Type="Edm.String" MaxLength="100"/>
        <Property Name="scannedAt" Type="Edm.DateTimeOffset" Precision="7"/>
        <Property Name="source" Type="Edm.String" MaxLength="50"/>
        <Property Name="validationStatus" Type="Edm.String" MaxLength="20"/>
        <Property Name="validationMessage" Type="Edm.String" MaxLength="255"/>
      </EntityType>
      <EntityType Name="BatchSummary">
        <Key>
          <PropertyRef Name="ID"/>
        </Key>
        <Property Name="ID" Type="Edm.Guid" Nullable="false"/>
        <Property Name="batchName" Type="Edm.String" MaxLength="100"/>
        <Property Name="docType" Type="Edm.String" MaxLength="10"/>
        <Property Name="status" Type="Edm.String" MaxLength="12" DefaultValue="Uploaded"/>
        <Property Name="cardCode" Type="Edm.String" MaxLength="50"/>
        <Property Name="warehouse" Type="Edm.String" MaxLength="20"/>
        <Property Name="operator" Type="Edm.String" MaxLength="100"/>
        <Property Name="uploadedAt" Type="Edm.DateTimeOffset" Precision="7"/>
        <Property Name="sapDocNum" Type="Edm.Int32"/>
      </EntityType>
      <Action Name="approve" IsBound="true" EntitySetPath="in">
        <Parameter Name="in" Type="BatchService.Batches"/>
        <Parameter Name="comment" Type="Edm.String"/>
        <ReturnType Type="BatchService.Batches"/>
      </Action>
      <Action Name="archive" IsBound="true" EntitySetPath="in">
        <Parameter Name="in" Type="BatchService.Batches"/>
        <Parameter Name="comment" Type="Edm.String"/>
        <ReturnType Type="BatchService.Batches"/>
      </Action>
      <Action Name="restore" IsBound="true" EntitySetPath="in">
        <Parameter Name="in" Type="BatchService.Batches"/>
        <ReturnType Type="BatchService.Batches"/>
      </Action>
      <Action Name="postToSap" IsBound="true" EntitySetPath="in">
        <Parameter Name="in" Type="BatchService.Batches"/>
        <ReturnType Type="BatchService.Batches"/>
      </Action>
      <Annotations Target="BatchService.Batches/ID">
        <Annotation Term="Core.ComputedDefaultValue" Bool="true"/>
      </Annotations>
      <Annotations Target="BatchService.Batches/createdAt">
        <Annotation Term="UI.HiddenFilter" Bool="true"/>
        <Annotation Term="UI.ExcludeFromNavigationContext" Bool="true"/>
        <Annotation Term="Core.Immutable" Bool="true"/>
        <Annotation Term="Core.Computed" Bool="true"/>
        <Annotation Term="Common.Label" String="Created On"/>
      </Annotations>
      <Annotations Target="BatchService.Batches/createdBy">
        <Annotation Term="UI.HiddenFilter" Bool="true"/>
        <Annotation Term="UI.ExcludeFromNavigationContext" Bool="true"/>
        <Annotation Term="Core.Immutable" Bool="true"/>
        <Annotation Term="Core.Computed" Bool="true"/>
        <Annotation Term="Core.Description" String="User's unique ID"/>
        <Annotation Term="Common.Label" String="Created By"/>
      </Annotations>
      <Annotations Target="BatchService.Batches/modifiedAt">
        <Annotation Term="UI.HiddenFilter" Bool="true"/>
        <Annotation Term="UI.ExcludeFromNavigationContext" Bool="true"/>
        <Annotation Term="Core.Computed" Bool="true"/>
        <Annotation Term="Common.Label" String="Changed On"/>
      </Annotations>
      <Annotations Target="BatchService.Batches/modifiedBy">
        <Annotation Term="UI.HiddenFilter" Bool="true"/>
        <Annotation Term="UI.ExcludeFromNavigationContext" Bool="true"/>
        <Annotation Term="Core.Computed" Bool="true"/>
        <Annotation Term="Core.Description" String="User's unique ID"/>
        <Annotation Term="Common.Label" String="Changed By"/>
      </Annotations>
      <Annotations Target="BatchService.Batches/docType">
        <Annotation Term="Validation.AllowedValues">
          <Collection>
            <Record Type="Validation.AllowedValue">
              <Annotation Term="Core.SymbolicName" String="PO"/>
              <PropertyValue Property="Value" String="PO"/>
            </Record>
            <Record Type="Validation.AllowedValue">
              <Annotation Term="Core.SymbolicName" String="GRPO"/>
              <PropertyValue Property="Value" String="GRPO"/>
            </Record>
            <Record Type="Validation.AllowedValue">
              <Annotation Term="Core.SymbolicName" String="Counting"/>
              <PropertyValue Property="Value" String="Counting"/>
            </Record>
          </Collection>
        </Annotation>
      </Annotations>
      <Annotations Target="BatchService.Batches/status">
        <Annotation Term="Validation.AllowedValues">
          <Collection>
            <Record Type="Validation.AllowedValue">
              <Annotation Term="Core.SymbolicName" String="Uploaded"/>
              <PropertyValue Property="Value" String="Uploaded"/>
            </Record>
            <Record Type="Validation.AllowedValue">
              <Annotation Term="Core.SymbolicName" String="Approved"/>
              <PropertyValue Property="Value" String="Approved"/>
            </Record>
            <Record Type="Validation.AllowedValue">
              <Annotation Term="Core.SymbolicName" String="Archived"/>
              <PropertyValue Property="Value" String="Archived"/>
            </Record>
            <Record Type="Validation.AllowedValue">
              <Annotation Term="Core.SymbolicName" String="Posting"/>
              <PropertyValue Property="Value" String="Posting"/>
            </Record>
            <Record Type="Validation.AllowedValue">
              <Annotation Term="Core.SymbolicName" String="Posted"/>
              <PropertyValue Property="Value" String="Posted"/>
            </Record>
            <Record Type="Validation.AllowedValue">
              <Annotation Term="Core.SymbolicName" String="PostFailed"/>
              <PropertyValue Property="Value" String="PostFailed"/>
            </Record>
          </Collection>
        </Annotation>
      </Annotations>
      <Annotations Target="BatchService.Lines/ID">
        <Annotation Term="Core.ComputedDefaultValue" Bool="true"/>
      </Annotations>
      <Annotations Target="BatchService.EntityContainer/BatchSummary">
        <Annotation Term="Capabilities.DeleteRestrictions">
          <Record Type="Capabilities.DeleteRestrictionsType">
            <PropertyValue Property="Deletable" Bool="false"/>
          </Record>
        </Annotation>
        <Annotation Term="Capabilities.InsertRestrictions">
          <Record Type="Capabilities.InsertRestrictionsType">
            <PropertyValue Property="Insertable" Bool="false"/>
          </Record>
        </Annotation>
        <Annotation Term="Capabilities.UpdateRestrictions">
          <Record Type="Capabilities.UpdateRestrictionsType">
            <PropertyValue Property="Updatable" Bool="false"/>
          </Record>
        </Annotation>
      </Annotations>
      <Annotations Target="BatchService.BatchSummary/ID">
        <Annotation Term="Core.ComputedDefaultValue" Bool="true"/>
      </Annotations>
      <Annotations Target="BatchService.BatchSummary/docType">
        <Annotation Term="Validation.AllowedValues">
          <Collection>
            <Record Type="Validation.AllowedValue">
              <Annotation Term="Core.SymbolicName" String="PO"/>
              <PropertyValue Property="Value" String="PO"/>
            </Record>
            <Record Type="Validation.AllowedValue">
              <Annotation Term="Core.SymbolicName" String="GRPO"/>
              <PropertyValue Property="Value" String="GRPO"/>
            </Record>
            <Record Type="Validation.AllowedValue">
              <Annotation Term="Core.SymbolicName" String="Counting"/>
              <PropertyValue Property="Value" String="Counting"/>
            </Record>
          </Collection>
        </Annotation>
      </Annotations>
      <Annotations Target="BatchService.BatchSummary/status">
        <Annotation Term="Validation.AllowedValues">
          <Collection>
            <Record Type="Validation.AllowedValue">
              <Annotation Term="Core.SymbolicName" String="Uploaded"/>
              <PropertyValue Property="Value" String="Uploaded"/>
            </Record>
            <Record Type="Validation.AllowedValue">
              <Annotation Term="Core.SymbolicName" String="Approved"/>
              <PropertyValue Property="Value" String="Approved"/>
            </Record>
            <Record Type="Validation.AllowedValue">
              <Annotation Term="Core.SymbolicName" String="Archived"/>
              <PropertyValue Property="Value" String="Archived"/>
            </Record>
            <Record Type="Validation.AllowedValue">
              <Annotation Term="Core.SymbolicName" String="Posting"/>
              <PropertyValue Property="Value" String="Posting"/>
            </Record>
            <Record Type="Validation.AllowedValue">
              <Annotation Term="Core.SymbolicName" String="Posted"/>
              <PropertyValue Property="Value" String="Posted"/>
            </Record>
            <Record Type="Validation.AllowedValue">
              <Annotation Term="Core.SymbolicName" String="PostFailed"/>
              <PropertyValue Property="Value" String="PostFailed"/>
            </Record>
          </Collection>
        </Annotation>
      </Annotations>
    </Schema>
  </edmx:DataServices>
</edmx:Edmx>