5c541ddb79eaacde84229cc2d8cafbce16d8a7f1
Implemented domain event raising in command handlers to enable audit logging and event-driven architecture for key Identity module operations. Changes: - Updated LoginCommand to include IpAddress and UserAgent fields for audit trail - Updated AuthController to extract and pass IP address and user agent from HTTP context - Modified LoginCommandHandler to raise UserLoggedInEvent on successful login - Updated AssignUserRoleCommand to include AssignedBy field for audit purposes - Modified AssignUserRoleCommandHandler to raise UserRoleAssignedEvent with previous role tracking - Updated RemoveUserFromTenantCommand to include RemovedBy and Reason fields - Modified RemoveUserFromTenantCommandHandler to raise UserRemovedFromTenantEvent before deletion - Added domain methods to User aggregate: RecordLoginWithEvent, RaiseRoleAssignedEvent, RaiseRemovedFromTenantEvent - Updated TenantUsersController to extract current user ID from JWT claims and pass to commands Technical Details: - All event raising follows aggregate root encapsulation pattern - Domain events are persisted through repository UpdateAsync calls - Event handlers will automatically log these events for audit trail - Maintains backward compatibility with existing login flow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Description
No description provided
Languages
C#
88.5%
PowerShell
10.4%
Shell
0.8%
Dockerfile
0.3%