public enum Status {
PROCESSED(1, "PROCESSED"),
CANCELLED(2, "CANCELLED"),
PENDING(3,"PENDING"),
REJECTED(4, "REJECTED"),
SHIPPED(5, "SHIPPED");
private final Byte id;
private final String label;
private Status(Integer id, String label) {
this.id = id.byteValue();
this.label = label;
}
public Byte getId() {
return id;
}
public String getLabel() {
return label;
}
}
Hi Cristian, in the code above, I have added an additional status:
CANCELLED(2, "CANCELLED"),. When the users cancel their order, the
status should be cancelled. Do you need to update the database schema?