board members can delete trips, proper notification + succ message is created
All checks were successful
CI/CD Pipeline / test (push) Successful in 24m26s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
2025-05-21 09:56:45 +02:00
parent 129c90f1aa
commit 4e04b2b082
15 changed files with 269 additions and 156 deletions

View File

@ -1,14 +1,15 @@
use std::ops::DerefMut;
use chrono::NaiveDateTime;
use rocket::FromForm;
use rocket::serde::{Deserialize, Serialize};
use rocket::FromForm;
use sqlx::{FromRow, Sqlite, SqlitePool, Transaction};
use crate::model::boathouse::Boathouse;
use super::location::Location;
use super::user::User;
use std::fmt::Display;
#[derive(FromRow, Debug, Serialize, Deserialize, Eq, Hash, PartialEq, Clone)]
pub struct Boat {
@ -31,6 +32,17 @@ pub struct Boat {
pub deleted: bool,
}
impl Display for Boat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let private_or_club_boat = if self.owner.is_some() {
"privat"
} else {
"Vereinsboot"
};
write!(f, "{} ({}, {private_or_club_boat})", self.name, self.cat())
}
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "lowercase")]
pub enum BoatDamage {
@ -178,8 +190,10 @@ AND date('now') BETWEEN start_date AND end_date;",
"Vereinsfremde Boote".to_string()
} else if self.default_shipmaster_only_steering {
format!("{}+", self.amount_seats - 1)
} else {
} else if self.skull {
format!("{}x", self.amount_seats)
} else {
format!("{}-", self.amount_seats)
}
}