allow moving scheckbuch -> unterstützend + fördernd
This commit is contained in:
31
src/model/user/unterstuetzend.rs
Normal file
31
src/model/user/unterstuetzend.rs
Normal file
@@ -0,0 +1,31 @@
|
||||
use super::User;
|
||||
use crate::{
|
||||
model::{mail::Mail, notification::Notification},
|
||||
special_user,
|
||||
};
|
||||
use rocket::async_trait;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
special_user!(UnterstuetzendUser, +"Unterstützend");
|
||||
|
||||
impl UnterstuetzendUser {
|
||||
pub(crate) async fn notify(&self, db: &SqlitePool, smtp_pw: &str) -> Result<(), String> {
|
||||
self.notify_coxes_about_new_unterstuetzend(db).await;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn notify_vorstand_about_new_unterstuetzend(&self, db: &SqlitePool) {
|
||||
Notification::create_for_steering_people(
|
||||
db,
|
||||
&format!(
|
||||
"Lieber Vorstand, es gibt ein neues unterstützendes Mitglied: {}",
|
||||
self.name
|
||||
),
|
||||
"Neues unterstützendes Vereinsmitglied",
|
||||
None,
|
||||
None,
|
||||
)
|
||||
.await;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user