Skip to main content

ReservationSystem

Trait ReservationSystem 

Source
pub trait ReservationSystem: Send + Sync {
    // Required methods
    fn check_availability<'life0, 'async_trait>(
        &'life0 self,
        request: Request,
    ) -> Pin<Box<dyn Future<Output = Result<Outcome>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn draft_reservation_update<'life0, 'async_trait>(
        &'life0 self,
        request: Request,
    ) -> Pin<Box<dyn Future<Output = Result<Id>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Reservation-system port for read checks and review-held draft updates.

This trait separates source availability checks and draft reservation updates from live provider/PMS mutation. Implementations may consult external systems or create internal draft records, but workflow code must still apply review gates before any booking promise, status change, deposit, or customer message.

Required Methods§

Source

fn check_availability<'life0, 'async_trait>( &'life0 self, request: Request, ) -> Pin<Box<dyn Future<Output = Result<Outcome>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Checks capacity/policy availability without confirming a booking.

The request carries location, optional reservation context, and service notes. The outcome should identify available/unavailable/review-required evidence, including any capacity snapshot id, and must not reserve space unless the implementation explicitly models that as a review-safe hold.

Source

fn draft_reservation_update<'life0, 'async_trait>( &'life0 self, request: Request, ) -> Pin<Box<dyn Future<Output = Result<Id>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Persists a proposed reservation status change as a draft for review.

The returned draft id identifies the review artifact. Implementations must not write the proposed status to the provider/PMS or represent the draft as a customer-visible booking decision before the required app/human gates run.

Implementors§