Skip to main content
Version: MyBestDealNow

Auction Management System

Author(s)

  • Sanket Mal

Last Updated Date

2025-09-21


SRS References


Version History

VersionDateChangesAuthor
1.02025-08-13Initial draft for Phase 1 for auction & bid management systemSanket Mal
1.12025-09-21Enhance auction system such that customer can create auction with multiple requirementsSanket Mal
1.22025-09-26Enhanced with bid update, history & notificationsSanket Mal
1.32025-11-10Created API for admin side auction listFaizal Khan

Reverse Auction Platform

Feature Overview

Objective
Implement a reverse auction platform where customers can create auctions to purchase vehicles using two different methods:

  1. Manual Auction Creation:
    The customer fills out a form to manually specify their requirements, such as make, model, features, budget, location, and timeframe.

  2. Wishlist-Based Auction Creation:
    The customer browses dealer inventories, adds multiple vehicles to their wishlist, and later creates a single auction using these shortlisted vehicles.
    This allows the customer to say, "I am open to buying any of these vehicles I shortlisted", and dealers will compete to offer the best deal.

Dealers will receive notifications about new auctions and can express interest and place bids without initially seeing the customer's identity.
Multiple dealers can participate in the same auction, encouraging competitive bidding and better deals for the customer.

The customer's identity will be revealed only to the dealer whose bid is accepted, ensuring privacy and quality lead generation for dealers.

Enhanced Bid Management Features:

  1. Bid Update System: Dealers can now update their bids with revised amounts and terms
  2. Comprehensive Bid History: Complete tracking of all bid changes with version control
  3. Email Notifications: Automated customer notifications when bids are updated
  4. Enhanced Bid Management: Improved workflow for bid placement, updates, and withdrawals.

The updated version introduces multi-requirement auctions, where a single auction can include multiple vehicles or requirements, giving the system flexibility to handle real-world purchasing scenarios.


Scope

We will cover the following features:

  • Two Ways of Auction Creation:

    1. Manual Form: Directly entering requirements.
    2. Wishlist Flow: Browsing inventory → Adding vehicles to wishlist → Creating a single auction from multiple shortlisted vehicles.
  • Public Auction Browsing & Filtering for dealers and buyers.

  • Real-Time Dealer Notifications when new auctions are created.

  • Multi-Dealer Bidding System with support for counter-offers.

  • Enhanced Bid Management:

    • Bid Updates: Dealers can modify their existing bids
    • Bid History Tracking: Complete audit trail of all bid changes
    • Customer Notifications: Email alerts when bids are updated
  • Identity Protection:
    Customer identity stays hidden until a winning bid is accepted.

  • Lead Generation:
    Customer details are shared only with the dealer whose bid was accepted.

  • Auction Lifecycle Management:
    Active → Ended → Cancelled states.


Dependencies

To support this feature, the following systems must be integrated:

  • User Authentication & Authorization – Secure login for customers and dealers.
  • Inventory Management System – Dealers must manage their vehicle listings.
  • Wishlist System – Customers need to shortlist vehicles before auction creation.
  • Dealer Management System – Manage dealer profiles and permissions.
  • Customer Profile Management – Store buyer information and preferences.
  • Location Services – For filtering auctions by location.
  • Real-Time Notifications – Notify dealers instantly about new auctions and bids.
  • Email Service – Send notifications to customers about bid updates.
  • Bid History Management – Track and store all bid modifications.

Requirements

Functional Requirements

1. Auction Creation

Customers can create auctions using two different flows:

A. Manual Form-Based Auction

  • Customer fills out a form providing:
    • Make, model, year, color, and features.
    • Desired budget and price range.
    • Preferred purchase location.
    • Expected purchase timeframe.
  • A unique auction code is automatically generated.

B. Wishlist-Based Auction

  • Customer browses dealer inventories and adds multiple vehicles to their wishlist.
  • When ready, the customer creates one auction that includes all wishlist vehicles.
  • The auction represents the customer's intent to purchase any one of the vehicles included.
  • Dealers can bid on individual vehicles, and the buyer can choose the best deal.

2. Auction Browsing

  • Public listing of all active auctions with anonymized customer data.
  • Search and filter by:
    • Make, model, category, location, price range, and auction end time.
  • View detailed auction information, including:
    • Vehicle details.
    • Current highest bids.
    • Total number of bids.
    • Time remaining until auction ends.

3. Customer Auction Management

  • Customers can:
    • View active auctions they created.
    • View past auctions (ended or cancelled).
    • Edit auction details (budget, timeframe, price range).
    • Cancel active auctions before they end.
    • Receive email notifications when dealers update their bids.

4. Enhanced Dealer Bidding System

  • Dealers can:
    • View and filter available auctions matching their inventory.
    • Receive real-time notifications for newly created auctions that are under radius.
    • Place initial bids on auctions, selecting specific vehicles from their inventory.
    • Update existing bids with revised amounts and terms.
    • Withdraw bids before auction ends.
    • Submit counter-offers in response to buyer negotiations.
    • Track bid history and current status.
    • View complete history of their bid modifications.

5. Bid History & Audit Trail

  • Complete Version Control: Every bid change is tracked with version numbers.
  • Comprehensive History: Store all bid modifications including:
    • Original bid placement
    • All subsequent updates
    • Bid withdrawals
    • Timestamps and user information
  • Audit Trail: Track who made changes and when.
  • Historical Comparison: View differences between bid versions.

6. Enhanced Notification System

  • Customer Notifications:
    • Email alerts when bids are placed on their auctions
    • Email notifications when existing bids are updated
    • Summary of all bid activities
  • Dealer Notifications:
    • Real-time alerts for new auctions
    • Confirmations for bid updates and withdrawals

7. Identity Protection

  • Customer identity remains hidden during the entire bidding process.
  • Dealer identity is visible to customers when a bid is placed.
  • Customer details are revealed only to the winning dealer after the bid is accepted.
  • This ensures:
    • Privacy for customers.
    • Quality leads for dealers.

Non-Functional Requirements

1. Performance

  • Support high concurrency of auctions and bidding activity.
  • Real-time updates for bids and notifications.
  • Fast and efficient search and filtering for both buyers and dealers.
  • Bid history queries should complete within 2 seconds.

2. Security

  • Secure handling of all personal and auction data.
  • Role-based access control to separate customer and dealer permissions.
  • Encryption of sensitive data both at rest and in transit.
  • Audit logging for all bid modifications.

3. Scalability

  • System must scale to handle thousands of simultaneous auctions and bids.
  • Efficient history storage that doesn't impact performance.

4. Usability

  • Easy-to-use interface for both buyers and dealers.
  • Mobile-friendly design to support access from any device.

Workflow Summary

  1. Wishlist Flow (Browsing and Shortlisting):

    • Customer browses dealer inventory that are under radius.
    • Adds multiple vehicles to wishlist.
    • Later, selects vehicles from wishlist and creates a single auction for all of them.
  2. Manual Flow (Form Entry):

    • Customer directly fills out a form specifying desired vehicle details.
    • Creates an auction without browsing dealer inventory.
  3. Enhanced Dealer Bidding Phase:

    • Dealers are notified about the new auction within their specified radius.
    • Multiple dealers place initial bids.
    • Dealers can update their bids multiple times with revised terms.
    • Complete history is maintained for all bid changes.
    • Customers receive email notifications for all bid activities.
  4. Negotiation Phase:

    • Buyer reviews incoming bids and their histories.
    • May engage in negotiations with multiple dealers.
    • Bid update history provides transparency in negotiations.
  5. Auction Closing:

    • Buyer selects the best offer.
    • Winning dealer gains access to customer contact details.
    • Final bid history is preserved for record-keeping.
    • Auction status changes to Ended.

Example Use Case: Enhanced Bidding Workflow

  • Buyer creates auction for Toyota Camry 2022
  • Dealer A places initial bid: $25,000 with 30-day delivery
  • Customer receives email notification about new bid
  • Dealer A updates bid to $24,500 with extended warranty
  • Customer receives email notification about bid update
  • Bid history shows: Version 1 ($25,000) → Version 2 ($24,500)
  • Dealer B places competing bid: $24,000
  • Dealer A updates again to $23,800 with financing options
  • Complete audit trail preserved showing all bid modifications
  • Customer selects Dealer A's final offer

Design Specifications

UI/UX Design

The auction management feature includes several key user interfaces:

  1. Auction Creation Page

    • Form for creating auctions from inventory or custom requirements
    • Vehicle preference selection (make, model, category, condition)
    • Price range and budget input
    • Feature selection checkboxes
    • Location and timeframe specification
  2. Auction Browse Page

    • Public auction listing with search and filter capabilities
    • Auction cards showing vehicle details, current bids, time remaining
    • Detailed auction view with full specifications
  3. My Auctions Page

    • Customer's own auction management
    • Separate tabs for active and historical auctions
    • Auction status tracking and modification options
  4. Enhanced Bid Management Page

    • View all bids received for customer's auctions
    • Bid history timeline showing all updates
    • Bid comparison and selection tools
    • Version comparison for updated bids
  5. Dealer Bid Update Interface

    • Update bid form with current values pre-filled
    • Bid history viewer showing previous versions
    • Update confirmation with change summary

