<?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="IntegrationService" 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="Systems" EntityType="IntegrationService.Systems"/>
        <EntitySet Name="IntegrationFlows" EntityType="IntegrationService.IntegrationFlows">
          <NavigationPropertyBinding Path="sourceSystem" Target="Systems"/>
          <NavigationPropertyBinding Path="targetSystem" Target="Systems"/>
        </EntitySet>
        <EntitySet Name="Messages" EntityType="IntegrationService.Messages">
          <NavigationPropertyBinding Path="flow" Target="IntegrationFlows"/>
        </EntitySet>
        <EntitySet Name="AlertRules" EntityType="IntegrationService.AlertRules">
          <NavigationPropertyBinding Path="flow" Target="IntegrationFlows"/>
        </EntitySet>
        <EntitySet Name="AiAnalysisLog" EntityType="IntegrationService.AiAnalysisLog">
          <NavigationPropertyBinding Path="flow" Target="IntegrationFlows"/>
        </EntitySet>
        <ActionImport Name="resetDemoData" Action="IntegrationService.resetDemoData"/>
        <ActionImport Name="simulateErrorBurst" Action="IntegrationService.simulateErrorBurst"/>
        <ActionImport Name="runHealthCheck" Action="IntegrationService.runHealthCheck"/>
      </EntityContainer>
      <EntityType Name="Systems">
        <Key>
          <PropertyRef Name="ID"/>
        </Key>
        <Property Name="ID" Type="Edm.Guid" Nullable="false"/>
        <Property Name="name" Type="Edm.String" MaxLength="100"/>
        <Property Name="type" Type="Edm.String" MaxLength="30"/>
        <Property Name="host" Type="Edm.String" MaxLength="200"/>
        <Property Name="authType" Type="Edm.String" MaxLength="20"/>
        <Property Name="status" Type="Edm.String" MaxLength="20"/>
        <Property Name="lastChecked" Type="Edm.DateTimeOffset"/>
        <Property Name="note" Type="Edm.String" MaxLength="500"/>
      </EntityType>
      <EntityType Name="IntegrationFlows">
        <Key>
          <PropertyRef Name="ID"/>
        </Key>
        <Property Name="ID" Type="Edm.Guid" Nullable="false"/>
        <Property Name="name" Type="Edm.String" MaxLength="150"/>
        <Property Name="description" Type="Edm.String" MaxLength="500"/>
        <NavigationProperty Name="sourceSystem" Type="IntegrationService.Systems">
          <ReferentialConstraint Property="sourceSystem_ID" ReferencedProperty="ID"/>
        </NavigationProperty>
        <Property Name="sourceSystem_ID" Type="Edm.Guid"/>
        <NavigationProperty Name="targetSystem" Type="IntegrationService.Systems">
          <ReferentialConstraint Property="targetSystem_ID" ReferencedProperty="ID"/>
        </NavigationProperty>
        <Property Name="targetSystem_ID" Type="Edm.Guid"/>
        <Property Name="protocol" Type="Edm.String" MaxLength="20"/>
        <Property Name="direction" Type="Edm.String" MaxLength="10"/>
        <Property Name="status" Type="Edm.String" MaxLength="20"/>
        <Property Name="schedule" Type="Edm.String" MaxLength="50"/>
        <Property Name="lastRun" Type="Edm.DateTimeOffset"/>
        <Property Name="errorCount" Type="Edm.Int32" DefaultValue="0"/>
        <Property Name="successCount" Type="Edm.Int32" DefaultValue="0"/>
        <Property Name="avgDurationMs" Type="Edm.Int32" DefaultValue="0"/>
      </EntityType>
      <EntityType Name="Messages">
        <Key>
          <PropertyRef Name="ID"/>
        </Key>
        <Property Name="ID" Type="Edm.Guid" Nullable="false"/>
        <NavigationProperty Name="flow" Type="IntegrationService.IntegrationFlows">
          <ReferentialConstraint Property="flow_ID" ReferencedProperty="ID"/>
        </NavigationProperty>
        <Property Name="flow_ID" Type="Edm.Guid"/>
        <Property Name="timestamp" Type="Edm.DateTimeOffset"/>
        <Property Name="status" Type="Edm.String" MaxLength="20"/>
        <Property Name="durationMs" Type="Edm.Int32"/>
        <Property Name="payloadSizeKb" Type="Edm.Decimal" Precision="8" Scale="2"/>
        <Property Name="errorCode" Type="Edm.String" MaxLength="50"/>
        <Property Name="errorMessage" Type="Edm.String" MaxLength="1000"/>
        <Property Name="retryCount" Type="Edm.Int32" DefaultValue="0"/>
        <Property Name="correlationId" Type="Edm.String" MaxLength="100"/>
        <Property Name="businessKey" Type="Edm.String" MaxLength="200"/>
        <Property Name="note" Type="Edm.String" MaxLength="500"/>
      </EntityType>
      <EntityType Name="AlertRules">
        <Key>
          <PropertyRef Name="ID"/>
        </Key>
        <Property Name="ID" Type="Edm.Guid" Nullable="false"/>
        <NavigationProperty Name="flow" Type="IntegrationService.IntegrationFlows">
          <ReferentialConstraint Property="flow_ID" ReferencedProperty="ID"/>
        </NavigationProperty>
        <Property Name="flow_ID" Type="Edm.Guid"/>
        <Property Name="name" Type="Edm.String" MaxLength="100"/>
        <Property Name="metricType" Type="Edm.String" MaxLength="30"/>
        <Property Name="threshold" Type="Edm.Decimal" Precision="10" Scale="2"/>
        <Property Name="windowMinutes" Type="Edm.Int32"/>
        <Property Name="severity" Type="Edm.String" MaxLength="10"/>
        <Property Name="active" Type="Edm.Boolean" DefaultValue="true"/>
        <Property Name="lastTriggered" Type="Edm.DateTimeOffset"/>
        <Property Name="notificationEmail" Type="Edm.String" MaxLength="200"/>
      </EntityType>
      <EntityType Name="AiAnalysisLog">
        <Key>
          <PropertyRef Name="ID"/>
        </Key>
        <Property Name="ID" Type="Edm.Guid" Nullable="false"/>
        <NavigationProperty Name="flow" Type="IntegrationService.IntegrationFlows">
          <ReferentialConstraint Property="flow_ID" ReferencedProperty="ID"/>
        </NavigationProperty>
        <Property Name="flow_ID" Type="Edm.Guid"/>
        <Property Name="timestamp" Type="Edm.DateTimeOffset"/>
        <Property Name="analysisType" Type="Edm.String" MaxLength="50"/>
        <Property Name="input" Type="Edm.String" MaxLength="2000"/>
        <Property Name="output" Type="Edm.String" MaxLength="2000"/>
        <Property Name="confidence" Type="Edm.Decimal" Precision="5" Scale="2"/>
        <Property Name="model" Type="Edm.String" MaxLength="100"/>
        <Property Name="tokensMock" Type="Edm.Int32"/>
        <Property Name="accepted" Type="Edm.Boolean"/>
      </EntityType>
      <Action Name="triggerFlow" IsBound="true">
        <Parameter Name="in" Type="IntegrationService.IntegrationFlows"/>
        <ReturnType Type="Edm.String"/>
      </Action>
      <Action Name="getFlowHealth" IsBound="true">
        <Parameter Name="in" Type="IntegrationService.IntegrationFlows"/>
        <ReturnType Type="Edm.String"/>
      </Action>
      <Action Name="analyzeErrors" IsBound="true">
        <Parameter Name="in" Type="IntegrationService.IntegrationFlows"/>
        <ReturnType Type="Edm.String"/>
      </Action>
      <Action Name="retryMessage" IsBound="true">
        <Parameter Name="in" Type="IntegrationService.Messages"/>
        <ReturnType Type="Edm.String"/>
      </Action>
      <Action Name="discardMessage" IsBound="true">
        <Parameter Name="in" Type="IntegrationService.Messages"/>
        <ReturnType Type="Edm.String"/>
      </Action>
      <Action Name="resetDemoData" IsBound="false">
        <ReturnType Type="Edm.String"/>
      </Action>
      <Action Name="simulateErrorBurst" IsBound="false">
        <ReturnType Type="Edm.String"/>
      </Action>
      <Action Name="runHealthCheck" IsBound="false">
        <ReturnType Type="Edm.String"/>
      </Action>
      <Annotations Target="IntegrationService.Systems/ID">
        <Annotation Term="Core.ComputedDefaultValue" Bool="true"/>
      </Annotations>
      <Annotations Target="IntegrationService.IntegrationFlows/ID">
        <Annotation Term="Core.ComputedDefaultValue" Bool="true"/>
      </Annotations>
      <Annotations Target="IntegrationService.Messages/ID">
        <Annotation Term="Core.ComputedDefaultValue" Bool="true"/>
      </Annotations>
      <Annotations Target="IntegrationService.AlertRules/ID">
        <Annotation Term="Core.ComputedDefaultValue" Bool="true"/>
      </Annotations>
      <Annotations Target="IntegrationService.AiAnalysisLog/ID">
        <Annotation Term="Core.ComputedDefaultValue" Bool="true"/>
      </Annotations>
    </Schema>
  </edmx:DataServices>
</edmx:Edmx>