Skip to content

feat: Add domain events to Identity module#1167

Merged
iammukeshm merged 1 commit into
developfrom
feat/identity-domain-events
Jan 25, 2026
Merged

feat: Add domain events to Identity module#1167
iammukeshm merged 1 commit into
developfrom
feat/identity-domain-events

Conversation

@iammukeshm
Copy link
Copy Markdown
Member

Summary

Add domain events for identity-related operations following FSH patterns.

Changes

Created domain events in Modules.Identity/Domain/Events/:

Event Purpose
UserRegisteredEvent Raised when a new user registers
PasswordChangedEvent Raised when a user changes password
UserRoleAssignedEvent Raised when roles are assigned to a user
UserActivatedEvent Raised when a user account is activated
UserDeactivatedEvent Raised when a user account is deactivated
SessionRevokedEvent Raised when a user session is revoked

Implementation Details

  • All events are sealed record types inheriting from DomainEvent base
  • Include EventId, OccurredOnUtc, CorrelationId, TenantId from base
  • Include domain-specific data (UserId, Email, etc.)
  • Provide static Create factory methods for convenient instantiation

Related

Enables publishing domain events for audit trails, notifications, and event sourcing patterns.

Add domain events for identity-related operations:
- UserRegisteredEvent: Raised when a new user registers
- PasswordChangedEvent: Raised when a user changes password
- UserRoleAssignedEvent: Raised when roles are assigned to a user
- UserActivatedEvent: Raised when a user account is activated
- UserDeactivatedEvent: Raised when a user account is deactivated
- SessionRevokedEvent: Raised when a user session is revoked

All events inherit from DomainEvent base record and include:
- EventId, OccurredOnUtc, CorrelationId, TenantId (from base)
- Relevant domain-specific data
- Static factory method for convenient creation
@iammukeshm iammukeshm merged commit 18d44ce into develop Jan 25, 2026
1 check passed
@iammukeshm iammukeshm deleted the feat/identity-domain-events branch May 27, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant