Files
rezervovator/src/backend/data.rs
T

82 lines
1.3 KiB
Rust
Raw Normal View History

use chrono::{NaiveDate, NaiveTime, Weekday};
use rust_decimal::Decimal;
use uuid::Uuid;
pub struct Company {
id: u16,
name: String,
street: String,
house_number: String,
zip_code: String,
city: String,
}
pub struct User {
id: u16,
login: String,
password: String,
full_name: String,
email: String,
admin: bool,
get_emails: bool,
}
pub struct Property {
id: u16,
name: String,
description: String,
price: Decimal
}
pub enum MessageType {
NewReservation,
NewReservationCust,
ReservationApp,
ReservationCanceled,
}
pub struct Message {
id: u16,
msg_type: MessageType,
subject: String,
text: String,
}
pub struct OpeningHour {
id: u16,
day: Weekday,
from: NaiveTime,
to: NaiveTime,
discount: u8
}
pub struct Customer {
id: u128,
full_name: String,
email: String,
phone: String,
discount: u8
}
pub enum ReservationState {
New,
Approved,
Canceled,
}
pub struct Reservation {
id: u128,
from: NaiveTime,
to: NaiveTime,
property: Property,
}
pub struct ReservationSum {
id: u128,
uuid: Uuid,
date: NaiveDate,
items: Vec<Reservation>,
customer: Customer,
price: Decimal,
state: ReservationState,
}