-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Setup email configure and complete register endpoint #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis PR implements domain event dispatching infrastructure by refactoring aggregate root handling, introducing new interfaces (IHasDomainEvents, IUnitOfWork, IEmailService), updating DomainEventBehavior with actual dispatch logic, replacing placeholder event handlers with focused implementations, adding email service functionality, and integrating Serilog logging throughout the application. Changes
Sequence DiagramsequenceDiagram
participant Client
participant Handler as RegisterCommandHandler
participant UoW as IUnitOfWork
participant Behavior as DomainEventBehavior
participant Dispatcher as IDomainEventDispatcher
participant EventHandler as UserCreatedSendEmailEventHandler
participant EmailService as IEmailService
Client->>Handler: Execute RegisterCommand
Handler->>Handler: Create User domain entity
Handler->>Handler: AddDomainEvent(UserCreatedEvent)
Handler->>UoW: SaveChangesAsync()
rect rgb(200, 230, 255)
Note over Behavior: Domain Event Dispatch Phase
Behavior->>UoW: GetEntitiesWithDomainEvents()
UoW-->>Behavior: [User with UserCreatedEvent]
Behavior->>Behavior: Collect all domain events
Behavior->>Behavior: Clear domain events on entities
end
Behavior->>Dispatcher: DispatchEventAsync(UserCreatedEvent)
Dispatcher->>EventHandler: Handle(UserCreatedEvent)
EventHandler->>EmailService: SendWelcomeEmailAsync()
EmailService-->>EventHandler: Task completed
EventHandler-->>Dispatcher: Task completed
Dispatcher-->>Behavior: Task completed
Behavior-->>Client: Command response
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Free 📒 Files selected for processing (27)
💤 Files with no reviewable changes (5)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Summary by CodeRabbit
Release Notes
New Features
Infrastructure Updates