application: auth bounded context (register, login)
This commit is contained in:
@@ -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)]
|
||||
|
||||
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user