Feat/4/support chat nest webhook#7
Open
Frompaje wants to merge 9 commits into
Open
Conversation
…pics and idempotency key - Updated the `conversations` table to include a `topic` field, referencing the new `conversationTopics` enum for better categorization of conversations. - Added an `idempotencyKey` field to the `messages` table to ensure unique message submissions and prevent duplicates. - Enhanced indexing on the `conversations` table for improved query performance based on topic and status. - Created migration scripts to reflect these schema changes in the database.
…raints - Introduced `conversationStatus` and `messageRole` enums to standardize status and role fields in the `conversations` and `messages` tables, respectively. - Updated the `status` field in the `conversations` table to use the new `conversationStatus` enum. - Changed the `role` field in the `messages` table to utilize the `messageRole` enum for better clarity. - Added a unique constraint on the `idempotencyKey` field in the `messages` table to prevent duplicate submissions. - Created migration scripts to implement these changes in the database schema.
…ign key constraints - Created new tables: `conversations`, `messages`, `orders`, and `order_items` to support chat and order management functionalities. - Introduced `conversation_topic` enum for categorizing conversations. - Established foreign key relationships to ensure data integrity and cascading deletes. - Added indexes to optimize query performance for common operations. - Updated migration journal to reflect the new schema changes.
- Introduced `ACCESS_TOKEN_COOKIE_NAME` constant for consistent access token management. - Added `CONVERSATION_TOPIC_VALUES` array to define standard conversation topics with a corresponding type. - Updated the `index.ts` file to export the new constants and types for broader accessibility. - Created a new `oneHourInMs` constant for time management. - Refactored the `SendChatMessageDto` to utilize the new conversation topic constants and added a context for chat message details.
- Introduced `ConversationRepository` to manage conversation-related database operations, including finding open conversations, creating new conversations, and appending messages. - Added new DTO exports in `index.ts` for `SendChatMessageDto` and `ChatMessageContextDto` to facilitate data transfer in chat functionalities. - Implemented methods for querying and updating conversation data, enhancing the chat management capabilities of the application.
- Added `@nestjs/platform-socket.io` and `@nestjs/websockets` dependencies to enhance real-time communication capabilities. - Introduced a new `userRole` enum to standardize user roles in the database schema. - Refactored the `role` field in the `users` table to utilize the new `userRole` enum for improved clarity and maintainability. - Removed the obsolete `ChatMessageContextDto` to streamline the DTO structure in the support module.
- Introduced `ChatModule` and `ChatGateway` to handle real-time chat interactions using WebSocket. - Implemented `ChatRealtimeService` for managing WebSocket server interactions and emitting events to users. - Created `SupportController` to manage chat-related API endpoints, including sending messages and managing conversations. - Added use cases for handling agent replies, assigning conversations, and closing conversations, enhancing chat management capabilities. - Updated package dependencies to include `@socket.io/admin-ui`, `@socket.io/redis-adapter`, and `redis` for improved WebSocket functionality and message handling.
- Added new WebSocket event handlers in `ChatGateway` for managing agent and user interactions, including joining rooms and typing indicators. - Implemented `emitToAgents` method in `ChatRealtimeService` to broadcast messages to agents. - Expanded `SupportController` with a new endpoint for retrieving active conversations for agents. - Updated `ConversationRepository` to include methods for finding conversations by participant and listing active conversations. - Introduced new components for the support chat interface, including `SupportChat`, `ChatPanel`, and `TopicSelector`, enhancing user experience. - Integrated real-time message handling in the chat interface, allowing for dynamic updates and typing indicators. - Updated package dependencies to include `socket.io-client` for improved WebSocket communication.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4