4 Commits

Author SHA1 Message Date
6a59634de3 Merge pull request 'log-trip-creation' (#1075) from log-trip-creation into staging
All checks were successful
CI/CD Pipeline / test (push) Successful in 19m20s
CI/CD Pipeline / deploy-staging (push) Successful in 25m7s
CI/CD Pipeline / deploy-main (push) Has been skipped
Update Cargo Dependencies / update-dependencies (push) Successful in 1m30s
Reviewed-on: #1075
2025-06-09 08:35:22 +02:00
d3b2d78f9f log if a cox creates a trip
Some checks failed
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled
CI/CD Pipeline / test (push) Has been cancelled
2025-06-09 08:33:50 +02:00
155adce2e9 Merge pull request 'add license' Fixes #1064' (#1071) from upd into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 14m4s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 7m0s
Reviewed-on: #1071
2025-05-29 16:06:34 +02:00
c42713b86e Merge pull request 'promote calendar in welcome-mail; even more robust name checking' (#1069) from upd into main
Some checks failed
CI/CD Pipeline / test (push) Has been cancelled
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled
Reviewed-on: #1069
2025-05-29 16:02:59 +02:00
2 changed files with 18 additions and 0 deletions

View File

@ -1,5 +1,6 @@
use super::Trip;
use crate::model::{
log::Log,
notification::Notification,
planned::{tripdetails::TripDetails, triptype::TripType},
user::{ErgoUser, SteeringUser, User},
@ -34,6 +35,8 @@ impl Trip {
.execute(db)
.await;
Log::create(db, format!("{user} created a new trip: {trip_details}")).await;
Self::notify_trips_same_datetime(db, trip_details, user).await;
}

View File

@ -8,6 +8,7 @@ use super::{
trip::{Trip, TripWithDetails},
triptype::TripType,
};
use std::fmt::Display;
#[derive(FromRow, Debug, Serialize, Deserialize)]
pub struct TripDetails {
@ -22,6 +23,20 @@ pub struct TripDetails {
pub is_locked: bool,
}
impl Display for TripDetails {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&format!(
"Ausfahrt am {} um {} mit {} Personen",
self.day, self.planned_starting_time, self.max_people
))?;
if let Some(notes) = &self.notes {
f.write_str(&format!(" Notizen: {notes}"))?;
}
Ok(())
}
}
#[derive(FromForm, Serialize)]
pub struct TripDetailsToAdd<'r> {
//TODO: properly parse `planned_starting_time`