complete model classes
This commit is contained in:
@@ -1,15 +1,26 @@
|
||||
package dev.model;
|
||||
|
||||
public class MenuItem {
|
||||
|
||||
private int id;
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
|
||||
private String description;
|
||||
|
||||
private double price;
|
||||
|
||||
private String category;
|
||||
|
||||
public MenuItem() {}
|
||||
|
||||
public int getId(){ return id; }
|
||||
public void setId(int id){ this.id = id; }
|
||||
|
||||
public String getName(){ return name; }
|
||||
public void setName(String n){ this.name = n; }
|
||||
|
||||
public String getDescription(){ return description; }
|
||||
public void setDescription(String d){ this.description = d; }
|
||||
|
||||
public double getPrice(){ return price; }
|
||||
public void setPrice(double p){ this.price = p; }
|
||||
|
||||
public String getCategory(){ return category; }
|
||||
public void setCategory(String c){ this.category = c; }
|
||||
}
|
||||
@@ -3,13 +3,28 @@ package dev.model;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class Order {
|
||||
|
||||
private int id;
|
||||
|
||||
private int userId;
|
||||
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
private double totalPrice;
|
||||
|
||||
public Order() {}
|
||||
|
||||
public Order(int userId, double totalPrice) {
|
||||
this.userId = userId;
|
||||
this.totalPrice = totalPrice;
|
||||
this.createdAt = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public int getId(){ return id; }
|
||||
public void setId(int id){ this.id = id; }
|
||||
|
||||
public int getUserId() { return userId; }
|
||||
public void setUserId(int uid){ this.userId = uid; }
|
||||
|
||||
public LocalDateTime getCreatedAt(){ return createdAt; }
|
||||
public void setCreatedAt(LocalDateTime t){ this.createdAt = t; }
|
||||
|
||||
public double getTotalPrice(){ return totalPrice; }
|
||||
public void setTotalPrice(double p){ this.totalPrice = p; }
|
||||
}
|
||||
@@ -1,15 +1,33 @@
|
||||
package dev.model;
|
||||
|
||||
public class OrderDetail {
|
||||
|
||||
private int id;
|
||||
|
||||
private int orderId;
|
||||
|
||||
private int menuItemId;
|
||||
|
||||
private int quantity;
|
||||
private double price; // unit price at purchase time
|
||||
|
||||
private double price;
|
||||
public OrderDetail() {}
|
||||
|
||||
public OrderDetail(int orderId, int menuItemId, int quantity, double price) {
|
||||
this.orderId = orderId;
|
||||
this.menuItemId = menuItemId;
|
||||
this.quantity = quantity;
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public int getId(){ return id; }
|
||||
public void setId(int id){ this.id = id; }
|
||||
|
||||
public int getOrderId(){ return orderId; }
|
||||
public void setOrderId(int o){ this.orderId = o; }
|
||||
|
||||
public int getMenuItemId(){ return menuItemId; }
|
||||
public void setMenuItemId(int m){ this.menuItemId = m; }
|
||||
|
||||
public int getQuantity(){ return quantity; }
|
||||
public void setQuantity(int q){ this.quantity = q; }
|
||||
|
||||
public double getPrice(){ return price; }
|
||||
public void setPrice(double p){ this.price = p; }
|
||||
}
|
||||
Reference in New Issue
Block a user