start with activity + fix tests
All checks were successful
CI/CD Pipeline / test (push) Successful in 15m51s
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-03 19:04:13 +02:00
parent d50501b362
commit e360c4f06b
8 changed files with 121 additions and 36 deletions

View File

@ -1,12 +1,25 @@
// TODO: put back in `src/model/user/mod.rs` once that is cleaned up
use super::{AllowedToEditPaymentStatusUser, ManageUserUser, User};
use crate::model::{family::Family, log::Log, mail::valid_mails, role::Role};
use crate::model::{activity::Activity, family::Family, log::Log, mail::valid_mails, role::Role};
use chrono::NaiveDate;
use rocket::{fs::TempFile, tokio::io::AsyncReadExt};
use sqlx::SqlitePool;
impl User {
pub(crate) async fn add_note(
&self,
db: &SqlitePool,
updated_by: &ManageUserUser,
note: &str,
) -> Result<(), String> {
let note = note.trim();
Activity::create(db, note, "relevant_for", None).await;
Ok(())
}
pub(crate) async fn update_mail(
&self,
db: &SqlitePool,