Skip to main content

domain/boarding/
minimum_stay.rs

1//! Boarding minimum-stay policy for standard stays, holiday peaks, and multi-pet buffers.
2//!
3//! Minimum stay contracts keep holiday capacity and staffing assumptions explicit instead of letting
4//! an agent silently shorten a stay below local policy.
5
6use super::*;
7
8#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
9/// Minimum-night rule applied before a boarding reservation is accepted.
10pub struct Policy {
11    nights: StayNights,
12    /// Operational reason the minimum-night rule exists.
13    pub reason: Reason,
14}
15
16impl Policy {
17    /// Creates a minimum-stay policy from validated nights and the policy reason.
18    pub const fn new(nights: StayNights, reason: Reason) -> Self {
19        Self { nights, reason }
20    }
21
22    /// Returns the minimum nights required before this boarding reservation can be accepted.
23    pub const fn nights(&self) -> StayNights {
24        self.nights
25    }
26}
27
28#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
29/// Reasons a boarding reservation may require a minimum stay.
30pub enum Reason {
31    /// Baseline local policy requires the configured stay length.
32    StandardPolicy,
33    /// Holiday demand or staffing pressure requires a longer stay commitment.
34    HolidayPeak,
35    /// Multi-pet handling or room-turn complexity requires an operational buffer.
36    MultiPetOperationalBuffer,
37}