Compare commits

...

2 Commits

Author SHA1 Message Date
08a970853a Merge pull request 'better text for boat reservation' (#349) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 11m23s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 5m1s
Reviewed-on: #349
2024-04-07 22:13:32 +02:00
7cbfafa5c5 better text for boat reservation
All checks were successful
CI/CD Pipeline / test (push) Successful in 11m45s
CI/CD Pipeline / deploy-staging (push) Successful in 6m36s
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-04-07 22:12:56 +02:00

View File

@ -126,15 +126,23 @@ WHERE end_date >= CURRENT_DATE ORDER BY end_date
let board =
User::all_with_role(db, &Role::find_by_name(db, "Vorstand").await.unwrap()).await;
for user in board {
let date = if boatreservation.start_date == boatreservation.end_date {
format!("am {}", boatreservation.start_date)
} else {
format!(
"von {} bis {}",
boatreservation.start_date, boatreservation.end_date
)
};
Notification::create(
db,
&user,
&format!(
"{} hat eine neue Bootsreservierung für Boot '{}' angelegt: Von {} bis {} um {} wegen {}",
"{} hat eine neue Bootsreservierung für Boot '{}' {} angelegt. Zeit: {}; Zweck: {}",
boatreservation.user_applicant.name,
boatreservation.boat.name,
boatreservation.start_date,
boatreservation.end_date,
date,
boatreservation.time_desc,
boatreservation.usage
),