Skip to content

Conversation

@LONECODER1
Copy link
Contributor

@LONECODER1 LONECODER1 commented Oct 28, 2025

Description

Added Express routing for the auction system.
Includes authenticated and role-based routes for:

  • Creating new auctions (sellers only)
  • Placing bids with ₹100 increments (buyers only)
  • Accepting the highest bid and marking auction as sold (sellers only)

Semver Changes

  • Patch (bug fix, no new features)
  • Minor (new features, no breaking changes)
  • Major (breaking changes)

Issues

Closes #19

Checklist

  • I have read the Contributing Guidelines.
  • Added routes for auction creation, bidding, and bid acceptance.
  • Integrated authentication and role-based authorization middleware.
  • Ensured validation for bid increments and 48-hour auction expiry.

@04shubham7 04shubham7 requested a review from Copilot October 29, 2025 03:42
Copy link
Contributor

Copilot AI left a comment

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 introduces an auction system with bidding functionality to the application. The implementation includes database models for auctions and bids, along with API route definitions for creating auctions, placing bids, and accepting winning bids.

  • Adds Mongoose schemas for Auction and Bid entities with appropriate field validations
  • Creates route definitions for auction operations with role-based access control
  • Establishes authorization rules: sellers can create auctions and accept bids, buyers can place bids

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
backend/src/routes/auctionRoutes.ts Defines three POST endpoints for auction creation, bid placement, and bid acceptance with role-based middleware
backend/src/models/bid.model.ts Creates the Bid schema with references to Auction and User, tracking bid amounts and timestamps
backend/src/models/auction.model.ts Creates the Auction schema with item details, pricing, status tracking, and seller/buyer references
backend/src/controllers/auction.controller.ts Empty controller file that should contain the business logic for auction operations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

04shubham7 and others added 2 commits October 29, 2025 09:19
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@04shubham7 04shubham7 merged commit 489c875 into OPCODE-Open-Spring-Fest:main Oct 29, 2025
4 of 5 checks passed
@04shubham7 04shubham7 self-requested a review October 29, 2025 03:51
Copy link
Member

@04shubham7 04shubham7 left a comment

Choose a reason for hiding this comment

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

Looks Fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Implement auction bid logic (backend)

2 participants