<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" id="Definitions_P08_ModificationPolicyGate" name="P08 Modification Policy Gate" namespace="http://hotel-national-zermatt/dmn">
  <decision id="Decision_P08_ModificationPolicyGate" name="Modification policy gate">
    <decisionTable id="DecisionTable_P08_ModificationPolicyGate" hitPolicy="FIRST">
      <input id="Input_P08_RatePlan" label="Rate plan">
        <inputExpression id="InputExpression_P08_RatePlan" typeRef="string">
          <text>ratePlan</text>
        </inputExpression>
      </input>
      <input id="Input_P08_HoursToArrival" label="Hours to arrival">
        <inputExpression id="InputExpression_P08_HoursToArrival" typeRef="number">
          <text>hoursToArrival</text>
        </inputExpression>
      </input>
      <input id="Input_P08_ModType" label="Modification type">
        <inputExpression id="InputExpression_P08_ModType" typeRef="string">
          <text>modificationType</text>
        </inputExpression>
      </input>
      <input id="Input_P08_RequestedOccupancy" label="Requested occupancy">
        <inputExpression id="InputExpression_P08_RequestedOccupancy" typeRef="number">
          <text>requestedOccupancy</text>
        </inputExpression>
      </input>
      <output id="Output_P08_Allowed" label="Allowed" name="allowed" typeRef="boolean" />
      <output id="Output_P08_PenaltyPct" label="Penalty percent" name="penaltyPct" typeRef="number" />
      <output id="Output_P08_Reason" label="Reason" name="reason" typeRef="string" />

      <rule id="Rule_P08_NonRefundableNoChange">
        <inputEntry id="Rule_P08_NonRefundableNoChange_Rate"><text>"non_refundable"</text></inputEntry>
        <inputEntry id="Rule_P08_NonRefundableNoChange_Hours"><text>-</text></inputEntry>
        <inputEntry id="Rule_P08_NonRefundableNoChange_Mod"><text>-</text></inputEntry>
        <inputEntry id="Rule_P08_NonRefundableNoChange_Occ"><text>-</text></inputEntry>
        <outputEntry id="Rule_P08_NonRefundableNoChange_Allowed"><text>false</text></outputEntry>
        <outputEntry id="Rule_P08_NonRefundableNoChange_Penalty"><text>100</text></outputEntry>
        <outputEntry id="Rule_P08_NonRefundableNoChange_Reason"><text>"non-refundable plan blocks modification"</text></outputEntry>
      </rule>

      <rule id="Rule_P08_TooLateWindow">
        <inputEntry id="Rule_P08_TooLateWindow_Rate"><text>-</text></inputEntry>
        <inputEntry id="Rule_P08_TooLateWindow_Hours"><text>&lt; 24</text></inputEntry>
        <inputEntry id="Rule_P08_TooLateWindow_Mod"><text>"date_change"</text></inputEntry>
        <inputEntry id="Rule_P08_TooLateWindow_Occ"><text>-</text></inputEntry>
        <outputEntry id="Rule_P08_TooLateWindow_Allowed"><text>false</text></outputEntry>
        <outputEntry id="Rule_P08_TooLateWindow_Penalty"><text>50</text></outputEntry>
        <outputEntry id="Rule_P08_TooLateWindow_Reason"><text>"date change inside cutoff window"</text></outputEntry>
      </rule>

      <rule id="Rule_P08_OccupancyCapExceeded">
        <inputEntry id="Rule_P08_OccupancyCapExceeded_Rate"><text>-</text></inputEntry>
        <inputEntry id="Rule_P08_OccupancyCapExceeded_Hours"><text>-</text></inputEntry>
        <inputEntry id="Rule_P08_OccupancyCapExceeded_Mod"><text>"occupancy_change"</text></inputEntry>
        <inputEntry id="Rule_P08_OccupancyCapExceeded_Occ"><text>&gt; 4</text></inputEntry>
        <outputEntry id="Rule_P08_OccupancyCapExceeded_Allowed"><text>false</text></outputEntry>
        <outputEntry id="Rule_P08_OccupancyCapExceeded_Penalty"><text>0</text></outputEntry>
        <outputEntry id="Rule_P08_OccupancyCapExceeded_Reason"><text>"requested occupancy exceeds room policy"</text></outputEntry>
      </rule>

      <rule id="Rule_P08_DefaultAllow">
        <inputEntry id="Rule_P08_DefaultAllow_Rate"><text>-</text></inputEntry>
        <inputEntry id="Rule_P08_DefaultAllow_Hours"><text>-</text></inputEntry>
        <inputEntry id="Rule_P08_DefaultAllow_Mod"><text>-</text></inputEntry>
        <inputEntry id="Rule_P08_DefaultAllow_Occ"><text>-</text></inputEntry>
        <outputEntry id="Rule_P08_DefaultAllow_Allowed"><text>true</text></outputEntry>
        <outputEntry id="Rule_P08_DefaultAllow_Penalty"><text>0</text></outputEntry>
        <outputEntry id="Rule_P08_DefaultAllow_Reason"><text>"modification within policy"</text></outputEntry>
      </rule>
    </decisionTable>
  </decision>
</definitions>
