-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAuctionItem.js
More file actions
25 lines (22 loc) · 801 Bytes
/
AuctionItem.js
File metadata and controls
25 lines (22 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Define a global array to store all auction items
let auctionItems = [];
module.exports = class bidItem {
constructor(id = "", name = "", bidderName = "", quantity = 0, finalBid = 0.0, totalCost = 0.0, bidCategory = " ", bidDate = "") {
this.id = id;
this.name = name;
this.bidderName = bidderName;
this.quantity = quantity;
this.finalBid = finalBid;
this.totalCost = totalCost;
this.bidCategory = bidCategory
this.bidDate = bidDate;
// Add the created bidItem instance to the array
auctionItems.push(this);
}
// Define a static method to retrieve all auction items
static getAllItems() {
console.log("Auction items: ")
console.log(auctionItems)
return auctionItems;
}
};