package it.gcatania.auctionservice.services;

import java.util.List;

import it.gcatania.auctionservice.dataobjects.Bid;
import it.gcatania.auctionservice.dataobjects.Item;
import it.gcatania.auctionservice.dataobjects.User;

public interface AuctionService {

  /**
   * registers the placement of the input bid
   *
   * @param bid the bid to be registered
   * @throws IllegalArgumentException if the input bid is null or with missing values for mandatory
   *         fields
   */
  void recordBid(Bid bid) throws IllegalArgumentException;

  /**
   * retrieves the current winning bid for an input item.
   *
   * @param item the item
   * @return the current winning bid, i.e. the bid with the higher amount. May be null if no bid was
   *         ever placed on the input item. <strong>Note:</strong> if two different users place bids
   *         on the same item with the same amount, the bid that was placed first will be considered
   *         as the winning bid
   * @throws IllegalArgumentException if the input item is null or with missing values
   */
  Bid getCurrentWinningBid(Item item) throws IllegalArgumentException;

  /**
   * retrieves all the bids recorded for an input item
   *
   * @param item the item
   * @return a list with all the bids recorded for the input item. The list may be empty, but never
   *         null
   * @throws IllegalArgumentException if the input item is null or with missing values
   */
  List<Bid> getAllBids(Item item) throws IllegalArgumentException;

  /**
   * retreves all the items for which the input user submitted at least one bid
   *
   * @param user the user
   * @return a list with all the items for which the user submitted any bids. The list may be empty,
   *         but never null
   * @throws IllegalArgumentException if the input user is null or with missing values
   */
  List<Item> getAllBidItems(User user) throws IllegalArgumentException;

}

@@ -327,35 +327,104 @@
 ram 
-bid the bid to be registere
+user the user placing the bid%0A   * @param item the item under bid%0A   * @return bid the placed bi
 d%0A  
@@ -476,14 +476,22 @@
 put 
-bid is
+parameters are
  nul
@@ -522,18 +522,8 @@
  for
- mandatory
 %0A   
@@ -532,16 +532,26 @@
         
+mandatory 
 fields%0A 
@@ -561,30 +561,59 @@
 /%0A  
-void recordBid(Bid bid
+Bid placeBid(User user, Item item, double bidAmount
 ) th
@@ -1180,15 +1180,8 @@
  get
-Current
 Winn
@@ -1550,19 +1550,16 @@
 Bid%3E get
-All
 Bids(Ite
@@ -1959,11 +1959,8 @@
  get
-All
 BidI

rework api