RahalCorporate
PoliciesConcepts

Duration-Based Tiers

Configure different budgets and cabin classes based on flight duration

Duration-Based Tiers

Duration-based tiers allow you to set different budget limits and cabin class allowances based on how long a flight is. This provides flexibility for long-haul travel where prices are naturally higher and comfort matters more.

Why Use Duration Tiers?

Without duration tiers, you face a trade-off:

  • Set a low budget → Long flights always violate policy
  • Set a high budget → Short flights have too much slack

Duration tiers solve this by allowing context-aware limits.

Budget Tiers

Budget tiers set different maximum prices based on flight duration.

Configuration

Each tier defines:

  • Min Hours: Start of the duration range (inclusive)
  • Max Hours: End of the duration range (exclusive, or null for unlimited)
  • Max Price: Budget limit for this range

Example

Min HoursMax HoursMax Budget
03$450
37$650
7null$1,000

How Evaluation Works

Backend Logic (from policy-evaluation.service.ts):

  1. Get flight duration in hours
  2. Iterate through tiers in order
  3. Find first tier where: duration >= minHours AND (maxHours is null OR duration < maxHours)
  4. Use that tier's maxPrice
  5. If no tier matches, use rule's base maxPricePerPerson

Tier Gaps

If your tiers don't cover all durations, the base budget is used as fallback:

Min HoursMax HoursMax Budget
04$400
8null$1,000

4-7 hour flight: No tier matches → Uses base maxPricePerPerson (e.g., $600)

Avoid gaps in tier ranges. Ensure tiers cover from 0 to unlimited for predictable behavior.

Cabin Tiers

Cabin tiers allow different cabin classes based on flight duration — typically allowing upgrades for longer flights.

Configuration

Each tier defines:

  • Min Hours: Start of the duration range (inclusive)
  • Max Hours: End of the duration range (exclusive, or null for unlimited)
  • Allowed Classes: List of permitted cabin classes

Example

Min HoursMax HoursAllowed Classes
05Economy
510Economy, Premium Economy
10nullEconomy, Premium Economy, Business

How Evaluation Works

Backend Logic (from policy-evaluation.service.ts):

  1. Get flight duration in hours
  2. Iterate through tiers in order
  3. Find matching tier (same logic as budget tiers)
  4. Use that tier's classes array
  5. If no tier matches, use rule's base allowedCabinClasses
  6. Check if selected cabin class is in the allowed list

Combined Tier Example

A comprehensive long-haul rule might use both tiers:

Route: All international flights

Budget Tiers:

DurationBudget
0-4 hours$500
4-8 hours$800
8-12 hours$1,200
12+ hours$1,800

Cabin Tiers:

DurationClasses
0-6 hoursEconomy
6-10 hoursEconomy, Premium
10+ hoursEconomy, Premium, Business

Evaluation for a 9-hour flight at $1,000 in Premium Economy:

  • Budget: 4-8 hour tier = $800 → $1,000 > $800 = Price violation
  • Cabin: 6-10 hour tier = Economy/Premium → Premium is allowed = No violation

Best Practices

1. Cover All Durations

Ensure tiers span from 0 to unlimited:

0-4, 4-8, 8-12, 12+ (null)

Not:

2-4, 6-8, 10+ (gap at 0-2, 4-6, 8-10)

2. Match Budget Tiers to Market Rates

Research actual flight prices for different durations:

DurationTypical Price RangeSuggested Tier
< 3 hours$200-500$400-500
3-6 hours$400-800$600-700
6-10 hours$700-1,200$900-1,100
10+ hours$1,000-2,500$1,500-2,000

3. Align Cabin Tiers with Comfort Needs

Consider employee well-being:

Flight TypeDurationSuggested Classes
Short domestic< 3 hoursEconomy only
Regional3-6 hoursEconomy, maybe Premium
Medium-haul6-10 hoursEconomy, Premium
Long-haul10+ hoursEconomy, Premium, Business
Ultra long14+ hoursConsider Business as default

4. Test Your Tiers

Before deploying, test various scenarios:

  1. Short domestic flight ($300, Economy)
  2. Medium regional flight ($600, Premium)
  3. Long international flight ($1,200, Business)
  4. Edge cases at tier boundaries (exactly 4 hours, 8 hours, etc.)

Troubleshooting

Wrong tier applied

Symptom: Flight uses unexpected budget/cabin limit

Cause: Tier boundaries not aligned or gaps exist

Solution: Review tier configuration; ensure no gaps; verify minHours/maxHours boundaries

Duration not detected

Symptom: Always uses base budget, not tiers

Cause: Flight duration not provided in booking data

Solution: Ensure booking integration sends durationHours field

Tier not saving

Symptom: Tier configuration lost after save

Cause: Invalid tier format or validation error

Solution: Check for required fields; ensure tiers don't overlap

On this page