Skip to main content

domain/boarding/
cancellation.rs

1//! Boarding cancellation policy contracts for notice windows and deposit/refund review.
2//!
3//! Cancellation penalties are represented as deterministic policy values so staff-facing agents can
4//! explain forfeits or manager-review needs without waiving fees or promising exceptions.
5
6use super::*;
7
8#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
9/// Cancellation policy applied to a boarding reservation before staff waive or charge penalties.
10pub struct Policy {
11    /// Minimum notice the guest must provide before cancellation avoids the configured penalty.
12    pub notice: NoticeHours,
13    /// Operational consequence when the notice window is missed.
14    pub penalty: Penalty,
15}
16
17impl Policy {
18    /// Creates a cancellation policy from validated notice and penalty values.
19    pub const fn new(notice: NoticeHours, penalty: Penalty) -> Self {
20        Self { notice, penalty }
21    }
22}
23
24#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
25/// Penalties a resort may apply when a boarding cancellation misses the notice window.
26pub enum Penalty {
27    /// No fee, forfeiture, or manager review is required by this cancellation path.
28    None,
29    /// The booking deposit should be forfeited unless an approved exception overrides policy.
30    ForfeitDeposit,
31    /// A manager must review the cancellation before staff promise a fee outcome.
32    ManagerReview,
33}