Database Schema

1. auctionmaster Table


CREATE TABLE IF NOT EXISTS public.auctionmaster
(
auctionid uuid NOT NULL,
auctioncode text COLLATE pg_catalog."default" NOT NULL,
customerid uuid NOT NULL,
vehicletype text COLLATE pg_catalog."default",
pricerangemin numeric(18,2),
pricerangemax numeric(18,2),
zipcode text COLLATE pg_catalog."default",
latitude double precision,
longitude double precision,
timeframeindays integer NOT NULL DEFAULT 7,
additionalnote text COLLATE pg_catalog."default",
status text COLLATE pg_catalog."default" NOT NULL DEFAULT 'active'::text,
createdat timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
expireat timestamp with time zone,
updatedat timestamp with time zone,
isdeleted boolean DEFAULT false,
canceledat timestamp with time zone,
completedat timestamp with time zone,
budget text COLLATE pg_catalog."default",
CONSTRAINT auctionmaster_pkey PRIMARY KEY (auctionid),
CONSTRAINT auctionmaster_auctioncode_key UNIQUE (auctioncode),
CONSTRAINT fk_auction_customer FOREIGN KEY (customerid)
REFERENCES public.customermaster (customerid) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE CASCADE
);

2. auctionrequirement Table



CREATE TABLE IF NOT EXISTS public.auctionrequirement
(
requirementid uuid NOT NULL,
auctionid uuid NOT NULL,
inventoryid uuid,
vehiclespecificationid uuid,
make text COLLATE pg_catalog."default",
model text COLLATE pg_catalog."default",
bodystyle text COLLATE pg_catalog."default",
year integer,
"trim" text COLLATE pg_catalog."default",
createdat timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
updatedat timestamp with time zone,
isdeleted boolean DEFAULT false,
CONSTRAINT auctionrequirement_pkey PRIMARY KEY (requirementid),
CONSTRAINT fk_auctionrequirement_auction FOREIGN KEY (auctionid)
REFERENCES public.auctionmaster (auctionid) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE CASCADE,
CONSTRAINT fk_auctionrequirement_inventory FOREIGN KEY (inventoryid)
REFERENCES public.inventorymaster (inventoryid) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE SET NULL,
CONSTRAINT fk_auctionrequirement_vehiclespec FOREIGN KEY (vehiclespecificationid)
REFERENCES public.vehiclespecification (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE SET NULL
);


3. wishlist Table


CREATE TABLE IF NOT EXISTS public.wishlist
(
wishlistid uuid NOT NULL DEFAULT gen_random_uuid(),
customerid uuid NOT NULL,
inventoryids uuid[],
vehiclespecificationids uuid[],
createdat timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
updatedat timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT wishlist_pkey PRIMARY KEY (wishlistid),
CONSTRAINT wishlist_customerid_key UNIQUE (customerid),
CONSTRAINT fk_customer FOREIGN KEY (customerid)
REFERENCES public.customermaster (customerid) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE CASCADE
)

2. bid Table



CREATE TABLE IF NOT EXISTS public.bid
(
bidid uuid NOT NULL,
auctionid uuid NOT NULL,
dealerid uuid NOT NULL,
inventoryid uuid,
bidamount numeric(18,2) NOT NULL,
deliverytimeframeinday integer DEFAULT 7,
warrantyofferinmonth integer DEFAULT 0,
cashpaymentdiscountavailable boolean DEFAULT false,
cashpaymentdiscountpercent numeric(5,2),
financingavailable boolean DEFAULT false,
financingrate numeric(5,2),
additionalservices text[] COLLATE pg_catalog."default" DEFAULT '{}'::text[],
vehicleconditionnotes text COLLATE pg_catalog."default",
notes text COLLATE pg_catalog."default",
status text COLLATE pg_catalog."default" NOT NULL DEFAULT 'active'::text,
createdat timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
updatedat timestamp with time zone,
isdeleted boolean DEFAULT false,
vehiclespecificationid uuid,
createdby uuid,
updatedby uuid,
CONSTRAINT bid_pkey PRIMARY KEY (bidid),
CONSTRAINT fk_bid_auction FOREIGN KEY (auctionid)
REFERENCES public.auctionmaster (auctionid) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE CASCADE,
CONSTRAINT fk_bid_dealer FOREIGN KEY (dealerid)
REFERENCES public.dealermaster (dealerid) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE CASCADE,
CONSTRAINT fk_bid_inventory FOREIGN KEY (inventoryid)
REFERENCES public.inventorymaster (inventoryid) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE CASCADE,
CONSTRAINT fk_bid_vehiclespecification FOREIGN KEY (vehiclespecificationid)
REFERENCES public.vehiclespecification (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE CASCADE,
CONSTRAINT bid_cashpaymentdiscountpercent_check CHECK (cashpaymentdiscountpercent IS NULL OR cashpaymentdiscountpercent >= 0::numeric AND cashpaymentdiscountpercent <= 100::numeric),
CONSTRAINT bid_financingrate_check CHECK (financingrate IS NULL OR financingrate >= 0::numeric AND financingrate <= 100::numeric)
);

3. bidhistory Table


CREATE TABLE IF NOT EXISTS public.bidhistory
(
historyid uuid NOT NULL DEFAULT gen_random_uuid(),
bidid uuid NOT NULL,
versionindex integer NOT NULL,
bidamount numeric(18,2),
deliverytimeframeinday integer,
warrantyofferinmonth integer,
cashpaymentdiscountavailable boolean NOT NULL DEFAULT false,
cashpaymentdiscountpercent numeric(5,2),
financingavailable boolean NOT NULL DEFAULT false,
financingrate numeric(5,2),
additionalservices text[] COLLATE pg_catalog."default" DEFAULT '{}'::text[],
vehicleconditionnotes text COLLATE pg_catalog."default",
notes text COLLATE pg_catalog."default",
action character varying(50) COLLATE pg_catalog."default" NOT NULL,
updatedby uuid NOT NULL,
updatedat timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT bidhistory_pkey PRIMARY KEY (historyid),
CONSTRAINT uq_bid_version UNIQUE (bidid, versionindex),
CONSTRAINT fk_bidhistory_bid FOREIGN KEY (bidid)
REFERENCES public.bid (bidid) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE CASCADE,
CONSTRAINT bidhistory_cashpaymentdiscountpercent_check CHECK (cashpaymentdiscountpercent IS NULL OR cashpaymentdiscountpercent >= 0::numeric AND cashpaymentdiscountpercent <= 100::numeric),
CONSTRAINT bidhistory_financingrate_check CHECK (financingrate IS NULL OR financingrate >= 0::numeric AND financingrate <= 100::numeric),
CONSTRAINT chk_bidamount_positive CHECK (bidamount IS NULL OR bidamount > 0::numeric),
CONSTRAINT chk_deliverytimeframe_range CHECK (deliverytimeframeinday IS NULL OR deliverytimeframeinday >= 1 AND deliverytimeframeinday <= 365),
CONSTRAINT chk_versionindex_positive CHECK (versionindex > 0),
CONSTRAINT chk_warrantyoffer_range CHECK (warrantyofferinmonth IS NULL OR warrantyofferinmonth >= 0 AND warrantyofferinmonth <= 120)
);

  • Data Models:
    (Detail the data structures, including database schemas or objects.)

    1. Auction Related Models

    public record AuctionRequirement
    {
    public Guid RequirementId { get; set; } = Guid.NewGuid();
    public string? Make { get; set; } // Optional - can be null for "any brand"
    public string? Model { get; set; } // Optional - can be null for "any model"
    public string? BodyStyle { get; set; } // Optional - can be null for "any body style"
    public int? Year { get; set; } // Optional - can be null for "any year"
    public string? Trim { get; set; } // Optional - can be null for "any trim"
    [JsonIgnore]
    public VehicleType VehicleType { get; set; } = VehicleType.Both;
    }

    public record EnhanceAuctionRequirementWithImage : AuctionRequirement
    {
    public string? ThumbnailImage { get; set; } = string.Empty;
    }

    public record AuctionRequest
    {
    public Guid CustomerId { get; set; }
    public VehicleType VehicleType { get; set; } = VehicleType.Both;

    // Optional: Used to pre-populate AuctionRequirements
    public List<Guid> InventoryId { get; set; } = new();

    // Main requirements
    public List<AuctionRequirement> AuctionRequirements { get; set; } = new();

    // Budget and pricing constraints
    public decimal? PriceRangeMin { get; set; }
    public decimal? PriceRangeMax { get; set; }
    public Budget? Budget { get; set; }


    // Location and timing
    public string? ZipCode { get; set; }
    public double Latitude { get; set; }
    public double Longitude { get; set; }

    [Range(1, 60)]
    public int TimeframeInDays { get; set; } = 7;

    [StringLength(1000)]
    public string? AdditionalNote { get; set; }
    }
    public class AuctionCreateResponse
    {
    public string Message { get; set; }
    public string Status { get; set; }
    public string AuctionId { get; set; }
    public string AuctionCode { get; set; }
    }
    public record AuctionSummary
    {
    public Guid AuctionId { get; set; }
    public string AuctionCode { get; set; } = string.Empty;
    public string AuctionTitle {get; set; } = string.Empty;
    public Guid CustomerId { get; set; }
    public VehicleType VehicleType { get; set; } = VehicleType.Both;

    // Multi-requirement support
    public List<EnhanceAuctionRequirementWithImage> AuctionRequirements { get; set; } = new();

    // Budget and pricing constraints
    public decimal? PriceRangeMin { get; set; }
    public decimal? PriceRangeMax { get; set; }
    public Budget? Budget { get; set; }

    // Location and timing
    public string ZipCode { get; set; } = string.Empty;
    public double Latitude { get; set; } = string.Empty;
    public double Longitude { get; set; } = string.Empty;

    public int TimeframeInDays { get; set; } = 7;
    public string? AdditionalNote { get; set; }

    public AuctionStatus Status { get; set; }

    // DateTime fields
    public DateTime CreatedAt { get; set; }
    public DateTime? CompletedAt { get; set; }
    public DateTime? CanceledAt { get; set; }

    // Current status information
    public decimal? CurrentBestOffer { get; set; }
    public decimal? Savings { get; set; }
    public int TotalBids { get; set; }

    // Leading Dealer Info
    public string? DealerName { get; set; }
    public string? DealerCode { get; set; }
    public string? DealerLogoUrl { get; set; }

    public bool IsBidPlaced { get; set; } // Flag if logged-in dealer has placed a bid
    public decimal? FinalPrice { get; set; } // Final auction price

    public DateTime? ExpireAt { get; set; }
    }
    public record AuctionFilter
    {
    // Core Auction Filters
    public List<AuctionStatus>? Status { get; set; }
    public string? AuctionCode { get; set; }

    // Vehicle Requirement Filters
    public string? Make { get; set; }
    public string? Model { get; set; }
    public string? Trim { get; set; }
    public string? BodyStyle { get; set; }
    public VehicleType? VehicleType { get; set; }
    public int? Year { get; set; }

    // Budget and Pricing
    public decimal? MinFinalPrice { get; set; }
    public decimal? MaxFinalPrice { get; set; }
    public decimal? PriceRangeMin { get; set; }
    public decimal? PriceRangeMax { get; set; }
    public Budget? BudgetType { get; set; }

    // Location
    public List<string>? ZipCodes { get; set; }
    public string? ZipCode { get; set; } // Single ZipCode for backward compatibility

    // Customer & Dealer Filters
    public Guid? CustomerId { get; set; }
    public Guid? DealerId { get; set; }

    // Date Ranges
    public DateTime? CreatedFrom { get; set; }
    public DateTime? CreatedTo { get; set; }
    public DateTime? ExpiresFrom { get; set; }
    public DateTime? ExpiresTo { get; set; }
    public DateTime? CanceledFrom { get; set; }
    public DateTime? CanceledTo { get; set; }
    public DateTime? CompletedFrom { get; set; }
    public DateTime? CompletedTo { get; set; }

    // Global Search
    public string? SearchKeyword { get; set; }

    // Pagination
    public int RowsPerPage { get; set; } = 10;
    public int PageNumber { get; set; } = 1;

    // Sorting
    public AuctionSortBy? SortBy { get; set; }
    }

    public record DealSummary
    {
    public AuctionSummary AuctionInfo { get; set; } = new AuctionSummary();
    public BidDetails BidInfo { get; set; } = new BidDetails();
    public CustomerMinimalInfo CustomerInfo { get; set; } = new CustomerMinimalInfo();
    }
    public record DealFilter
    {
    public string? Search { get; set; }
    public DateTime? WonFrom { get; set; }
    public DateTime? WonTo { get; set; }
    public int PageNumber { get; set; } = 1;
    public int RowsPerPage { get; set; } = 10;

    public Guid? DealerId { get; set; }

    // Filter by Customer info
    public Guid? CustomerId { get; set; }
    public string? CustomerName { get; set; }
    public string? CustomerPhone { get; set; }
    public string? CustomerEmail { get; set; }
    public decimal? MinWinningBid { get; set; }
    public decimal? MaxWinningBid { get; set; }
    // Filter by Vehicle info
    public string? Vin { get; set; }
    public int? Year { get; set; }
    public VehicleType? VehicleType { get; set; }
    public Brand? Make { get; set; }
    public string? Model { get; set; }
    public string? Trim { get; set; }
    public BodyStyle? BodyStyle { get; set; }

    }
    public enum AuctionStatus
    {
    Active = 1,
    Completed,
    Canceled,
    Expired
    }
    public enum AuctionSortBy
    {
    CreatedDate = 1,
    CompletedDate,
    CurrentBid,
    FinalPrice,
    AuctionCode,
    TotalBids
    }
    public enum RecommendationSortBy
    {
    AuctionCount = 1,
    StartingPrice,
    Year
    }
    /// <summary>
    /// Represents the possible statuses of a bid in an auction.
    /// </summary>
    public enum BidStatus
    {
    /// <summary>
    /// The bid is currently active and under consideration.
    /// </summary>
    Active = 1,

    /// <summary>
    /// The bidder has withdrawn the bid voluntarily before the auction closed.
    /// </summary>
    Withdrawn,

    /// <summary>
    /// The bid has been accepted as the winning bid.
    /// </summary>
    Accepted,

    /// <summary>
    /// The bid has been explicitly rejected by the auction owner.
    /// </summary>
    Rejected

    }
    public enum AdditionalService
    {
    LeaseOptionAvailable = 1,
    FreeOilChange,
    MaintenancePackage,
    RoadsideAssistance,
    FreeDelivery,
    VehiclePickupService,
    FullTankOfGas,
    ProfessionalDetail,
    AccessoriesPackage,
    TradeInAccepted,
    InstantAppraisalAvailable
    }

    public record AdminAuctionSummary
    {
    public Guid AuctionId { get; set; }
    public string AuctionCode { get; set; } = string.Empty;
    public string AuctionTitle { get; set; } = string.Empty;

    // Customer data embedded instead of CustomerId
    public CustomerData Customer { get; set; } = new();

    public VehicleType VehicleType { get; set; } = VehicleType.Both;

    public List<EnhanceAuctionRequirementWithImage> AuctionRequirements { get; set; } = new();

    public decimal? PriceRangeMin { get; set; }
    public decimal? PriceRangeMax { get; set; }
    public Budget? Budget { get; set; }

    public string ZipCode { get; set; } = string.Empty;
    public int TimeframeInDays { get; set; } = 7;
    public string? AdditionalNote { get; set; }

    public AuctionStatus Status { get; set; }

    public DateTime CreatedAt { get; set; }
    public DateTime? CompletedAt { get; set; }
    public DateTime? CanceledAt { get; set; }

    public decimal? CurrentBestOffer { get; set; }
    public decimal? Savings { get; set; }
    public int TotalBids { get; set; }

    public string? DealerName { get; set; }
    public string? DealerCode { get; set; }
    public string? DealerLogoUrl { get; set; }

    public bool IsBidPlaced { get; set; }
    public decimal? FinalPrice { get; set; }
    public DateTime? ExpireAt { get; set; }
    }

    public record CustomerData
    {
    public string Firstname { get; set; } = string.Empty;
    public string Lastname { get; set; } = string.Empty;
    public string Email { get; set; } = string.Empty;
    public string Phone { get; set; } = string.Empty;
    public string Dateofbirth { get; set; } = string.Empty;
    public string Gender { get; set; } = string.Empty;
    public string Profileimageurl { get; set; } = string.Empty;
    public string Address { get; set; } = string.Empty;
    }

    1. Bid Related Models

    public record BidUpdateRequest
    {
    [Range(0.01, double.MaxValue, ErrorMessage = "Bid amount must be greater than 0")]
    public decimal BidAmount { get; init; }

    [Range(1, 365, ErrorMessage = "Delivery timeframe must be between 1 and 365 days")]
    public int DeliveryTimeframeInDay { get; set; } = 7;

    [Range(0, 120, ErrorMessage = "Warranty offer must be between 0 and 120 months")]
    public int WarrantyOfferInMonth { get; set; }

    public bool CashPaymentDiscountAvailable { get; set; }

    [Range(0, 100, ErrorMessage = "Cash payment discount percent must be between 0 and 100")]
    public decimal? CashPaymentDiscountPercent { get; set; }

    public bool FinancingAvailable { get; set; }

    [Range(0, 100, ErrorMessage = "Financing rate must be between 0 and 100")]
    public decimal? FinancingRate { get; set; }

    public List<string> AdditionalServices { get; set; } = new();

    [StringLength(1000, ErrorMessage = "Vehicle condition notes cannot exceed 1000 characters")]
    public string? VehicleConditionNotes { get; set; }

    [StringLength(1000, ErrorMessage = "Notes cannot exceed 1000 characters")]
    public string? Notes { get; init; }
    }

    public record BidCreateRequest : BidUpdateRequest
    {
    public Guid? InventoryId { get; init; }
    public Guid? VehicleSpecificationId { get; init; }

    }

    public record Bid : BidCreateRequest
    {
    public Guid BidId { get; init; }
    public Guid AuctionId { get; init; }
    public Guid DealerId { get; init; }
    public BidStatus Status { get; set; } = BidStatus.Active;
    public DateTime? CreatedAt { get; init; } = DateTime.UtcNow;

    }

    public record BidDetails : Bid
    {
    public string DealerCode { get; init; } = string.Empty;
    public string DealerName { get; init; } = string.Empty;
    public string DealerLogo { get; init; } = string.Empty;
    [JsonIgnore]
    public VehicleSpecification? VehicleInfo { get; set; }
    [JsonIgnore]
    public InventoryDetailsWithAddress? InventoryDetails { get; set; }
    public VehicleDetails? VehicleDetails { get; set; }
    public DateTime? UpdatedAt { get; init; }
    [JsonIgnore]
    public Guid CustomerId { get; set; }
    }
    public class VehicleDetails
    {
    public string? Vin { get; set; }
    public int? Year { get; set; }
    public int? VehicleType { get; set; }
    public string? Make { get; set; }
    public string? Model { get; set; }
    public string? Trim { get; set; }
    public string? BodyStyle { get; set; }
    public string? ColorExterior { get; set; }
    public string? ColorInterior { get; set; }
    public int? Mileage { get; set; }
    public string? MileageUnit { get; set; }
    public string? Engine { get; set; }
    public string? Transmission { get; set; }
    public string? FuelType { get; set; }
    public string? Drivetrain { get; set; }
    public int? Doors { get; set; }
    public string? ThumbnailImage { get; set; }
    public List<string>? KeyFeatures { get; set; }
    }

    public record BidFilter
    {
    // Status filters
    public List<BidStatus>? Status { get; init; }
    // Dealer Filters
    public Guid? DealerId { get; init; }

    // Offered Vehicle Filters
    public Guid? InventoryId { get; init; }
    public Guid? VehicleSpecificationId { get; init; }
    public string? BodyStyle { get; init; }
    public string? Make { get; init; }
    public string? Model { get; init; }
    public int? Year { get; init; }
    public string? Trim { get; init; }

    // Bid Amount filters
    public decimal? MinBidAmount { get; init; }
    public decimal? MaxBidAmount { get; init; }

    // Additional Offer filters
    public int? MinDeliveryTimeframeInDay { get; init; }
    public int? MaxDeliveryTimeframeInDay { get; init; }
    public int? MinWarrantyOfferInMonth { get; init; }
    public int? MaxWarrantyOfferInMonth { get; init; }
    public bool? CashPaymentDiscountAvailable { get; init; }
    public decimal? MinCashPaymentDiscountPercent { get; init; }
    public decimal? MaxCashPaymentDiscountPercent { get; init; }
    public bool? FinancingAvailable { get; init; }
    public decimal? MinFinancingRate { get; init; }
    public decimal? MaxFinancingRate { get; init; }
    public List<string>? AdditionalServices { get; init; }
    public string? VehicleConditionNotes { get; init; }
    public string? Notes { get; init; }

    // Search keyword across multiple text fields
    public string? SearchKeyword { get; init; }

    // Sorting
    public BidSortBy? SortBy { get; init; }

    // Pagination
    public int RowsPerPage { get; init; } = 10;
    public int PageNumber { get; init; } = 1;

    // Date filters
    public DateTime? CreatedFrom { get; init; }
    public DateTime? CreatedTo { get; init; }
    public DateTime? UpdatedFrom { get; init; }
    public DateTime? UpdatedTo { get; init; }

    }

    public class UpdateBidStatusRequest
    {
    [Required]
    public BidStatus Status { get; set; }
    }

    public record BidHistoryEntry : BidUpdateRequest
    {
    public Guid? HistoryId { get; init; }
    public Guid? BidId { get; init; }
    public int? VersionIndex { get; init; }
    public BidAction? Action { get; init; } // CREATE, UPDATE, WITHDRAW
    public Guid? UpdatedBy { get; init; }
    public DateTime? UpdatedAt { get; init; }

    }

    public record BidHistoryResponse
    {
    public Guid BidId { get; init; }
    public Guid AuctionId { get; init; }
    public List<BidHistoryEntry> History { get; init; } = new();
    public BidDetails? CurrentBidDetails { get; init; }
    }
    1. Wishlist Related Models
     // WishList related Structure
    public record AddWishlistItemRequest
    {
    public Guid InventoryId {get; init;} // Later each inventory will tag with a specific vehicle specification id and then we will use `Guid VehicleSpecificationId`
    //public Guid VehicleSpecificationId {get; set;}
    }
    public record RemoveWishlistItemRequest
    {

    public Guid InventoryId {get; set;} // Later each inventory will tag with a specific vehicle specification id and then we will use `Guid VehicleSpecificationId`
    public bool IsClearAll {get; init;} = false;
    //public Guid VehicleSpecificationId {get; set;}
    }
    public record WishListDetails
    {
    public Guid CustomerId {get; set;}
    public Guid WishListId {get; set;}
    public List<InventoryMaster> WishlistItems {get; set;}
    }
    // Here we just add one property `IsWishListed` in inventory structure at the last
    public record InventoryMaster
    {
    public Guid? InventoryId { get; set; }
    public Guid DealerId { get; set; }

    [Required]
    public string Vin { get; set; } = string.Empty;

    public string? StockNumber { get; set; }
    public int? Year { get; set; }

    public VehicleType? VehicleType { get; set; }
    public DateTime? PurchaseDate { get; set; }

    public string? Make { get; set; }

    [Required]
    public string Model { get; set; } = string.Empty;

    public string? Trim { get; set; }
    public string? BodyStyle { get; set; }
    public string? ColorExterior { get; set; }
    public string? ColorInterior { get; set; }
    public int? Mileage { get; set; }
    public string? MileageUnit { get; set; }
    public string? Engine { get; set; }
    public string? Transmission { get; set; }
    public string? FuelType { get; set; }
    public string? Drivetrain { get; set; }
    public int? Doors { get; set; }

    public decimal? ActualPrice { get; set; }
    public decimal? DiscountedPrice { get; set; }
    public Currency Currency { get; set; } = Currency.USD;
    public bool? TaxIncluded { get; set; } = false;

    public VehicleCondition? VehicleCondition { get; set; }
    public bool? IsCertifiedPreOwned { get; set; } = false;
    public DateTime? RegistrationDate { get; set; }
    public DateTime? WarrantyExpiryDate { get; set; }

    public VehicleStatus Status { get; set; } = VehicleStatus.Available;
    public Guid? AddressId { get; set; }

    public List<string>? Images { get; set; }
    public string? ThumbnailImage { get; set; }
    public List<string>? KeyFeatures { get; set; }
    public string? AdditionalNote { get; set; }

    public Guid? CreatedBy { get; set; }
    public DateTimeOffset? CreatedAt { get; set; } = DateTimeOffset.UtcNow;
    public Guid? UpdatedBy { get; set; }
    public DateTimeOffset? UpdatedAt { get; set; }
    public bool IsDeleted { get; set; } = false;
    }
    public record InventoryDetailsWithAddress : InventoryMaster
    {
    public DealerAddress Address { get; set; } = new DealerAddress();
    public Guid? VehicleSpecificationId { get; set; }
    public bool IsWishListed { get; set; } = false; // Newly Added
    }

    1. Auction & Bid Related Enum
     public enum VehicleType
    {
    New = 1,
    PreOwned,
    Both
    }
    public enum BodyStyle
    {
    SUV = 1,
    Sedan,
    Hatchback,
    Coupe,
    Convertible,
    Truck,
    Van,
    Wagon,
    Crossover,
    Minivan,
    Pickup
    }
    public enum Budget
    {
    BudgetFriendly = 1,
    Midrange = 2,
    Premium = 3,
    Luxury = 4
    }
    public enum AuctionStatus
    {
    Active = 1,
    Completed,
    Canceled,
    Expired
    }
    public enum AuctionSortBy
    {
    NewestFirst = 1,
    EndingSoon,
    PriceLowToHigh,
    PriceHighToLow,
    MostBids
    }
    public enum BidSortBy
    {
    BidAmountLowToHigh = 1,
    BidAmountHighToLow,
    NewestFirst,
    OldestFirst,
    DeliveryTimeShort,
    DeliveryTimeLong,
    WarrantyLengthHighToLow,
    FinancingRateLowToHigh
    }
    public enum BidAction
    {
    Place = 1,
    Update,
    Withdraw
    }
    /// <summary>
    /// Represents the possible statuses of a bid in an auction.
    /// </summary>
    public enum BidStatus
    {
    /// <summary>
    /// The bid is currently active and under consideration.
    /// </summary>
    Active = 1,

    /// <summary>
    /// The bidder has withdrawn the bid voluntarily before the auction closed.
    /// </summary>
    Withdrawn,

    /// <summary>
    /// The bid has been accepted as the winning bid.
    /// </summary>
    Accepted,

    /// <summary>
    /// The bid has been explicitly rejected by the auction owner.
    /// </summary>
    Rejected,

    /// <summary>
    /// The bid has expired due to auction expiration.
    /// </summary>
    Expired
    }

  • API Interfaces: (Define the APIs required for this feature, including endpoints, methods, request/response formats.)

EndpointMethodParametersResponseResponse Status Codes
/api/auction/createPOSTAuctionRequestAuctionCreateResponse201, 401,403, 500
/api/auction/listGETAuctionFilterServerPaginatedData<AuctionSummary>200, 204,401,403, 500
/api/auction/public/listGETAuctionFilterServerPaginatedData<AuctionSummary>200, 204,401,403, 500
/api/auction/details/{auctionId}GETGuid auctionIdAuctionSummary201, 204,401,403, 500
/api/auction/update/{auctionId}PUTGuid auctionId AuctionRequestCommonResponse200,401,403,500
/api/auction/cancel/{auctionId}PUTGuid auctionIdCommonResponse200,401,403,500
/api/auction/{auctionId}/bidPOSTGuid auctionId, BidCreateRequestCommonResponse201, 400, 401, 500
/api/auction/{auctionId}/bid/{bidId}PUTGuid auctionId, Guid bidId, BidUpdateRequestCommonResponse200, 400, 401, 500
/api/auction/{auctionId}/bid/{bidId}/historyGETGuid auctionId, Guid bidIdBidHistoryResponse200, 404, 401, 500
/api/auction/{auctionId}/bid/{bidId}/accept-or-rejectPUTGuid auctionId, Guid bidId, UpdateBidStatusRequestCommonResponse200, 400, 401, 500
/api/auction/{auctionId}/bid/{bidId}/withdrawPUTGuid auctionId, Guid bidIdCommonResponse200, 400, 401, 500
/api/auction/{auctionId}/bid-listGETGuid auctionId , BidFilterServerPaginatedData<BidDetails>200, 204,401,403,500
/api/auction/dealsGETDealFilterServerPaginatedData<DealSummary>200,401,403,500
/api/auction/wishlist/add-itemPOSTAddWishlistItemRequestCommonResponse200,401,403,500
/api/auction/wishlist/remove-itemDELETERemoveWishlistItemRequestCommonResponse200,401,403,500
/api/auction/wishlistGETWishListDetails200,401,403,500
/api/auction/admin-dataGetAuctionFilterServerPaginatedData<AdminAuctionSummary>200, 400, 401,403, 500

API Request & Response Examples

Below are detailed JSON examples for each API endpoint to help frontend developers understand the exact structure of request and response bodies.

1. Create Auction

Endpoint: POST /api/auction/create

Request Body:

{
"customerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"vehicleType": 1,
"inventoryId": [],
"auctionRequirements": [
{
"requirementId": "3fa85f64-5717-4562-b3fc-2c963f66afa7",
"make": "Toyota",
"model": "Camry",
"bodyStyle": "Sedan",
"year": 2022,
"trim": "XLE"
},
{
"requirementId": "3fa85f64-5717-4562-b3fc-2c963f66afa8",
"make": "Honda",
"model": "Accord",
"bodyStyle": "Sedan",
"year": 2022,
"trim": "Sport"
}
],
"priceRangeMin": 25000.0,
"priceRangeMax": 35000.0,
"budget": 2,
"zipCode": "90210",
"timeframeInDays": 7,
"additionalNote": "Looking for a reliable sedan with good fuel economy"
}

Response Body:

{
"status": 0,
"message": "Auction created successfully",
"auctionId": "3fa85f64-5717-4562-b3fc-2c963f66afa9",
"auctionCode": "AUC-2024-001234"
}

2. List Auctions (Customer)

Endpoint: GET /api/auction/list?pageNumber=1&rowsPerPage=10&status=1&customerId=3fa85f64-5717-4562-b3fc-2c963f66afa6

Query Parameters: All filters from AuctionFilter model

Response Body:

{
"data": [
{
"auctionId": "3fa85f64-5717-4562-b3fc-2c963f66afa9",
"auctionCode": "AUC-2024-001234",
"auctionTitle": "Toyota Camry 2022 & Honda Accord 2022",
"customerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"vehicleType": 1,
"auctionRequirements": [
{
"requirementId": "3fa85f64-5717-4562-b3fc-2c963f66afa7",
"make": "Toyota",
"model": "Camry",
"bodyStyle": "Sedan",
"year": 2022,
"trim": "XLE",
"thumbnailImage": "https://example.com/images/camry.jpg"
},
{
"requirementId": "3fa85f64-5717-4562-b3fc-2c963f66afa8",
"make": "Honda",
"model": "Accord",
"bodyStyle": "Sedan",
"year": 2022,
"trim": "Sport",
"thumbnailImage": "https://example.com/images/accord.jpg"
}
],
"priceRangeMin": 25000.0,
"priceRangeMax": 35000.0,
"budget": 2,
"zipCode": "90210",
"timeframeInDays": 7,
"additionalNote": "Looking for a reliable sedan with good fuel economy",
"status": 1,
"createdAt": "2024-09-15T10:30:00Z",
"completedAt": null,
"canceledAt": null,
"currentBestOffer": 28500.0,
"savings": 1500.0,
"totalBids": 5,
"dealerName": "Premium Auto Sales",
"dealerCode": "DLR-001",
"dealerLogoUrl": "https://example.com/logos/dealer001.jpg",
"isBidPlaced": false,
"finalPrice": null,
"expireAt": "2024-09-22T10:30:00Z"
}
],
"totalNumber": 15,
"hasPreviousPage": false,
"hasNextPage": true,
"totalPages": 2,
"pageNumber": 1,
"rowsPerPage": 10
}

3. List Public Auctions (Dealers)

Endpoint: GET /api/auction/public/list?pageNumber=1&rowsPerPage=10&make=Toyota&zipCode=90210

Query Parameters: All filters from AuctionFilter model

Response Body: Same structure as List Auctions (Customer), but customerId and customer contact details are hidden.


4. Get Auction Details

Endpoint: GET /api/auction/details/{auctionId}

Response Body:

{
"auctionId": "3fa85f64-5717-4562-b3fc-2c963f66afa9",
"auctionCode": "AUC-2024-001234",
"auctionTitle": "Toyota Camry 2022 & Honda Accord 2022",
"customerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"vehicleType": 1,
"auctionRequirements": [
{
"requirementId": "3fa85f64-5717-4562-b3fc-2c963f66afa7",
"make": "Toyota",
"model": "Camry",
"bodyStyle": "Sedan",
"year": 2022,
"trim": "XLE",
"thumbnailImage": "https://example.com/images/camry.jpg"
}
],
"priceRangeMin": 25000.0,
"priceRangeMax": 35000.0,
"budget": 2,
"zipCode": "90210",
"timeframeInDays": 7,
"additionalNote": "Looking for a reliable sedan with good fuel economy",
"status": 1,
"createdAt": "2024-09-15T10:30:00Z",
"completedAt": null,
"canceledAt": null,
"currentBestOffer": 28500.0,
"savings": 1500.0,
"totalBids": 5,
"dealerName": "Premium Auto Sales",
"dealerCode": "DLR-001",
"dealerLogoUrl": "https://example.com/logos/dealer001.jpg",
"isBidPlaced": true,
"finalPrice": null,
"expireAt": "2024-09-22T10:30:00Z"
}

5. Update Auction

Endpoint: PUT /api/auction/update/{auctionId}

Request Body: Same structure as Create Auction request

Response Body:

{
"status": 0,
"message": "Auction updated successfully"
}

6. Cancel Auction

Endpoint: PUT /api/auction/cancel/{auctionId}

Request Body: None

Response Body:

{
"status": 0,
"message": "Auction cancelled successfully"
}

7. Place Bid

Endpoint: POST /api/auction/{auctionId}/bid

Request Body:

{
"inventoryId": "3fa85f64-5717-4562-b3fc-2c963f66af10",
"vehicleSpecificationId": null,
"bidAmount": 28500.0,
"deliveryTimeframeInDay": 7,
"warrantyOfferInMonth": 36,
"cashPaymentDiscountAvailable": true,
"cashPaymentDiscountPercent": 2.5,
"financingAvailable": true,
"financingRate": 3.99,
"additionalServices": ["FreeDelivery", "FreeOilChange", "MaintenancePackage"],
"vehicleConditionNotes": "Excellent condition, single owner, full service history",
"notes": "Can deliver within 5 days if needed"
}

Response Body:

{
"status": 0,
"message": "Bid placed successfully"
}

8. Update Bid

Endpoint: PUT /api/auction/{auctionId}/bid/{bidId}

Request Body:

{
"bidAmount": 27800.0,
"deliveryTimeframeInDay": 5,
"warrantyOfferInMonth": 48,
"cashPaymentDiscountAvailable": true,
"cashPaymentDiscountPercent": 3.0,
"financingAvailable": true,
"financingRate": 3.49,
"additionalServices": [
"FreeDelivery",
"FreeOilChange",
"MaintenancePackage",
"FullTankOfGas"
],
"vehicleConditionNotes": "Excellent condition, single owner, full service history",
"notes": "Updated offer with better terms and faster delivery"
}

Response Body:

{
"status": 0,
"message": "Bid updated successfully."
}

9. Get Bid History

Endpoint: GET /api/auction/{auctionId}/bid/{bidId}/history

Response Body:

{
"bidId": "3fa85f64-5717-4562-b3fc-2c963f66af20",
"auctionId": "3fa85f64-5717-4562-b3fc-2c963f66afa9",
"history": [
{
"historyId": "3fa85f64-5717-4562-b3fc-2c963f66af21",
"bidId": "3fa85f64-5717-4562-b3fc-2c963f66af20",
"versionIndex": 1,
"bidAmount": 28500.0,
"deliveryTimeframeInDay": 7,
"warrantyOfferInMonth": 36,
"cashPaymentDiscountAvailable": true,
"cashPaymentDiscountPercent": 2.5,
"financingAvailable": true,
"financingRate": 3.99,
"additionalServices": [
"FreeDelivery",
"FreeOilChange",
"MaintenancePackage"
],
"vehicleConditionNotes": "Excellent condition, single owner, full service history",
"notes": "Can deliver within 5 days if needed",
"action": 1,
"updatedBy": "3fa85f64-5717-4562-b3fc-2c963f66af30",
"updatedAt": "2024-09-15T14:30:00Z"
},
{
"historyId": "3fa85f64-5717-4562-b3fc-2c963f66af22",
"bidId": "3fa85f64-5717-4562-b3fc-2c963f66af20",
"versionIndex": 2,
"bidAmount": 27800.0,
"deliveryTimeframeInDay": 5,
"warrantyOfferInMonth": 48,
"cashPaymentDiscountAvailable": true,
"cashPaymentDiscountPercent": 3.0,
"financingAvailable": true,
"financingRate": 3.49,
"additionalServices": [
"FreeDelivery",
"FreeOilChange",
"MaintenancePackage",
"FullTankOfGas"
],
"vehicleConditionNotes": "Excellent condition, single owner, full service history",
"notes": "Updated offer with better terms and faster delivery",
"action": 2,
"updatedBy": "3fa85f64-5717-4562-b3fc-2c963f66af30",
"updatedAt": "2024-09-16T10:15:00Z"
}
],
"currentBidDetails": {
"bidId": "3fa85f64-5717-4562-b3fc-2c963f66af20",
"auctionId": "3fa85f64-5717-4562-b3fc-2c963f66afa9",
"dealerId": "3fa85f64-5717-4562-b3fc-2c963f66af30",
"inventoryId": "3fa85f64-5717-4562-b3fc-2c963f66af10",
"vehicleSpecificationId": "3fa85f64-5717-4562-b3fc-2c963f66af11",
"bidAmount": 27800.0,
"deliveryTimeframeInDay": 5,
"warrantyOfferInMonth": 48,
"cashPaymentDiscountAvailable": true,
"cashPaymentDiscountPercent": 3.0,
"financingAvailable": true,
"financingRate": 3.49,
"additionalServices": [
"FreeDelivery",
"FreeOilChange",
"MaintenancePackage",
"FullTankOfGas"
],
"vehicleConditionNotes": "Excellent condition, single owner, full service history",
"notes": "Updated offer with better terms and faster delivery",
"status": 1,
"createdAt": "2024-09-15T14:30:00Z",
"dealerCode": "DLR-001",
"dealerName": "Premium Auto Sales",
"dealerLogo": "https://example.com/logos/dealer001.jpg",
"vehicleDetails": {
"vin": "1HGBH41JXMN109186",
"year": 2022,
"vehicleType": 1,
"make": "Toyota",
"model": "Camry",
"trim": "XLE",
"bodyStyle": "Sedan",
"colorExterior": "Silver",
"colorInterior": "Black",
"mileage": 15000,
"mileageUnit": "miles",
"engine": "2.5L 4-Cylinder",
"transmission": "Automatic",
"fuelType": "Gasoline",
"drivetrain": "FWD",
"doors": 4,
"thumbnailImage": "https://example.com/images/camry-thumb.jpg",
"keyFeatures": [
"Apple CarPlay",
"Backup Camera",
"Bluetooth",
"Cruise Control"
]
},
"updatedAt": "2024-09-16T10:15:00Z",
"customerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}

10. Accept or Reject Bid

Endpoint: PUT /api/auction/{auctionId}/bid/{bidId}/accept-or-reject

Request Body:

{
"status": 3
}

Note: Status values - 1: Active, 2: Withdrawn, 3: Accepted, 4: Rejected

Response Body:

{
"status": 0,
"message": "Bid accepted successfully."
}

11. Withdraw Bid

Endpoint: PUT /api/auction/{auctionId}/bid/{bidId}/withdraw

Request Body: None

Response Body:

{
"status": 0,
"message": "Bid withdrawn successfully"
}

12. List Bids for Auction

Endpoint: GET /api/auction/{auctionId}/bid-list?pageNumber=1&rowsPerPage=10&sortBy=1

Query Parameters: All filters from BidFilter model

Response Body:

{
"data": [
{
"bidId": "3fa85f64-5717-4562-b3fc-2c963f66af20",
"auctionId": "3fa85f64-5717-4562-b3fc-2c963f66afa9",
"dealerId": "3fa85f64-5717-4562-b3fc-2c963f66af30",
"inventoryId": "3fa85f64-5717-4562-b3fc-2c963f66af10",
"vehicleSpecificationId": null,
"bidAmount": 27800.0,
"deliveryTimeframeInDay": 5,
"warrantyOfferInMonth": 48,
"cashPaymentDiscountAvailable": true,
"cashPaymentDiscountPercent": 3.0,
"financingAvailable": true,
"financingRate": 3.49,
"additionalServices": [
"FreeDelivery",
"FreeOilChange",
"MaintenancePackage",
"FullTankOfGas"
],
"vehicleConditionNotes": "Excellent condition, single owner, full service history",
"notes": "Updated offer with better terms and faster delivery",
"status": 1,
"createdAt": "2024-09-15T14:30:00Z",
"dealerCode": "DLR-001",
"dealerName": "Premium Auto Sales",
"dealerLogo": "https://example.com/logos/dealer001.jpg",
"vehicleDetails": {
"vin": "1HGBH41JXMN109186",
"year": 2022,
"vehicleType": 1,
"make": "Toyota",
"model": "Camry",
"trim": "XLE",
"bodyStyle": "Sedan",
"colorExterior": "Silver",
"colorInterior": "Black",
"mileage": 15000,
"mileageUnit": "miles",
"engine": "2.5L 4-Cylinder",
"transmission": "Automatic",
"fuelType": "Gasoline",
"drivetrain": "FWD",
"doors": 4,
"thumbnailImage": "https://example.com/images/camry-thumb.jpg",
"keyFeatures": [
"Apple CarPlay",
"Backup Camera",
"Bluetooth",
"Cruise Control"
]
},
"updatedAt": "2024-09-16T10:15:00Z",
"customerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
{
"bidId": "3fa85f64-5717-4562-b3fc-2c963f66af20",
"auctionId": "3fa85f64-5717-4562-b3fc-2c963f66afa9",
"dealerId": "3fa85f64-5717-4562-b3fc-2c963f66af30",
"inventoryId": null,
"vehicleSpecificationId": "3fa85f64-5717-4562-b3fc-2c963f66af10",
"bidAmount": 27800.0,
"deliveryTimeframeInDay": 5,
"warrantyOfferInMonth": 48,
"cashPaymentDiscountAvailable": true,
"cashPaymentDiscountPercent": 3.0,
"financingAvailable": true,
"financingRate": 3.49,
"additionalServices": [
"FreeDelivery",
"FreeOilChange",
"MaintenancePackage",
"FullTankOfGas"
],
"vehicleConditionNotes": "Excellent condition, single owner, full service history",
"notes": "Updated offer with better terms and faster delivery",
"status": 1,
"createdAt": "2024-09-15T14:30:00Z",
"dealerCode": "DLR-001",
"dealerName": "Premium Auto Sales",
"dealerLogo": "https://example.com/logos/dealer001.jpg",
"vehicleDetails": {
"vin": null,
"year": 2022,
"vehicleType": 1,
"make": "Toyota",
"model": "Camry",
"trim": "XLE",
"bodyStyle": "Sedan",
"colorExterior": null,
"colorInterior": null,
"mileage": null,
"mileageUnit": null,
"engine": "2.5L 4-Cylinder",
"transmission": "Automatic",
"fuelType": "Gasoline",
"drivetrain": "FWD",
"doors": 4,
"thumbnailImage": "https://example.com/images/camry-thumb.jpg",
"keyFeatures": [
"Apple CarPlay",
"Backup Camera",
"Bluetooth",
"Cruise Control"
]
},
"updatedAt": "2024-09-16T10:15:00Z",
"customerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
],
"totalNumber": 2,
"hasPreviousPage": false,
"hasNextPage": false,
"totalPages": 1,
"pageNumber": 1,
"rowsPerPage": 10
}

13. List Deals

Endpoint: GET /api/auction/deals?pageNumber=1&rowsPerPage=10&dealerId=3fa85f64-5717-4562-b3fc-2c963f66af30

Query Parameters: All filters from DealFilter model

Response Body:

{
"data": [
{
"auctionInfo": {
"auctionId": "3fa85f64-5717-4562-b3fc-2c963f66afa9",
"auctionCode": "AUC-2024-001234",
"auctionTitle": "BMW 3 Series and Ford F-150 Auction",
"customerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"vehicleType": 3,
"auctionRequirements": [
{
"requirementId": "3fa85f64-5717-4562-b3fc-2c963f66afa7",
"make": "BMW",
"model": "3 Series",
"bodyStyle": "Sedan",
"year": 2023,
"trim": "330i",
"thumbnailImage": "https://example.com/images/bmw-3series.jpg",
"vehicleType": 3
},
{
"requirementId": "3fa85f64-5717-4562-b3fc-2c963f66afa8",
"make": "Ford",
"model": "F-150",
"bodyStyle": "Truck",
"year": 2024,
"trim": "Lightning",
"thumbnailImage": "https://example.com/images/ford-f150.jpg",
"vehicleType": 3
}
],
"priceRangeMin": 25000.0,
"priceRangeMax": 35000.0,
"budget": 2,
"zipCode": "90210",
"timeframeInDays": 7,
"additionalNote": "Looking for reliable vehicles",
"status": 2,
"createdAt": "2024-09-15T10:30:00Z",
"completedAt": "2024-09-16T15:30:00Z",
"canceledAt": null,
"currentBestOffer": 27800.0,
"savings": 2200.0,
"totalBids": 5,
"dealerName": "Premium Auto Sales",
"dealerCode": "DLR-001",
"dealerLogoUrl": "https://example.com/logos/dealer001.jpg",
"isBidPlaced": true,
"finalPrice": 27800.0,
"expireAt": "2024-09-22T10:30:00Z"
},
"bidInfo": {
"bidId": "3fa85f64-5717-4562-b3fc-2c963f66af20",
"auctionId": "3fa85f64-5717-4562-b3fc-2c963f66afa9",
"dealerId": "3fa85f64-5717-4562-b3fc-2c963f66af30",
"inventoryId": null,
"vehicleSpecificationId": "3fa85f64-5717-4562-b3fc-2c963f66af11",
"bidAmount": 27800.0,
"deliveryTimeframeInDay": 5,
"warrantyOfferInMonth": 48,
"cashPaymentDiscountAvailable": true,
"cashPaymentDiscountPercent": 3.0,
"financingAvailable": true,
"financingRate": 3.49,
"additionalServices": [
"FreeDelivery",
"FreeOilChange",
"MaintenancePackage"
],
"vehicleConditionNotes": "Excellent condition, single owner",
"notes": "Best offer with extended warranty",
"status": 3,
"createdAt": "2024-09-15T14:30:00Z",
"dealerCode": "DLR-001",
"dealerName": "Premium Auto Sales",
"dealerLogo": "https://example.com/logos/dealer001.jpg",
"vehicleDetails": {
"vin": null,
"year": 2023,
"vehicleType": 1,
"make": "BMW",
"model": "3 Series",
"trim": "330i xDrive",
"bodyStyle": "Sedan",
"colorExterior": "Silver",
"colorInterior": "Black",
"mileage": 15000,
"mileageUnit": "miles",
"engine": "2.0L Turbo",
"transmission": "Automatic",
"fuelType": "Gasoline",
"drivetrain": "AWD",
"doors": 4,
"thumbnailImage": "https://example.com/images/bmw-3series.jpg",
"keyFeatures": [
"Apple CarPlay",
"Backup Camera",
"Bluetooth",
"Cruise Control"
]
},
"updatedAt": "2024-09-16T10:15:00Z"
},
"customerInfo": {
"customerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phone": "+1-555-123-4567",
"address": null
}
}
],
"totalNumber": 12,
"hasPreviousPage": false,
"hasNextPage": true,
"totalPages": 2,
"pageNumber": 1,
"rowsPerPage": 10
}

14. Add Item to Wishlist

Endpoint: POST /api/auction/wishlist/add-item

Request Body:

{
"inventoryId": "3fa85f64-5717-4562-b3fc-2c963f66af10"
}

Response Body:

{
"status": 0,
"message": "Item added to wishlist successfully"
}

15. Remove Item from Wishlist

Endpoint: DELETE /api/auction/wishlist/remove-item

Request Body:

{
"inventoryId": "3fa85f64-5717-4562-b3fc-2c963f66af10",
"isClearAll": false
}

Note: If isClearAll is true, all items will be removed and inventoryId is ignored.

Response Body:

{
"status": 0,
"message": "Item removed from wishlist successfully"
}

16. Get Wishlist

Endpoint: GET /api/auction/wishlist

Response Body:

{
"customerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"wishListId": "3fa85f64-5717-4562-b3fc-2c963f66af60",
"wishlistItems": [
{
"inventoryId": "3fa85f64-5717-4562-b3fc-2c963f66af10",
"dealerId": "3fa85f64-5717-4562-b3fc-2c963f66af30",
"vin": "1HGBH41JXMN109186",
"stockNumber": "STK-12345",
"year": 2022,
"vehicleType": 1,
"purchaseDate": "2024-01-15T00:00:00Z",
"make": "Toyota",
"model": "Camry",
"trim": "XLE",
"bodyStyle": "Sedan",
"colorExterior": "Silver",
"colorInterior": "Black",
"mileage": 15000,
"mileageUnit": "miles",
"engine": "2.5L 4-Cylinder",
"transmission": "Automatic",
"fuelType": "Gasoline",
"drivetrain": "FWD",
"doors": 4,
"actualPrice": 30000.0,
"discountedPrice": 28500.0,
"currency": 1,
"taxIncluded": false,
"vehicleCondition": 1,
"isCertifiedPreOwned": true,
"registrationDate": "2022-03-01T00:00:00Z",
"warrantyExpiryDate": "2025-03-01T00:00:00Z",
"status": 1,
"addressId": "3fa85f64-5717-4562-b3fc-2c963f66af50",
"images": [
"https://example.com/images/camry1.jpg",
"https://example.com/images/camry2.jpg"
],
"thumbnailImage": "https://example.com/images/camry-thumb.jpg",
"keyFeatures": [
"Apple CarPlay",
"Backup Camera",
"Bluetooth",
"Cruise Control"
],
"additionalNote": "Well maintained vehicle",
"createdBy": "3fa85f64-5717-4562-b3fc-2c963f66af30",
"createdAt": "2024-01-15T10:00:00Z",
"updatedBy": null,
"updatedAt": null,
"isDeleted": false
}
]
}

17. List Auctions (Admin Data)

Endpoint: GET /api/auction/admin-data?pageNumber=1&rowsPerPage=10&status=1

Query Parameters: All filters from AuctionFilter model

Response Body:

{
"data": [
{
"auctionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"auctionCode": "string",
"customer": {
"firstname": "string",
"lastname": "string",
"email": "string",
"phone": "string",
"dateofbirth": "2025-11-10",
"gender": "string",
"profileimageurl": "string",
"address": "string"
},
"vehicleType": 1,
"auctionRequirements": [
{
"requirementId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"make": "string",
"model": "string",
"bodyStyle": "string",
"year": 0,
"trim": "string",
"vehicleType": 1,
"thumbnailImage": "string"
}
],
"priceRangeMin": 0,
"priceRangeMax": 0,
"budget": 1,
"zipCode": "string",
"timeframeInDays": 0,
"additionalNote": "string",
"status": 1,
"createdAt": "2025-11-10T11:36:56.782Z",
"completedAt": "2025-11-10T11:36:56.782Z",
"canceledAt": "2025-11-10T11:36:56.782Z",
"currentBestOffer": 0,
"savings": 0,
"totalBids": 0,
"dealerName": "string",
"dealerCode": "string",
"dealerLogoUrl": "string",
"isBidPlaced": true,
"finalPrice": 0,
"auctionTitle": "string",
"expireAt": "2025-11-10T11:36:56.782Z"
}
],
"totalNumber": 15,
"hasPreviousPage": false,
"hasNextPage": true,
"totalPages": 2,
"pageNumber": 1,
"rowsPerPage": 10
}

Important Notes for Frontend Developers

  1. Enum Values: All enums are represented as integers in JSON:

    • VehicleType: 1 = New, 2 = PreOwned, 3 = Both
    • Budget: 1 = BudgetFriendly, 2 = Midrange, 3 = Premium, 4 = Luxury
    • AuctionStatus: 1 = Active, 2 = Completed, 3 = Canceled, 4 = Expired
    • BidStatus: 1 = Active, 2 = Withdrawn, 3 = Accepted, 4 = Rejected, 5 = Expired
    • BidAction: 1 = Place, 2 = Update, 3 = Withdraw
  2. Nullable Fields: Fields marked with ? in C# models can be null in JSON. Always handle null checks.

  3. GUID Format: All IDs use standard GUID format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

  4. Date Format: All dates are in ISO 8601 format: YYYY-MM-DDTHH:mm:ssZ

  5. Decimal Precision: Price and percentage values use 2 decimal places (e.g., 27800.00, 3.49)

  6. Array Fields: Empty arrays are represented as [], not null

  7. Pagination Structure: All list endpoints return data wrapped in ServerPaginatedData<T> with the following structure:

    {
    "data": [],
    "totalNumber": 0,
    "hasPreviousPage": false,
    "hasNextPage": false,
    "totalPages": 0,
    "pageNumber": 1,
    "rowsPerPage": 10
    }

Data Relationships

  • auctionmaster (1) ← (M) auctionbid: One auction can have multiple bids
  • auctionmaster (M) → (1) inventorymaster: Auction may reference specific inventory
  • bid (M) → (1) inventorymaster: Each bid references specific inventory
  • auctionmaster (M) → (1) customerprofile: Each auction belongs to one customer
  • bid (M) → (1) dealerprofile: Each bid belongs to one dealer

Business Logic

Auction Lifecycle

  1. Creation: Customer creates auction with preferences
  2. Active: Auction is open for dealer bidding
  3. Bidding: Dealers place bids with specific inventory
  4. Selection: Customer selects winning bid
  5. Completion: Customer identity revealed to winning dealer
  6. Ended/Cancelled: Auction lifecycle completion

Bidding Rules

  • Each dealer can bid multiple times with different inventory
  • Bid amounts must be within auction price range
  • Dealers can withdraw or modify their bids
  • Customer can counter-offer on any bid

Privacy Rules

  • Customer identity hidden until deal acceptance
  • Only winning dealer receives customer contact information
  • Auction details (except customer identity) are publicly visible
  • Bid history visible to auction owner and bidding dealers

Third-Party Integrations

  • Notification Service: Real-time notifications for bid updates and auction status changes
  • Location Services: Geocoding and location-based filtering
  • Image Storage: Cloud storage for vehicle images and attachments
  • Email Service: Automated email notifications for auction milestones

Workflow

Customer Auction Creation Workflow

  1. Customer logs into the platform
  2. Navigates to "Create Auction" page
  3. Selects auction type (from inventory or custom requirements)
  4. If from inventory:
  • Searches and selects vehicle from dealer inventory
  • Pre-fills auction form with vehicle details
  • Adds budget, location, timeframe, and notes
  1. If custom requirements:
  • Specifies make, model, category, condition
  • Sets price range and key features
  • Adds budget, location, timeframe, and notes
  1. System generates unique auction code
  2. Auto-populate auction latitude/longitude:
    • Query zipcodedetails table using auction's zip code
    • Retrieve and store latitude and longitude in auctionmaster table
    • If zip code not found, latitude/longitude will be null
  3. Auction becomes active and visible to dealers
  4. System calculates auction end time based on timeframe
  5. System sends notifications to dealers within configured radius (Flow 3):
    • Query dealeraddresses table for all primary addresses where isprimary = true
    • For each dealer, fetch latitude, longitude, and radius
    • If radius not set in dealeraddresses, fallback to dealermaster.radius
    • Example SQL:
      SELECT da.dealerid, da.latitude, da.longitude,
      COALESCE(da.radius, dm.radius) as radius
      FROM dealeraddresses da
      LEFT JOIN dealermaster dm ON da.dealerid = dm.dealerid
      WHERE da.isprimary = true
    • Calculate distance between dealer's primary address and auction location using Haversine formula
    • If distance ≤ dealer's configured radius: Add dealer to eligible notification list
    • Send notifications only to eligible dealers within radius

Dealer Bidding Workflow

  1. Dealer browses active auctions via GetPublicPaginatedAuctionList API
  2. System filters auctions based on geo-radius (Flow 4):
    • Step 1: Fetch dealer's primary address from dealeraddresses where isprimary = true
    • Step 2: Retrieve dealer's latitude, longitude, and radius from primary address
      • If radius not set in address, fallback to dealermaster.radius
      • Default radius: 100 KM
    • Step 3 (Optional): If filter parameters include custom location and radius, use those instead
    • Step 4: Fetch all active auctions and calculate distance using Haversine formula
      • For each auction: Calculate distance between dealer's location and auction's lat/lng
      • If distance ≤ configured radius: Include auction in result set
    • Step 5: Apply pagination and return filtered auctions
    • Note: Use efficient SQL query with Haversine formula for performance
  3. Dealer applies additional filters (make, model, price range, etc.)
  4. Views auction details (excluding customer identity)
  5. Selects relevant inventory to offer
  6. Places bid with offered vehicle and price
  7. System records bid and notifies customer
  8. Dealer can monitor bid status and make counter-offers

Important: Dealers only see auctions within their configured service radius, ensuring all visible auctions are geographically relevant.

Deal Completion Workflow

  1. Customer accepts dealer's bid (dealer already viewed auction through radius-filtered list)
  2. System marks bid as "accepted"
  3. Customer identity and contact information revealed to winning dealer
  4. Other bids automatically marked as "rejected"
  5. Auction status changed to "ended"
  6. Both parties receive confirmation notifications
  7. Deal management process begins (outside this feature scope)

Note: Dealers only see auctions within their configured service radius through the filtered auction list, ensuring geographic relevance for all bids.


Testing & Quality Assurance

Unit Tests

  • Auction Service Tests (Existing):

    • Auction creation validation (inventory vs custom)
    • Auction status transitions (active → ended → cancelled)
    • Price range and budget validation
    • Auction expiration logic
  • Enhanced Bidding Service Tests (New):

    • Bid update validation and authorization
    • Bid history creation and retrieval
    • Version index management
    • Bid status transitions with history tracking

Integration Tests

  • End-to-End Enhanced Auction Flow:

    • Complete auction creation to deal completion workflow
    • Multiple dealer bidding with updates and history
    • Customer acceptance with full audit trail
    • Email notification delivery verification
  • API Integration Tests:

    • Bid CRUD operations with history tracking
    • Search and filtering with bid history
    • Real-time notification delivery
    • Performance testing for history queries

Acceptance Criteria

  1. Enhanced Bid Management:

    • Dealers can successfully update their bids multiple times
    • Complete history is maintained for all bid changes
    • Customers receive email notifications for bid updates
    • Only bid owners can update their own bids
  2. Performance Requirements:

    • Bid update operations complete within 3 seconds
    • Bid history queries return within 2 seconds
    • Email notifications sent within 30 seconds
    • System supports 100+ concurrent bid updates
  3. Data Integrity:

    • All bid changes are properly versioned
    • History records are immutable once created
    • Audit trail is complete and accurate
    • No data loss during bid updates

Deployment Considerations

Database Migration

  • New Table Creation: Execute bidhistory table creation script
  • Data Migration: Migrate existing bid data to create initial history entries
  • Index Creation: Add performance indexes for history queries
  • Constraint Validation: Ensure all constraints are properly enforced

Configuration Changes

  • Environment Variables:
    • Email service configuration for bid notifications
    • Bid update rate limiting settings
    • History retention policies
  • Feature Flags: Enable/disable bid update functionality
  • API Rate Limiting: Configure bid update rate limits per dealer

Monitoring & Alerts

  • Application Performance: Bid update API response times
  • Business Metrics: Bid update frequency, customer engagement rates
  • Database Performance: History table query performance
  • Email Delivery: Notification delivery success rates

Security Considerations

Authorization

  • Bid Updates: Only bid owner or admin can update bids
  • History Access: Restricted to bid owner, auction owner, and admin
  • Rate Limiting: Prevent abuse of bid update functionality
  • Audit Logging: Log all bid modification attempts

Data Protection

  • History Immutability: History records cannot be modified once created
  • Sensitive Data: Ensure customer data privacy in notifications
  • Data Encryption: Encrypt sensitive bid information
  • Backup Strategy: Regular backups of bid history data

Risks & Mitigations

RiskImpactLikelihoodMitigation Strategy
High concurrent bid updatesHighMediumImplement database locking and update validation queue
Bid history data growthMediumHighImplement data archiving and retention policies
Email notification failuresMediumMediumFallback mechanisms and retry logic for email delivery
Performance degradation with historyHighMediumProper indexing and query optimization
Fraudulent bid updatesHighLowRate limiting and bid update monitoring
Data consistency issuesHighLowDatabase transactions and validation rules

Review & Approval

  • Reviewers: Abhishak Kumar Roy

  • Approval Date: 2025-08-19


Notes

  • This document covers Phase 1 implementation only
  • Future phases may include advanced features like AI-powered recommendations, advanced analytics, and mobile app integration
  • Regular review meetings scheduled bi-weekly during development
  • All API endpoints will include comprehensive documentation using OpenAPI/Swagger
  • Consider implementing audit logging for all auction and bid activities for compliance and analytics