mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 06:25:10 +01:00
Add BusinessOpeningHoursInterval
and BusinessOpeningHours
structs
This commit is contained in:
parent
f84e15a0a6
commit
47fd589ea2
2 changed files with 25 additions and 0 deletions
|
@ -11,6 +11,7 @@ pub use bot_name::*;
|
|||
pub use bot_short_description::*;
|
||||
pub use business_intro::*;
|
||||
pub use business_location::*;
|
||||
pub use business_opening_hours::*;
|
||||
pub use callback_game::*;
|
||||
pub use callback_query::*;
|
||||
pub use chat::*;
|
||||
|
@ -168,6 +169,7 @@ mod bot_name;
|
|||
mod bot_short_description;
|
||||
mod business_intro;
|
||||
mod business_location;
|
||||
mod business_opening_hours;
|
||||
mod callback_game;
|
||||
mod callback_query;
|
||||
mod chat;
|
||||
|
|
23
crates/teloxide-core/src/types/business_opening_hours.rs
Normal file
23
crates/teloxide-core/src/types/business_opening_hours.rs
Normal file
|
@ -0,0 +1,23 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct BusinessOpeningHoursInterval {
|
||||
/// The minute's sequence number in a week, starting on Monday, marking the
|
||||
/// start of the time interval during which the business is open;
|
||||
/// 0 - 7 * 24* 60
|
||||
pub opening_minute: u16,
|
||||
|
||||
/// The minute's sequence number in a week, starting on Monday, marking the
|
||||
/// end of the time interval during which the business is open;
|
||||
/// 0 - 8 * 24* 60
|
||||
pub closing_minute: u16,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct BusinessOpeningHours {
|
||||
/// Unique name of the time zone for which the opening hours are defined.
|
||||
pub time_zone_name: String,
|
||||
|
||||
/// List of time intervals describing business opening hours.
|
||||
pub opening_hours: Vec<BusinessOpeningHoursInterval>,
|
||||
}
|
Loading…
Reference in a new issue