pub use crate::domain::entity::AdminUser;
pub use crate::domain::entity::UserRole;
use genies::ddd::aggregate::{AggregateType, WithAggregateId};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct UserAggregate {
pub id: String,
}
impl UserAggregate {
pub fn new(id: i64) -> Self {
Self { id: id.to_string() }
}
}
impl AggregateType for UserAggregate {
fn aggregate_type(&self) -> String {
"auth-admin.User".to_string()
}
fn atype() -> String {
"auth-admin.User".to_string()
}
}
impl WithAggregateId for UserAggregate {
type Id = String;
fn aggregate_id(&self) -> &Self::Id {
&self.id
}
}