refactor Ulid und Dataloader

This commit is contained in:
2026-06-06 11:59:20 +02:00
parent 581c8bee88
commit b5182b7f19
54 changed files with 364 additions and 301 deletions

View File

@@ -3,14 +3,14 @@ use async_graphql::{ComplexObject, Context, FieldResult, SimpleObject};
use crate::{
dataloader::LoaderContext,
domain::{gruppe::model::Gruppe, rolle::model::Rolle},
scalar::Id,
scalar::Ulid,
};
#[derive(sqlx::FromRow, SimpleObject)]
#[graphql(complex)]
pub struct Benutzer {
/// Die UUID eines Benutzers
pub id: Id,
/// Die ULid eines Benutzers
pub id: Ulid,
/// Die Kennung des Benutzers
pub kennung: String,

View File

@@ -1,12 +1,13 @@
use crate::scalar::Id;
use async_graphql::InputObject;
use crate::scalar::Ulid;
#[derive(InputObject)]
pub struct BenutzerCreateInput {
// #[graphql(validator(min_length = 6, max_length = 8))]
pub kennung: String,
pub vorname: String,
pub nachname: String,
pub rollen: Option<Vec<Id>>,
pub gruppen: Option<Vec<Id>>,
pub rollen: Option<Vec<Ulid>>,
pub gruppen: Option<Vec<Ulid>>,
}

View File

@@ -1,7 +1,7 @@
use async_graphql::{ComplexObject, Enum, SimpleObject};
use sqlx::Type;
use crate::scalar::{Id, Time};
use crate::scalar::{Time, Ulid};
/// Aus welcher Quelle die Gruppe stammt.
#[derive(Enum, Clone, Debug, Eq, Copy, PartialEq, Type)]
@@ -21,7 +21,7 @@ pub enum Herkunft {
#[graphql(complex)]
pub struct GruppeAnsicht {
/// Die UUID einer Gruppe
pub id: Id,
pub id: Ulid,
/// Der Gruppenname
pub gruppenname: String,