<?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://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:DataServices>
    <Schema Namespace="CashAdvanceService" xmlns="http://docs.oasis-open.org/odata/ns/edm">
      <EntityContainer Name="EntityContainer">
        <EntitySet Name="CashAdvanceFields" EntityType="CashAdvanceService.CashAdvanceFields"/>
        <EntitySet Name="CashAdvanceEntries" EntityType="CashAdvanceService.CashAdvanceEntries"/>
        <EntitySet Name="TravelRequestExpenses" EntityType="CashAdvanceService.TravelRequestExpenses"/>
        <EntitySet Name="CashAdvanceWorkflow" EntityType="CashAdvanceService.CashAdvanceWorkflow">
          <NavigationPropertyBinding Path="cashAdvance" Target="CashAdvanceEntries"/>
        </EntitySet>
        <EntitySet Name="RequestEmployeeApproverMappings" EntityType="CashAdvanceService.RequestEmployeeApproverMappings"/>
        <ActionImport Name="saveOrUpdateCashAdvanceEntities" Action="CashAdvanceService.saveOrUpdateCashAdvanceEntities"/>
        <ActionImport Name="processCashAdvanceApproval" Action="CashAdvanceService.processCashAdvanceApproval"/>
        <ActionImport Name="updateRequiredFields" Action="CashAdvanceService.updateRequiredFields"/>
        <ActionImport Name="getTotalEstimatedAmount" Action="CashAdvanceService.getTotalEstimatedAmount"/>
        <ActionImport Name="approveCashAdvanceRequest" Action="CashAdvanceService.approveCashAdvanceRequest"/>
      </EntityContainer>
      <EntityType Name="CashAdvanceFields">
        <Key>
          <PropertyRef Name="ID"/>
        </Key>
        <Property Name="ID" Type="Edm.Guid" Nullable="false"/>
        <Property Name="name" Type="Edm.String" MaxLength="100"/>
        <Property Name="required_fields" Type="Edm.String" MaxLength="4000"/>
        <Property Name="required_field_options" Type="Edm.String" MaxLength="4000"/>
        <Property Name="core_fields" Type="Edm.String" MaxLength="4000"/>
        <Property Name="core_field_options" Type="Edm.String" MaxLength="4000"/>
      </EntityType>
      <EntityType Name="CashAdvanceEntries">
        <Key>
          <PropertyRef Name="ID"/>
        </Key>
        <Property Name="ID" Type="Edm.Guid" Nullable="false"/>
        <Property Name="name" Type="Edm.String" MaxLength="100"/>
        <Property Name="reject_comments" Type="Edm.String" MaxLength="255"/>
        <Property Name="reply_comments" Type="Edm.String" MaxLength="255"/>
        <Property Name="details" Type="Edm.String"/>
        <Property Name="status" Type="Edm.String" MaxLength="50" DefaultValue="Pending"/>
        <Property Name="created_at" Type="Edm.DateTimeOffset" Precision="7"/>
        <Property Name="updated_at" Type="Edm.DateTimeOffset" Precision="7"/>
        <Property Name="userId_ID" Type="Edm.Guid"/>
        <Property Name="approverId_ID" Type="Edm.Guid"/>
        <Property Name="policy_ID" Type="Edm.Guid"/>
        <Property Name="warnings" Type="Edm.String" MaxLength="1000"/>
        <Property Name="isEscalated" Type="Edm.Boolean"/>
        <Property Name="travelRequest_ID" Type="Edm.Guid"/>
      </EntityType>
      <EntityType Name="TravelRequestExpenses">
        <Key>
          <PropertyRef Name="ID"/>
        </Key>
        <Property Name="ID" Type="Edm.Guid" Nullable="false"/>
        <Property Name="travelRequestEntries_ID" Type="Edm.Guid"/>
        <Property Name="expenseType_ID" Type="Edm.Guid"/>
        <Property Name="estimated_amount" Type="Edm.Decimal" Precision="15" Scale="2"/>
        <Property Name="details" Type="Edm.String"/>
        <Property Name="created_at" Type="Edm.DateTimeOffset" Precision="7"/>
        <Property Name="updated_at" Type="Edm.DateTimeOffset" Precision="7"/>
        <Property Name="file_path" Type="Edm.String" MaxLength="2000"/>
        <Property Name="assigned_tmc_ID" Type="Edm.Guid"/>
        <Property Name="assigned_ca_admin_ID" Type="Edm.Guid"/>
      </EntityType>
      <EntityType Name="CashAdvanceWorkflow">
        <Key>
          <PropertyRef Name="ID"/>
        </Key>
        <Property Name="ID" Type="Edm.Guid" Nullable="false"/>
        <NavigationProperty Name="cashAdvance" Type="CashAdvanceService.CashAdvanceEntries">
          <ReferentialConstraint Property="cashAdvance_ID" ReferencedProperty="ID"/>
        </NavigationProperty>
        <Property Name="cashAdvance_ID" Type="Edm.Guid"/>
        <Property Name="employee_ID" Type="Edm.Guid"/>
        <Property Name="policy_ID" Type="Edm.Guid"/>
        <Property Name="approver_ID" Type="Edm.Guid"/>
        <Property Name="approverLevel_ID" Type="Edm.Guid"/>
        <Property Name="order" Type="Edm.Int32"/>
        <Property Name="status" Type="Edm.String" MaxLength="50" DefaultValue="Pending"/>
        <Property Name="isCompleted" Type="Edm.Boolean" DefaultValue="false"/>
        <Property Name="isEscalated" Type="Edm.Boolean" DefaultValue="false"/>
        <Property Name="isWorkflow" Type="Edm.Boolean" DefaultValue="false"/>
        <Property Name="created_at" Type="Edm.DateTimeOffset" Precision="7"/>
        <Property Name="updated_at" Type="Edm.DateTimeOffset" Precision="7"/>
      </EntityType>
      <EntityType Name="RequestEmployeeApproverMappings">
        <Key>
          <PropertyRef Name="ID"/>
        </Key>
        <Property Name="ID" Type="Edm.Guid" Nullable="false"/>
        <Property Name="user_ID" Type="Edm.Guid"/>
        <Property Name="group_ID" Type="Edm.Guid"/>
        <Property Name="policy_ID" Type="Edm.Guid"/>
        <Property Name="approverLevel_ID" Type="Edm.Guid"/>
        <Property Name="approver_ID" Type="Edm.Guid"/>
        <Property Name="order" Type="Edm.Int32"/>
        <Property Name="created_at" Type="Edm.DateTimeOffset" Precision="7"/>
        <Property Name="updated_at" Type="Edm.DateTimeOffset" Precision="7"/>
      </EntityType>
      <ComplexType Name="CashAdvanceInputType">
        <Property Name="ID" Type="Edm.Guid"/>
        <Property Name="request_name" Type="Edm.String" MaxLength="100"/>
        <Property Name="details" Type="Edm.String"/>
        <Property Name="comment" Type="Edm.String" MaxLength="255"/>
        <Property Name="reject_comments" Type="Edm.String" MaxLength="255"/>
        <Property Name="reply_comments" Type="Edm.String" MaxLength="255"/>
        <Property Name="status" Type="Edm.String" MaxLength="50"/>
        <Property Name="created_at" Type="Edm.DateTimeOffset" Precision="7"/>
        <Property Name="updated_at" Type="Edm.DateTimeOffset" Precision="7"/>
        <Property Name="userId_ID" Type="Edm.Guid"/>
        <Property Name="approverId_ID" Type="Edm.Guid"/>
        <Property Name="policy_ID" Type="Edm.Guid"/>
        <Property Name="warnings" Type="Collection(Edm.String)" Nullable="false"/>
        <Property Name="isEscalated" Type="Edm.Boolean"/>
        <Property Name="file_path" Type="Edm.String" MaxLength="2000"/>
        <Property Name="travelRequest_ID" Type="Edm.Guid"/>
        <Property Name="recall" Type="Edm.String" MaxLength="10"/>
      </ComplexType>
      <Action Name="saveOrUpdateCashAdvanceEntities" IsBound="false">
        <Parameter Name="data" Type="CashAdvanceService.CashAdvanceInputType"/>
        <ReturnType Type="Edm.String"/>
      </Action>
      <Action Name="processCashAdvanceApproval" IsBound="false">
        <Parameter Name="cashAdvance_ID" Type="Edm.Guid"/>
        <Parameter Name="status" Type="Edm.String"/>
        <Parameter Name="comment" Type="Edm.String"/>
        <ReturnType Type="Edm.String"/>
      </Action>
      <Action Name="updateRequiredFields" IsBound="false">
        <Parameter Name="id" Type="Edm.String"/>
        <Parameter Name="required_fields" Type="Edm.String"/>
        <Parameter Name="required_field_options" Type="Edm.String"/>
        <ReturnType Type="Edm.String"/>
      </Action>
      <Action Name="getTotalEstimatedAmount" IsBound="false">
        <Parameter Name="travelRequestId" Type="Edm.Guid"/>
        <ReturnType Type="Edm.Decimal" Scale="variable"/>
      </Action>
      <Action Name="approveCashAdvanceRequest" IsBound="false">
        <Parameter Name="travelRequest_ID" Type="Edm.Guid"/>
        <ReturnType Type="Edm.String"/>
      </Action>
      <Annotations Target="CashAdvanceService.CashAdvanceFields/ID">
        <Annotation Term="Core.ComputedDefaultValue" Bool="true"/>
      </Annotations>
      <Annotations Target="CashAdvanceService.CashAdvanceEntries/ID">
        <Annotation Term="Core.ComputedDefaultValue" Bool="true"/>
      </Annotations>
      <Annotations Target="CashAdvanceService.TravelRequestExpenses/ID">
        <Annotation Term="Core.ComputedDefaultValue" Bool="true"/>
      </Annotations>
      <Annotations Target="CashAdvanceService.CashAdvanceWorkflow/ID">
        <Annotation Term="Core.ComputedDefaultValue" Bool="true"/>
      </Annotations>
      <Annotations Target="CashAdvanceService.RequestEmployeeApproverMappings/ID">
        <Annotation Term="Core.ComputedDefaultValue" Bool="true"/>
      </Annotations>
    </Schema>
  </edmx:DataServices>
</edmx:Edmx>