rolle domain hinzugefügt

This commit is contained in:
2026-05-27 13:48:02 +02:00
parent e0f78a12e1
commit 4d9bbff607
12 changed files with 102 additions and 68 deletions

View File

@@ -0,0 +1,26 @@
use anyhow::Error;
use chrono::Utc;
use ulid::Ulid;
use super::Service;
use crate::domain::rolle::{
entity,
model::{self, RolleErstelleInput},
};
impl Service {
pub async fn rolle_erstellen(&self, input: RolleErstelleInput) -> Result<model::Rolle, Error> {
let rolle_input = entity::Rolle {
id: Ulid::new().into(),
rollenname: input.rollenname,
erstellt_am: Some(Utc::now()),
geaendert_am: Some(Utc::now()),
};
// let created_id = self.repo.rolle_erstellen(&self.db, &rolle_input).await?;
// let rolle = self.repo.find_rolle_by_id(&self.db, created_id).await?;
let rolle = self.repo.rolle_erstellen(&self.db, &rolle_input).await?;
Ok(rolle)
}
}