classDiagram
direction TB
class Product {
-int productId
-String name
-double price
-int inventory
+getProductId() int
+getName() String
+getPrice() double
+getInventory() int
+toString() String
}
class Customer {
-int customerId
-String name
-String email
-double walletBalance
+getCustomerId() int
+getName() String
+getEmail() String
+getWalletBalance() double
}
class CartItem {
-int cartId
-int customerId
-int productId
-String productName
-double price
-int quantity
+getSubtotal() double
+toString() String
}
class Bill {
-int billId
-int customerId
-double totalAmount
-Timestamp billDate
-List~BillItem~ billItems
+addBillItem(BillItem) void
+getBillItems() List~BillItem~
}
class BillItem {
-int billItemId
-int billId
-int productId
-String productName
-double price
-int quantity
-double subtotal
+toString() String
}
class ProductDAO {
+getAllProducts() List~Product~
+getProductById(int) Product
+reduceInventory(Connection, int, int) boolean
+restoreInventory(Connection, int, int) boolean
}
class CartDAO {
+getCartItems(int) List~CartItem~
+getExistingQuantity(Connection, int, int) int
+addOrUpdateCartItem(Connection, int, int, int) boolean
+clearCart(Connection, int) boolean
}
class CustomerDAO {
+getCustomerById(int) Customer
+deductWallet(Connection, int, double) boolean
}
class BillDAO {
+createBill(Connection, int, List~CartItem~, double) Bill
+getPastOrders(int) List~Bill~
}
class DBConnection {
-String URL$
-String USER$
-String PASSWORD$
+getConnection()$ Connection
+closeConnection(Connection)$ void
}
class ShoppingCartApp {
-int CUSTOMER_ID$
-ProductDAO productDAO$
-CartDAO cartDAO$
-CustomerDAO customerDAO$
-BillDAO billDAO$
+main(String[]) void$
-addProductToCart() void$
-checkout() void$
-viewCart() void$
-viewProducts() void$
-printBill(Bill, Customer) void$
-viewPastOrders() void$
}
Bill "1" *-- "many" BillItem : contains (composition)
Customer "1" -- "many" CartItem : has
Customer "1" -- "many" Bill : generates
Product "1" -- "many" CartItem : referenced by
Product "1" -- "many" BillItem : referenced by
ProductDAO --> Product : manages
CartDAO --> CartItem : manages
CustomerDAO --> Customer : manages
BillDAO --> Bill : manages
BillDAO --> BillItem : creates
ShoppingCartApp --> ProductDAO : uses
ShoppingCartApp --> CartDAO : uses
ShoppingCartApp --> CustomerDAO : uses
ShoppingCartApp --> BillDAO : uses
ShoppingCartApp --> DBConnection : uses
ProductDAO --> DBConnection : uses
CartDAO --> DBConnection : uses
CustomerDAO --> DBConnection : uses
DayalGupta03/Auction_system
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|