You need to make sure the locker size > package.
Not so happy path == If the chosen locker service is full then notify the user about the earliest delivery date/time based on slot availability. Allow user to change the delivery type or accept the new ETA.
public class User {
private String name;
private Address address;
private String email;
private String phone;
}
public class Account {
private String accountId;
private String password;
private AccountStatus status; //Prime, Not a prime,
private User user;
public boolean resetPassword() { ... };
public boolean packageRetrieved(PackageId packageId) {...};
public boolean packageRefunded(PackageId packageId, Date date){ ... };
public Locker searchForLockerNearYou(String address, Date date){ ... };
public DeliveryStatus getNotifications(){...};
public boolean updateDeliveryMode(Delivery delivery) {...};
public boolean updateDeliveryDateForParticularPackage(Delivery delivery, Date date) {...};
}
public class Package {
String packageId;
int height;
int weight;
int width;
int breadth;
public LockerSize findLockerSizeForPackage(String packageId, int height, int width, int breadth){...}
}
public class Order {
String OrderId;
Date orderCreationDate;
List<Packages> listOfPackages;
public void updateOrder(){...};
public void cancelOrder(){...};
}
public class Locker {
private LockerId lockerId;
private LockerSize lockerSize;
private String address;
private int totalCapacity;
}
public class LockerSlot {
private List<LockerSlot> listOfSlots;
private String lockerSlotId;
private LockerId lockerId;
private Date lastOccupied;
private LockerStatus lockerStatus;
public boolean isOccupied() {...};
//total available locker slots for a particular date
public List<LockerSlot> getTotalAvailableLockerSlot(LockerId lockerId, Date date) { ... }
}
public class Delivery {
private DeliveryStatus deliveryStatus;
private DeliveryMode deliveryMode;
private Date expectedDeliveryDate;
private DeliveryVehicle deliveryVehicle
// ability to send OTP
public void sendOTP() {...}
}
public class Notification {
String notificationId;
NotificationMode notificationMode;
NotificationStatus notificationStatus;
}
public class Payment {
String paymentId;
PaymentMode paymentMode;
PaymentStatus paymentStatus;
boolean makeTransaction() {...}
}
we will use enum class for all the Status like PaymentStatus
, NotificationStatus
, DeliveryStatus
, LockerStatus
etc.