start working on calculating member fees
All checks were successful
CI/CD Pipeline / test (push) Successful in 8m54s
CI/CD Pipeline / deploy-staging (push) Successful in 4m20s
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
2024-01-18 21:36:38 +01:00
parent dc794bde37
commit 474db1232d
3 changed files with 47 additions and 4 deletions

View File

@ -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]
}