merge staging into main#50
Conversation
…trollers, service, and aggregation logic; add conversation interfaces and update schemas
…e to utilize it; enhance conversation interfaces with participant preview details
…d message service, and update providers and exports
… conversations, add detailed Swagger documentation, and improve error handling
…mRiderService to automatically create conversations for new custom riders
…tails and update conversation interfaces accordingly
…essage retrieval and conversation management, and enhance interfaces for message handling
… messages, including creation, retrieval, deletion, and read status management; enhance Swagger documentation for API endpoints and improve error handling
…p, update message controller to use new DTOs for conversation parameters, and enhance conversation service verification logic
… documentation by replacing inline definitions with dedicated decorators, enhancing readability and maintainability; implement new decorators for API operations to improve code organization
…pipelines for retrieving unread messages and their counts in the message service, enhancing the functionality for managing direct messages
…message status management, and update pipelines to exclude deleted messages, improving the overall functionality of direct messaging
…ls into message retrieval, update pipelines to include participant information, and refactor message service for improved data handling and response structure
…icipant details for enhanced message retrieval
…ion by consolidating fields from identity and preferences, improving clarity and efficiency in offer retrieval
…projection and ensure avatarUrl is consistently used, improving data clarity in message retrieval
…y replacing displayName with firstName, lastName, and fullName fields, enhancing clarity in user conversation details
… conversationId field for improved offer context and data retrieval
…lidation rules, and refactor SponsorsController and SponsorsService to utilize the new structure, enhancing data integrity and clarity in sponsor updates
Feature/messagerie
There was a problem hiding this comment.
Pull Request Overview
This PR merges staging into main, adding a comprehensive direct messaging system and implementing several bug fixes and improvements across the codebase.
- Introduces a complete direct messaging feature with conversations and messages
- Updates sponsors service to fix parameter type and enhance update functionality
- Upgrades shared types dependency to include new conversation-related types
Reviewed Changes
Copilot reviewed 37 out of 39 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/features/sponsors/services/sponsors.service.ts | Fixes parameter type and enhances sponsor update functionality |
| src/features/sponsors/interfaces/update-sponsor.dto.ts | Adds new DTO for sponsor updates with validation |
| src/features/sponsors/controllers/sponsors.controller.ts | Updates to use new sponsor DTO and formatting improvements |
| src/features/offers/services/custom-rider.service.ts | Adds automatic conversation creation on application |
| src/features/offers/pipelines/*.ts | Pipeline optimizations and enum usage improvements |
| src/features/offers/offers.module.ts | Adds DirectMessagesModule import |
| src/features/direct-messages/* | Complete new direct messaging system implementation |
| src/features/features.module.ts | Registers new direct messages module and routes |
| src/common/constants/mongoDbConnections.ts | Adds conversation and message collection constants |
| package.json | Updates shared types dependency version |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
| id, | ||
| { | ||
| ...updateSponsorDto, | ||
| logo: newSponsor.avatarUrl, |
There was a problem hiding this comment.
The code sets logo: newSponsor.avatarUrl but earlier on line 86 it sets logo: updateSponsorDto.logo. This creates a conflict where the DTO's logo value is overwritten by avatarUrl, which may not be the intended behavior.
| logo: newSponsor.avatarUrl, |
| const conversationId = new (mongoose as any).Types.ObjectId( | ||
| body.conversationId, | ||
| ); |
There was a problem hiding this comment.
Using 'as any' type assertion with mongoose.Types.ObjectId is unsafe. Import ObjectId directly from mongoose or use proper typing to avoid runtime errors.
| const conversationId = new (mongoose as any).Types.ObjectId( | |
| body.conversationId, | |
| ); | |
| const conversationId = new ObjectId(body.conversationId); |
| }; | ||
|
|
||
| const targetParticipant = { | ||
| userId: new (Types as any).ObjectId(body.targetUserId), |
There was a problem hiding this comment.
Using 'as any' type assertion with Types.ObjectId is unsafe. Import ObjectId directly or use proper typing to avoid potential runtime errors.
| userId: new (Types as any).ObjectId(body.targetUserId), | |
| userId: new ObjectId(body.targetUserId), |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.