application: auth bounded context (register, login)

This commit is contained in:
2026-07-12 01:49:34 +02:00
parent 848d4752e2
commit 2976600d12
14 changed files with 480 additions and 1 deletions

View File

@@ -32,6 +32,8 @@ pub enum DomainEvent {
ChannelUpdated { channel_id: ChannelId },
/// A channel was deleted.
ChannelDeleted { channel_id: ChannelId },
/// A new user was registered.
UserRegistered { user_id: crate::value_objects::UserId },
}
#[cfg(test)]

View File

@@ -85,6 +85,13 @@ impl User {
pub fn created_at(&self) -> DateTime<Utc> {
self.created_at
}
// -- Mutations --
/// Promote this user to admin.
pub fn promote_to_admin(&mut self) {
self.is_admin = true;
}
}
#[cfg(test)]