Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package onlineShoppingSystem;
- import java.util.Date;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- public class OnlineShoppingSystem {
- public enum AccountStatus {
- ACTIVE, BLOCKED, BANNED, COMPROMISED, UNKNOWN;
- }
- public enum OrderStatus {
- UNSHIPPED, PENDING, SHIPPED, COMPLETED, CANCELED, REFUND_APPLIED
- }
- public enum ShipmentStatus {
- PENDING, SHIPPED, DELIVERED, ON_HOLD,
- }
- public class Account {
- String name;
- String uName;
- String password;
- String email;
- String mobile;
- AccountStatus status;
- }
- public class OrderLog {
- String orderid;
- OrderStatus ostatus;
- Date createdTime;
- }
- public class Order {
- String orderNumner;
- Date createdTime;
- List<OrderLog> logs;
- OrderStatus staus;
- // public boolean sendForShipment();
- // public boolean makePayment(Payment payment);
- // public boolean addOrderLog(OrderLog orderLog);
- }
- public class ProductCategory {
- String name;
- String description;
- }
- public class Product {
- ProductCategory category;
- String productId;
- String name;
- String description;
- double price;
- int availableCount;
- Account supplier;
- public int getAvailableCount() {
- return availableCount;
- }
- public boolean updatePrice(double newPrice) {
- return true;
- }
- }
- public class ProductReview {
- String review;
- double ratign;
- // Member reviewer;
- }
- public class Shipment {
- private String shipmentNumber;
- private Date shipmentDate;
- private Date estimatedArrival;
- private String shipmentMethod;
- // public boolean addShipmentLog(ShipmentLog shipmentLog);
- }
- public class ShipmentLogs {
- String shipmentNumber;
- ShipmentStatus status;
- Date createdTime;
- }
- public abstract class Customer {
- ShoopingCart cart;
- Order order;
- // public ShoppingCart getShoppingCart();
- // public bool addItemToCart(Item item);
- // public bool removeItemFromCart(Item item);
- }
- public class Guest extends Customer {
- // public registerAccounr();
- }
- public class Member extends Customer {
- Account account;
- // public OrderStatus placeOrder(Order order);
- }
- public class CartItem {
- int productId;
- int quanitiy;
- double price;
- }
- public class ShoopingCart {
- List<CartItem> itemList;
- // public boolean addItem(CartItem item){};
- // public boolean removeItem(CartItem item);
- // public boolean updateItemQuantity(CartItem item, int quantity);
- // public List<CartItem> getItems();
- // public boolean checkout();
- }
- public interface Search {
- public List<Product> searchProductsByName(String name);
- public List<Product> searchProductsByCategory(String category);
- }
- public class Catalogue implements Search {
- Map<String, List<Product>> productNames;
- HashMap<String, List<Product>> productCategories;
- @Override
- public List<Product> searchProductsByName(String name) {
- return productNames.get(name);
- }
- @Override
- public List<Product> searchProductsByCategory(String category) {
- return productCategories.get(category);
- }
- }
- }
Add Comment
Please, Sign In to add comment