start working on calculating member fees
This commit is contained in:
@ -48,6 +48,46 @@ async fn index(
|
||||
Template::render("admin/user/index", context.into_json())
|
||||
}
|
||||
|
||||
#[get("/user/fees")]
|
||||
async fn fees(
|
||||
db: &State<SqlitePool>,
|
||||
admin: AdminUser,
|
||||
flash: Option<FlashMessage<'_>>,
|
||||
) -> Template {
|
||||
// Checks
|
||||
// Fördernd -> Donau Linz
|
||||
// Fördernd -> keine Family
|
||||
// Unterstützend -> Donau Linz
|
||||
// Unterstützend -> keine Family
|
||||
// Schüler -> Donau Linz
|
||||
// Student -> Donau Linz
|
||||
|
||||
// Fördernd: 85€
|
||||
// Unterstützend: 25€
|
||||
|
||||
// select id, size_of_family, count_rennsport from family
|
||||
// 2-Family: 220€
|
||||
// 3+-Family: 350€
|
||||
|
||||
// Normal: 220€
|
||||
// Student, Schüler: 80€
|
||||
|
||||
// Rennsportbeitrag: 110€
|
||||
|
||||
// Bootsplatz: 45€
|
||||
|
||||
let mut context = Context::new();
|
||||
if let Some(msg) = flash {
|
||||
context.insert("flash", &msg.into_inner());
|
||||
}
|
||||
context.insert(
|
||||
"loggedin_user",
|
||||
&UserWithRoles::from_user(admin.user, db).await,
|
||||
);
|
||||
|
||||
Template::render("admin/user/fees", context.into_json())
|
||||
}
|
||||
|
||||
#[get("/user/<user>/reset-pw")]
|
||||
async fn resetpw(db: &State<SqlitePool>, _admin: AdminUser, user: i32) -> Flash<Redirect> {
|
||||
let user = User::find_by_id(db, user).await;
|
||||
@ -136,5 +176,5 @@ async fn create(
|
||||
}
|
||||
|
||||
pub fn routes() -> Vec<Route> {
|
||||
routes![index, resetpw, update, create, delete]
|
||||
routes![index, resetpw, update, create, delete, fees]
|
||||
}
|
||||
|
Reference in New Issue
Block a user