fix: add SetRoleCommand and RoleSetEvent to Identity command and events resp

This commit is contained in:
Aravinth Manivannan 2025-01-21 15:27:46 +05:30
parent 382c0cf370
commit cf22eff4a0
Signed by: realaravinth
GPG key ID: F8F50389936984FF
2 changed files with 6 additions and 2 deletions

View file

@ -17,8 +17,8 @@ use crate::identity::domain::{
organization_exited_event::*, owner_added_employee_to_store_event::*,
owner_removed_employee_from_store_event::*, phone_number_changed_event::*,
phone_number_verified_event::*, resend_login_otp_event::*, role_added_event::*,
store_added_event::*, store_updated_event::*, verification_otp_resent_event::*,
verification_otp_sent_event::*,
role_set_to_employee_event::RoleSetToEmployeeEvent, store_added_event::*,
store_updated_event::*, verification_otp_resent_event::*, verification_otp_sent_event::*,
};
#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq, Ord, PartialOrd)]
@ -34,6 +34,7 @@ pub enum IdentityEvent {
OwnerAddedEmployeeToStore(OwnerAddedEmployeeToStoreEvent),
OwnerRemovedEmployeeFromStore(OwnerRemovedEmployeeFromStoreEvent),
RoleAdded(RoleAddedEvent),
RoleSetToEmployee(RoleSetToEmployeeEvent),
EmployeeRemovedFromRole(EmployeeRemovedFromRoleEvent),
// employee
@ -75,6 +76,7 @@ impl DomainEvent for IdentityEvent {
"IdentityOwnerRemovedEmployeeFromStore"
}
IdentityEvent::RoleAdded { .. } => "IdentityRoleAddedEvent",
IdentityEvent::RoleSetToEmployee { .. } => "IdentityRoleSetToEmployee",
IdentityEvent::EmployeeRemovedFromRole { .. } => "IdentityEmployeeRemovedFromRole",
// employee
IdentityEvent::EmployeeRegistered { .. } => "EmployeeRegistered",

View file

@ -70,6 +70,7 @@ use crate::identity::domain::{
remove_employee_from_role_command::*,
resend_login_otp_command::*,
resend_verification_otp_command::*,
set_role_to_employee_command::*,
update_store_command::*,
verify_phone_number_command::*,
};
@ -114,6 +115,7 @@ pub enum IdentityCommand {
OwnerAddEmployeeToStore(OwnerAddEmployeeToStoreCommand),
OwnerRemoveEmployeeFromStore(OwnerRemoveEmployeeFromStoreCommand),
AddRole(AddRoleCommand),
SetRoleToEmployee(SetRoleToEmployeeCommand),
RemoveEmployeeFromRole(RemoveEmployeeFromRoleCommand),
// employee