feat: persistence chat message#45
Conversation
✅ Deploy Preview for bookwormdev canceled.
|
Test Results841 tests +189 841 ✅ +189 5m 7s ⏱️ - 1m 22s Results for commit ed47707. ± Comparison against base commit a430591. This pull request removes 2 and adds 191 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces persistence for chat messages by refactoring the chat creation and cancellation endpoints to use command/mediator patterns. Key changes include:
- Updating the CreateChat and CancelChat endpoints to use ISender and LinkGenerator.
- Adding new commands and handlers for chat creation and cancellation.
- Enhancing unit tests and updating dependency configuration in the AppHost and project files.
Reviewed Changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| CreateChatEndpoint.cs | Refactored to use CreateChatCommand, ISender, and LinkGenerator with updated HTTP response type. |
| CreateChatCommand.cs | Added command record and corresponding handler for chat creation. |
| ConversationMessageDto.cs & ConversationDto.cs | Defined DTOs for chat conversations and messages for data persistence. |
| CancelChatEndpoint.cs & CancelChatCommand.cs | Updated cancellation to use sender-based commands instead of a dedicated manager. |
| Extensions.cs | Updated dependency injection to configure MediatR, validators, and exception handlers. |
| Domain Files | Added domain exceptions and specifications, and updated Conversation and ConversationMessage implementations for persistence. |
| Unit Tests | Updated tests to account for changes in endpoint signatures and behaviors. |
| Project Files | Added new package references and updated configuration to support new features. |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces persistence functionality for chat messages and improves the testing coverage of chat features. Key changes include updates to the unit tests for streaming, getting, creating, deleting, and canceling chats; modifications to the command and handler implementations; and integration changes in the AppHost for registering the new chat database.
Reviewed Changes
Copilot reviewed 60 out of 60 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| BookWorm.Chat.UnitTests/Features/Stream/ChatStreamHubTests.cs | Updated tests to pass conversation ID and adjust verification. |
| BookWorm.Chat.UnitTests/Features/Get/*.cs | Expanded unit tests covering query, endpoint behavior and error scenarios. |
| BookWorm.Chat.UnitTests/Features/Delete/*.cs | Added tests and command handling for deleting chats. |
| BookWorm.Chat.UnitTests/Features/Create/*.cs | Updated validator, endpoint, and command tests for chat creation including special characters and boundary conditions. |
| BookWorm.Chat.UnitTests/Features/Cancel/*.cs | Refactored cancel endpoints and command tests to use sender patterns. |
| BookWorm.Chat.UnitTests/Fakers/*.cs | Adjusted fakers using new C# collection initialization syntax. |
| BuildingBlocks/BookWorm.SharedKernel/SeedWork/AuditableEntity.cs | Set default CreatedAt initializer to UtcNow. |
| BuildingBlocks/BookWorm.Constants/Aspire/Components.cs | Added chat component constant. |
| Aspire/BookWorm.AppHost/AppHost.cs | Registered the chat database and added dependency references. |
| Directory.Packages.props | Updated package versions and added Bogus usage. |
| Catalog UnitTests for Publishers | Updated test to use Guid.CreateVersion7() for expected publisher ID. |
aa7b95a to
ed47707
Compare
|



Pull Request Description
Checklist