Struct nettu_scheduler_domain::ServiceResource[][src]

pub struct ServiceResource {
    pub id: ID,
    pub user_id: ID,
    pub availibility: TimePlan,
    pub busy: Vec<ID>,
    pub buffer: i64,
    pub closest_booking_time: i64,
    pub furthest_booking_time: Option<i64>,
}

A bookable User registered on a Service

Fields

id: IDuser_id: ID

Id of the User registered on this Service

availibility: TimePlan

Every available event in a Calendar or a Shedule in this field describes the time when this ServiceResource will be bookable. Note: If there are busy CalendarEvents in the Calendar then the user will not be bookable during that time.

busy: Vec<ID>

List of Calendar ids that should be subtracted from the availibility time plan.

buffer: i64

This ServiceResource will not be bookable this amount of minutes after a meeting. A CalendarEvent will be interpreted as a meeting if the attribute services on the CalendarEvent includes this Service id or “*”.

closest_booking_time: i64

Minimum amount of time in minutes before this user could receive any booking requests. That means that if a bookingslots query is made at time T then this ServiceResource will not have any availaible bookingslots before at least T + closest_booking_time

furthest_booking_time: Option<i64>

Amount of time in minutes into the future after which the user can not receive any booking requests. This is useful to ensure that booking requests are not made multiple years into the future. That means that if a bookingslots query is made at time T then this ServiceResource will not have any availaible bookingslots after T + furthest_booking_time

Implementations

impl ServiceResource[src]

pub fn new(user_id: ID, availibility: TimePlan, busy: Vec<ID>) -> Self[src]

pub fn set_availibility(&mut self, availibility: TimePlan)[src]

pub fn set_busy(&mut self, busy: Vec<ID>)[src]

pub fn set_buffer(&mut self, buffer: i64) -> bool[src]

pub fn get_calendar_ids(&self) -> Vec<ID>[src]

pub fn get_schedule_id(&self) -> Option<ID>[src]

pub fn contains_calendar(&self, calendar_id: &ID) -> bool[src]

pub fn remove_calendar(&mut self, calendar_id: &ID)[src]

pub fn contains_schedule(&self, schedule_id: &ID) -> bool[src]

pub fn remove_schedule(&mut self, schedule_id: &ID)[src]

Trait Implementations

impl Clone for ServiceResource[src]

impl Debug for ServiceResource[src]

impl Serialize for ServiceResource[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,