Compare commits

..

9 Commits

Author SHA1 Message Date
83a2c7ab92 Merge pull request 'update' (#702) from update into staging
Some checks failed
CI/CD Pipeline / test (push) Successful in 10m23s
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled
Reviewed-on: #702
2024-08-21 16:35:41 +02:00
a518023892 Merge branch 'main' into staging
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
2024-08-21 16:34:13 +02:00
3f06e91e24 Merge pull request 'fix price' (#701) from fix-price into main
Some checks failed
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled
Reviewed-on: #701
2024-08-21 16:29:00 +02:00
2b4345ba77 fix price
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
2024-08-21 16:28:13 +02:00
412c45a9df Merge pull request 'care-about-einschreibgebuehr' (#699) from care-about-einschreibgebuehr into main
Some checks are pending
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Successful in 10m23s
Reviewed-on: #699
2024-08-21 16:17:52 +02:00
d971c1504c clippy
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
2024-08-21 16:16:07 +02:00
cf9b79e56e care about einschreibgebuehr
Some checks failed
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled
2024-08-21 16:14:54 +02:00
5d01d18e70 Merge pull request 'nag, if a long logentry is entered w/o trip_type; Fixes #448' (#695) from trip-type-nag into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 8m55s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 7m52s
Reviewed-on: #695
2024-08-19 14:36:59 +02:00
ff81ab0246 Merge pull request 'notify-on-always-show-events' (#693) from notify-on-always-show-events into main
Some checks failed
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled
Reviewed-on: #693
2024-08-19 14:14:21 +02:00
4 changed files with 18 additions and 5 deletions

View File

@ -10,6 +10,7 @@ INSERT INTO "role" (name) VALUES ('Vorstand');
INSERT INTO "role" (name) VALUES ('Bootsführer');
INSERT INTO "role" (name) VALUES ('schnupperant');
INSERT INTO "role" (name) VALUES ('kassier');
INSERT INTO "role" (name) VALUES ('no-einschreibgebuehr');
INSERT INTO "user" (name, pw) VALUES('admin', '$argon2id$v=19$m=19456,t=2,p=1$dS/X5/sPEKTj4Rzs/CuvzQ$4P4NCw4Ukhv80/eQYTsarHhnw61JuL1KMx/L9dm82YM');
INSERT INTO "user_role" (user_id, role_id) VALUES(1,1);
INSERT INTO "user_role" (user_id, role_id) VALUES(1,2);

View File

@ -9,11 +9,7 @@ use serde::Serialize;
use sqlx::{FromRow, Row, SqlitePool};
use super::{
notification::Notification,
role::Role,
trip,
tripdetails::{self, TripDetails},
triptype::TripType,
notification::Notification, role::Role, tripdetails::TripDetails, triptype::TripType,
user::User,
};

View File

@ -29,6 +29,7 @@ const REGULAR: i32 = 22000;
const UNTERSTUETZEND: i32 = 2500;
const FOERDERND: i32 = 8500;
pub const SCHECKBUCH: i32 = 3000;
const EINSCHREIBGEBUEHR: i32 = 3000;
#[derive(FromRow, Serialize, Deserialize, Clone, Debug, Eq, Hash, PartialEq)]
pub struct User {
@ -361,6 +362,17 @@ ASKÖ Ruderverein Donau Linz", self.name),
);
}
if let Some(member_since_date) = &self.member_since_date {
if let Ok(member_since_date) = NaiveDate::parse_from_str(member_since_date, "%Y-%m-%d")
{
if member_since_date.year() == Local::now().year()
&& !self.has_role(db, "no-einschreibgebuehr").await
{
fee.add("Einschreibgebühr".into(), EINSCHREIBGEBUEHR);
}
}
}
let halfprice = if let Some(member_since_date) = &self.member_since_date {
if let Ok(member_since_date) = NaiveDate::parse_from_str(member_since_date, "%Y-%m-%d")
{

View File

@ -437,6 +437,10 @@ async fn schnupper_to_scheckbuch(
let scheckbuch = Role::find_by_name(db, "scheckbuch").await.unwrap();
user.add_role(db, &scheckbuch).await;
if let Some(no_einschreibgebuehr) = Role::find_by_name(db, "no-einschreibgebuehr").await {
user.add_role(db, &no_einschreibgebuehr).await;
}
user.send_welcome_email(db, &config.smtp_pw).await.unwrap();
Log::create(