Skip to content

merge staging in main#48

Merged
Arthur-Lucas merged 40 commits into
mainfrom
staging
Jul 26, 2025
Merged

merge staging in main#48
Arthur-Lucas merged 40 commits into
mainfrom
staging

Conversation

@ImJustLucas

Copy link
Copy Markdown
Member

No description provided.

ImJustLucas and others added 30 commits July 21, 2025 22:27
…ustomRider schema and controller for managing custom riders
…ntroller, and new offer retrieval pipeline; refactor offer service methods for consistency
…troller for retrieving rider applications and offer dashboards; refactor CustomRiderController and service for improved ownership checks; remove unused custom rider pipeline
…d refactor getOffers method in OfferService to utilize the new pipeline; update GetOffersQueryDto to use z.coerce for better type handling
…tor OfferService to use updated types for improved type safety
… for sponsorId and streamline offer dashboard response by returning raw result
…ation support with page and limit parameters; update related DTOs and service methods for improved offer dashboard retrieval
… response with pagination details; update service and interface definitions for improved type safety and clarity
…applications; update service and pipeline to return structured response with pagination details
…tId for riderId, enhancing type safety and consistency
…eline, and result for improved debugging and monitoring
…sary fields and adjusting output structure for customRiders; enhance ApplicationService to streamline application retrieval
… createdAt and restructure output to return applications and total count; improve pagination handling
…iderId instead of converting it to ObjectId, enhancing code clarity and maintainability
…erface to standardize response structure; modify getRiderApplicationsPipeline for improved field handling and pagination support
…validation and modify getOffers method to accept riderId, improving offer retrieval logic and user authorization
ImJustLucas and others added 9 commits July 24, 2025 16:06
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
merge sponsor offer feature into staging env
add swagger, and upgrade nest@11 and fastfy@5
@ImJustLucas ImJustLucas self-assigned this Jul 26, 2025
Copilot AI review requested due to automatic review settings July 26, 2025 15:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR merges staging into main, bringing significant infrastructure updates and a complete new offers feature to the API.

  • Adds comprehensive Swagger API documentation across all endpoints
  • Implements a complete offers management system with CRUD operations and applications
  • Updates core dependencies including NestJS 11, Fastify 5, and adds security middleware

Reviewed Changes

Copilot reviewed 36 out of 37 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/main.ts Adds Swagger documentation setup and Helmet security middleware
src/features/offers/ Complete new offers module with controllers, services, schemas, and pipelines
src/features/mails/mails.module.ts Fixes module class name from MailService to MailModule
src/features/features.module.ts Updates module imports replacing contracts with offers
Multiple controllers Adds comprehensive Swagger API documentation decorators
package.json Major dependency updates to NestJS 11, Fastify 5, and security packages
README.md Complete documentation overhaul with detailed setup and API information
Comments suppressed due to low confidence (1)

src/features/offers/services/custom-rider.service.ts:49

  • The error message 'User is not a custom rider' at line 50 is misleading. It should be 'User is not a rider' since the check is verifying if the user type is RIDER, not specifically a 'custom rider'.
    return customRider;

Comment thread src/features/offers/controllers/offers.controller.ts Outdated
Comment on lines +212 to +214
if (!updatedOffer) {
throw new NotFoundException("Failed to update offer. Offer not found.");
}

Copilot AI Jul 26, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This null check is redundant since findOneAndUpdate with 'new: true' will return null if no document matches, but the previous existence check at line 175 already handles the not found case. Consider removing this check or consolidating the error handling logic.

Suggested change
if (!updatedOffer) {
throw new NotFoundException("Failed to update offer. Offer not found.");
}

Copilot uses AI. Check for mistakes.
Comment on lines +12 to +13
_id: new (mongoose as any).Types.ObjectId(offerId),
sponsorId: new (mongoose as any).Types.ObjectId(sponsorId),

Copilot AI Jul 26, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 'as any' type assertion bypasses TypeScript's type safety. Consider importing Types properly from mongoose or using a more type-safe approach.

Suggested change
_id: new (mongoose as any).Types.ObjectId(offerId),
sponsorId: new (mongoose as any).Types.ObjectId(sponsorId),
_id: new Types.ObjectId(offerId),
sponsorId: new Types.ObjectId(sponsorId),

Copilot uses AI. Check for mistakes.
return [
{
$match: {
sponsorId: new (mongoose as any).Types.ObjectId(sponsorId),

Copilot AI Jul 26, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 'as any' type assertion bypasses TypeScript's type safety. Consider importing Types properly from mongoose or using a more type-safe approach.

Suggested change
sponsorId: new (mongoose as any).Types.ObjectId(sponsorId),
sponsorId: new mongoose.Types.ObjectId(sponsorId),

Copilot uses AI. Check for mistakes.
const pipeline = [
{
$match: {
sponsorId: new MongooseSchema.Types.ObjectId(sponsorId),

Copilot AI Jul 26, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent ObjectId creation pattern. This file uses 'MongooseSchema.Types.ObjectId' while pipeline files use 'mongoose.Types.ObjectId'. Consider standardizing the ObjectId creation approach across the codebase.

Suggested change
sponsorId: new MongooseSchema.Types.ObjectId(sponsorId),
sponsorId: new mongoose.ObjectId(sponsorId),

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Arthur-Lucas Arthur-Lucas merged commit 55c7351 into main Jul 26, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants