add planned_trip functionality
This commit is contained in:
@ -1,2 +1,25 @@
|
||||
use chrono::NaiveDate;
|
||||
use serde::Serialize;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
use self::planned_event::PlannedEvent;
|
||||
|
||||
pub mod planned_event;
|
||||
pub mod tripdetails;
|
||||
pub mod user;
|
||||
//pub mod users;
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct Day {
|
||||
day: NaiveDate,
|
||||
planned_events: Vec<PlannedEvent>,
|
||||
}
|
||||
|
||||
impl Day {
|
||||
pub async fn new(db: &SqlitePool, day: NaiveDate) -> Self {
|
||||
Self {
|
||||
day,
|
||||
planned_events: PlannedEvent::get_for_day(db, day).await,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user