From a7e8823b2fa70693d53d9d6723bd93e35e332f41 Mon Sep 17 00:00:00 2001 From: Tan Yi Xian <> Date: Tue, 1 Nov 2022 22:06:13 +0800 Subject: [PATCH 01/10] Create ItemDate class --- .../seedu/foodrem/model/item/ItemDate.java | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/main/java/seedu/foodrem/model/item/ItemDate.java diff --git a/src/main/java/seedu/foodrem/model/item/ItemDate.java b/src/main/java/seedu/foodrem/model/item/ItemDate.java new file mode 100644 index 00000000000..9c876460d19 --- /dev/null +++ b/src/main/java/seedu/foodrem/model/item/ItemDate.java @@ -0,0 +1,73 @@ +package seedu.foodrem.model.item; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; + +/** + * Represents an item date in an {@link Item}. + * Guarantees: details are present and not null, immutable. + */ +public class ItemDate { + // Remember to change relevant messages displayed to users when changing the regex. + public static final String DATE_PATTERN_REGEX = "dd-MM-uuuu"; + public static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter + .ofPattern(DATE_PATTERN_REGEX); + + private final LocalDate date; + + protected ItemDate(LocalDate date) { + this.date = date; + } + + public LocalDate getDate() { + return date; + } + + public int compareTo(ItemDate other) { + return date.compareTo(other.date); + } + + /** + * Returns true if the given datetime object is after or on the same date. + * + * @param datetime The datetime object to compare against + */ + public boolean isAfterOrOnDate(LocalDate datetime) { + return date.isAfter(datetime.minusDays(1)); + } + + /** + * Returns true if the given ItemDate object is after the date. + * + * @param itemDate The ItemDate object to compare against + */ + public boolean isAfterDate(ItemDate itemDate) { + return date.isAfter(itemDate.date); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object other) { + return other == this + && other instanceof ItemDate + && date.equals(((ItemDate) other).date); + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + return date.hashCode(); + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return date.format(DATE_FORMATTER); + } +} From 2bae1ea901405b96a8554da6efa2c68f4570687a Mon Sep 17 00:00:00 2001 From: Tan Yi Xian <> Date: Tue, 1 Nov 2022 22:06:40 +0800 Subject: [PATCH 02/10] Modify BoughtDate and ExpiryDate to extend from ItemDate class --- .../foodrem/model/item/ItemBoughtDate.java | 45 +++------------ .../foodrem/model/item/ItemExpiryDate.java | 56 ++++--------------- 2 files changed, 19 insertions(+), 82 deletions(-) diff --git a/src/main/java/seedu/foodrem/model/item/ItemBoughtDate.java b/src/main/java/seedu/foodrem/model/item/ItemBoughtDate.java index a56ededab5b..386ffe365c5 100644 --- a/src/main/java/seedu/foodrem/model/item/ItemBoughtDate.java +++ b/src/main/java/seedu/foodrem/model/item/ItemBoughtDate.java @@ -3,39 +3,32 @@ import static java.util.Objects.requireNonNull; import java.time.LocalDate; -import java.time.format.DateTimeFormatter; import seedu.foodrem.model.item.itemvalidators.ItemBoughtDateValidator; /** - * Represents an item date in an {@link Item}. + * Represents an item bought date in an {@link Item}. * Guarantees: details are present and not null, field values are validated, immutable. */ -public class ItemBoughtDate { - // Remember to change relevant messages when changing the regex. - public static final String BOUGHT_DATE_PATTERN_REGEX = "dd-MM-uuuu"; - public static final DateTimeFormatter BOUGHT_DATE_FORMATTER = DateTimeFormatter - .ofPattern(BOUGHT_DATE_PATTERN_REGEX); +public class ItemBoughtDate extends ItemDate { private static final ItemBoughtDate NOT_SET_BOUGHT_DATE = new ItemBoughtDate(LocalDate.MIN); - private final LocalDate boughtDate; - /** * Constructs an boughtDate. * * @param date a localDate that represents the boughtDate of the - * format {@link ItemBoughtDate#BOUGHT_DATE_FORMATTER} + * format {@link ItemDate#DATE_PATTERN_REGEX} */ private ItemBoughtDate(LocalDate date) { - boughtDate = date; + super(date); } /** * Produces a boughtDate object. * * @param dateString a string that represents the boughtDate of the - * format {@link ItemBoughtDate#BOUGHT_DATE_FORMATTER} + * format {@link ItemDate#DATE_PATTERN_REGEX} */ public static ItemBoughtDate of(String dateString) { requireNonNull(dateString); @@ -43,7 +36,7 @@ public static ItemBoughtDate of(String dateString) { return NOT_SET_BOUGHT_DATE; } ItemBoughtDateValidator.validate(dateString); - return new ItemBoughtDate(LocalDate.parse(dateString, BOUGHT_DATE_FORMATTER)); + return new ItemBoughtDate(LocalDate.parse(dateString, ItemDate.DATE_FORMATTER)); } /** @@ -54,7 +47,7 @@ public boolean isNotSet() { } /** - * Returns {@code true} if both {@link ItemBoughtDate#boughtDate} have the same date by + * Returns {@code true} if both {@link ItemBoughtDate} have the same date by * {@link LocalDate#equals(Object)}. */ @Override @@ -62,27 +55,7 @@ public boolean equals(Object other) { return other == this || (other != NOT_SET_BOUGHT_DATE && other instanceof ItemBoughtDate - && boughtDate.equals(((ItemBoughtDate) other).boughtDate)); - } - - /** - * Compares two item bought dates. The method returns 0 if the bought date is equal to the other - * bought date. - * A value less than 0 is returned if the bought date is less than the other bought date (earlier) and - * a value greater than 0 if the bought date is greater than the other bought date (later). - * - * @param other The ItemBoughtDate to compare this ItemBoughtDate against. - */ - public int compareTo(ItemBoughtDate other) { - return boughtDate.compareTo(other.boughtDate); - } - - /** - * {@inheritDoc} - */ - @Override - public int hashCode() { - return boughtDate.hashCode(); + && getDate().equals(((ItemBoughtDate) other).getDate())); } /** @@ -90,6 +63,6 @@ public int hashCode() { */ @Override public String toString() { - return this == NOT_SET_BOUGHT_DATE ? "" : boughtDate.format(BOUGHT_DATE_FORMATTER); + return this == NOT_SET_BOUGHT_DATE ? "" : super.toString(); } } diff --git a/src/main/java/seedu/foodrem/model/item/ItemExpiryDate.java b/src/main/java/seedu/foodrem/model/item/ItemExpiryDate.java index 32c7d3661cb..09829479c14 100644 --- a/src/main/java/seedu/foodrem/model/item/ItemExpiryDate.java +++ b/src/main/java/seedu/foodrem/model/item/ItemExpiryDate.java @@ -3,39 +3,32 @@ import static java.util.Objects.requireNonNull; import java.time.LocalDate; -import java.time.format.DateTimeFormatter; import seedu.foodrem.model.item.itemvalidators.ItemExpiryDateValidator; /** - * Represents an item date in an {@link Item}. + * Represents an item expiry date in an {@link Item}. * Guarantees: details are present and not null, field values are validated, immutable. */ -public class ItemExpiryDate { - // Remember to change relevant messages displayed to users when changing the regex. - public static final String EXPIRY_DATE_PATTERN_REGEX = "dd-MM-uuuu"; - public static final DateTimeFormatter EXPIRY_DATE_FORMATTER = DateTimeFormatter - .ofPattern(EXPIRY_DATE_PATTERN_REGEX); +public class ItemExpiryDate extends ItemDate { private static final ItemExpiryDate NOT_SET_EXPIRY_DATE = new ItemExpiryDate(LocalDate.MIN); - private final LocalDate expiryDate; - /** * Constructs an expiryDate. * - * @param date a string that represents the expiryDate of the - * format {@link ItemExpiryDate#EXPIRY_DATE_FORMATTER} + * @param date a localDate that represents the expiryDate of the + * format {@link ItemDate#DATE_PATTERN_REGEX} */ private ItemExpiryDate(LocalDate date) { - expiryDate = date; + super(date); } /** * Produces a expiryDate object. * * @param dateString a string that represents the expiryDate of the - * format {@link ItemExpiryDate#EXPIRY_DATE_FORMATTER} + * format {@link ItemDate#DATE_PATTERN_REGEX} */ public static ItemExpiryDate of(String dateString) { requireNonNull(dateString); @@ -43,7 +36,7 @@ public static ItemExpiryDate of(String dateString) { return NOT_SET_EXPIRY_DATE; } ItemExpiryDateValidator.validate(dateString); - return new ItemExpiryDate(LocalDate.parse(dateString, EXPIRY_DATE_FORMATTER)); + return new ItemExpiryDate(LocalDate.parse(dateString, ItemDate.DATE_FORMATTER)); } /** @@ -54,16 +47,7 @@ public boolean isNotSet() { } /** - * Returns true if the given datetime object is after the expiry date. - * - * @param datetime The datetime object to compare against - */ - public boolean isAfterExpiryDate(LocalDate datetime) { - return datetime.isAfter(expiryDate); - } - - /** - * Returns {@code true} if both {@link ItemExpiryDate#expiryDate} have the same date by + * Returns {@code true} if both {@link ItemExpiryDate} have the same date by * {@link LocalDate#equals(Object)}. */ @Override @@ -71,27 +55,7 @@ public boolean equals(Object other) { return other == this || (other != NOT_SET_EXPIRY_DATE && other instanceof ItemExpiryDate - && expiryDate.equals(((ItemExpiryDate) other).expiryDate)); - } - - /** - * Compares two item expiry dates. The method returns 0 if the bought date is equal to the other - * bought date. - * A value less than 0 is returned if the bought date is less than the other bought date (earlier) and - * a value greater than 0 if the bought date is greater than the other bought date (later). - * - * @param other The ItemExpiryDate to compare this ItemExpiryDate against. - */ - public int compareTo(ItemExpiryDate other) { - return expiryDate.compareTo(other.expiryDate); - } - - /** - * {@inheritDoc} - */ - @Override - public int hashCode() { - return expiryDate.hashCode(); + && getDate().equals(((ItemExpiryDate) other).getDate())); } /** @@ -99,6 +63,6 @@ public int hashCode() { */ @Override public String toString() { - return this == NOT_SET_EXPIRY_DATE ? "" : expiryDate.format(EXPIRY_DATE_FORMATTER); + return this == NOT_SET_EXPIRY_DATE ? "" : super.toString(); } } From 064dde0acdbf9dececadc62123e369b3e228e881 Mon Sep 17 00:00:00 2001 From: Tan Yi Xian <> Date: Tue, 1 Nov 2022 22:07:25 +0800 Subject: [PATCH 03/10] Enforce check for boughtDate after expiry date --- .../java/seedu/foodrem/model/item/Item.java | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/src/main/java/seedu/foodrem/model/item/Item.java b/src/main/java/seedu/foodrem/model/item/Item.java index 33bec22721f..3b02a0530bc 100644 --- a/src/main/java/seedu/foodrem/model/item/Item.java +++ b/src/main/java/seedu/foodrem/model/item/Item.java @@ -3,6 +3,7 @@ import static java.util.Objects.requireNonNull; import static seedu.foodrem.commons.util.CollectionUtil.requireAllNonNull; +import java.time.LocalDate; import java.util.ArrayList; import java.util.HashSet; import java.util.List; @@ -50,6 +51,12 @@ public Item(ItemName name, ItemRemark remarks, Set tagSet) { requireAllNonNull(name, quantity, unit, boughtDate, expiryDate, price, remarks, tagSet); + + // Same date is accepted + if (!boughtDate.isNotSet() && !expiryDate.isNotSet() && boughtDate.isAfterDate(expiryDate)) { + throw new IllegalArgumentException("The item bought date should not be after the item expiry date."); + } + this.name = name; this.quantity = quantity; this.unit = unit; @@ -106,12 +113,29 @@ public ItemRemark getRemarks() { return remarks; } - // TODO: Possibly refactor to avoid using getter methods in ItemPrice and ItemQuantity fields + /** + * Returns true if the item has expired and false otherwise + * + * @return The total value of purchasing the specified units of the item. + */ + public boolean isExpired() { + return expiryDate.isAfterOrOnDate(LocalDate.now()); + } + + /** + * Returns true if the item quantity is not zero and false otherwise. + * + * @return The total value of purchasing the specified units of the item. + */ + public boolean hasNonZeroQuantity() { + return !quantity.isZero(); + } /** - * @return The total cost of purchasing the specified units of the item. + * @return The total value of purchasing the specified units of the item. */ - public double getItemCost() { + public double getItemValue() { + // TODO: Possibly refactor to avoid using getter methods in ItemPrice and ItemQuantity fields return price.getItemPrice() * quantity.getItemQuantity(); } From b4feda84e2270d54c7d2d509caf6d837c9d86ee1 Mon Sep 17 00:00:00 2001 From: Tan Yi Xian <> Date: Tue, 1 Nov 2022 22:07:48 +0800 Subject: [PATCH 04/10] Modify sample data to match bought date earlier than expiry date --- .../foodrem/model/util/SampleDataUtil.java | 49 +-- .../seedu/foodrem/testutil/ItemsToSort.java | 288 +++++++++--------- 2 files changed, 157 insertions(+), 180 deletions(-) diff --git a/src/main/java/seedu/foodrem/model/util/SampleDataUtil.java b/src/main/java/seedu/foodrem/model/util/SampleDataUtil.java index 81693b87c10..d0f81ae76d3 100644 --- a/src/main/java/seedu/foodrem/model/util/SampleDataUtil.java +++ b/src/main/java/seedu/foodrem/model/util/SampleDataUtil.java @@ -40,8 +40,8 @@ public static Item[] getSampleItems() { new Item(new ItemName("Eggs"), new ItemQuantity("10"), new ItemUnit("trays"), - ItemBoughtDate.of("28-10-2022"), - ItemExpiryDate.of("25-01-2022"), + ItemBoughtDate.of("28-01-2022"), + ItemExpiryDate.of("25-02-2022"), new ItemPrice("3.30"), new ItemRemark("For seasonal meal"), new HashSet<>()), @@ -57,7 +57,7 @@ public static Item[] getSampleItems() { new ItemQuantity("10"), new ItemUnit("litres"), ItemBoughtDate.of("13-05-2022"), - ItemExpiryDate.of("13-01-2022"), + ItemExpiryDate.of("13-06-2022"), new ItemPrice("1.40"), new ItemRemark(""), new HashSet<>(List.of(new Tag("Drinks"), new Tag("Fridge")))), @@ -65,7 +65,7 @@ public static Item[] getSampleItems() { new ItemQuantity("2"), new ItemUnit("bottles"), ItemBoughtDate.of("21-06-2022"), - ItemExpiryDate.of("21-04-2022"), + ItemExpiryDate.of("21-12-2022"), new ItemPrice("30"), new ItemRemark(""), new HashSet<>(List.of(new Tag("Drinks"), new Tag("Fridge")))), @@ -88,8 +88,8 @@ public static Item[] getSampleItems() { new Item(new ItemName("Chicken breasts"), new ItemQuantity("10.8"), new ItemUnit("Kg"), - ItemBoughtDate.of("24-08-2022"), - ItemExpiryDate.of("16-04-2022"), + ItemBoughtDate.of("24-03-2022"), + ItemExpiryDate.of("16-12-2022"), new ItemPrice("11"), new ItemRemark("Try new recipe"), new HashSet<>(List.of(new Tag("Meat"), new Tag("Freezer")))), @@ -104,7 +104,7 @@ public static Item[] getSampleItems() { new Item(new ItemName("Oranges"), new ItemQuantity("2.8"), new ItemUnit("Kg"), - ItemBoughtDate.of("18-09-2022"), + ItemBoughtDate.of("18-03-2022"), ItemExpiryDate.of("10-04-2022"), new ItemPrice("4.40"), new ItemRemark("For seasonal meal"), @@ -113,7 +113,7 @@ public static Item[] getSampleItems() { new ItemQuantity("9.3"), new ItemUnit("Kg"), ItemBoughtDate.of("14-11-2022"), - ItemExpiryDate.of("24-10-2022"), + ItemExpiryDate.of("24-12-2022"), new ItemPrice("2.80"), new ItemRemark("For seasonal meal"), new HashSet<>(List.of(new Tag("Vegetables")))), @@ -160,7 +160,7 @@ public static Item[] getSampleItems() { new Item(new ItemName("Beef Round"), new ItemQuantity("10"), new ItemUnit("Kg"), - ItemBoughtDate.of("22-12-2022"), + ItemBoughtDate.of("22-06-2022"), ItemExpiryDate.of("19-07-2022"), new ItemPrice("28"), new ItemRemark("Try new recipe"), @@ -177,7 +177,7 @@ public static Item[] getSampleItems() { new ItemQuantity("4"), new ItemUnit("Kg"), ItemBoughtDate.of("21-07-2022"), - ItemExpiryDate.of("19-04-2022"), + ItemExpiryDate.of("19-08-2022"), new ItemPrice("2.00"), new ItemRemark(""), new HashSet<>(List.of(new Tag("Vegetables")))), @@ -208,7 +208,7 @@ public static Item[] getSampleItems() { new Item(new ItemName("Whisky"), new ItemQuantity("10"), new ItemUnit("litres"), - ItemBoughtDate.of("15-12-2022"), + ItemBoughtDate.of("15-10-2022"), ItemExpiryDate.of("14-11-2022"), new ItemPrice("58"), new ItemRemark("For party"), @@ -224,7 +224,7 @@ public static Item[] getSampleItems() { new Item(new ItemName("Vodka"), new ItemQuantity("4.8"), new ItemUnit("litres"), - ItemBoughtDate.of("18-10-2022"), + ItemBoughtDate.of("18-03-2022"), ItemExpiryDate.of("11-04-2022"), new ItemPrice("58"), new ItemRemark("For party"), @@ -233,26 +233,13 @@ public static Item[] getSampleItems() { new ItemQuantity("3"), new ItemUnit("litres"), ItemBoughtDate.of("28-06-2022"), - ItemExpiryDate.of("26-01-2022"), + ItemExpiryDate.of("26-07-2022"), new ItemPrice("58"), new ItemRemark("For party"), new HashSet<>(List.of(new Tag("Drinks"), new Tag("Fridge")))), }; } - public static Tag[] getSampleTags() { - return new Tag[]{ - new Tag("Vegetables"), - new Tag("Aromatics"), - new Tag("Herbs"), - new Tag("Meats"), - new Tag("Spices"), - new Tag("Cutlery"), - new Tag("Kitchenware"), - }; - } - - public static ReadOnlyFoodRem getSampleFoodRem() { FoodRem sampleFoodRem = new FoodRem(); for (Item sampleItem : getSampleItems()) { @@ -265,14 +252,4 @@ public static ReadOnlyFoodRem getSampleFoodRem() { } return sampleFoodRem; } - - // TODO: Check if we can delete this. Implement with tags - ///** - // * Returns a tag set containing the list of strings given. - // */ - //public static Set getTagSet(String... strings) { - // return Arrays.stream(strings) - // .map(Tag::new) - // .collect(Collectors.toSet()); - //} } diff --git a/src/test/java/seedu/foodrem/testutil/ItemsToSort.java b/src/test/java/seedu/foodrem/testutil/ItemsToSort.java index 37e8e657c74..c89846c9dc2 100644 --- a/src/test/java/seedu/foodrem/testutil/ItemsToSort.java +++ b/src/test/java/seedu/foodrem/testutil/ItemsToSort.java @@ -13,7 +13,7 @@ public class ItemsToSort { public static final Item NI_Q1_U114_B119_E18_P13_R3 = new ItemBuilder().withItemName("NI Q1 U114 B119 E18 P13 R3") .withItemQuantity("1") .withItemUnit("VWW") - .withItemBoughtDate("07-08-2022") + .withItemBoughtDate("07-08-2021") .withItemExpiryDate("18-04-2022") .withItemPrice("13") .withItemRemarks("ACU") @@ -21,7 +21,7 @@ public class ItemsToSort { public static final Item NG_Q2_U124_B63_E65_P96_R133 = new ItemBuilder().withItemName("NG Q2 U124 B63 E65 P96 R133") .withItemQuantity("2") .withItemUnit("XGW") - .withItemBoughtDate("07-06-2022") + .withItemBoughtDate("07-06-2021") .withItemExpiryDate("09-06-2022") .withItemPrice("96") .withItemRemarks("YIN") @@ -29,7 +29,7 @@ public class ItemsToSort { public static final Item NG_Q3_U62_B55_E31_P30_R48 = new ItemBuilder().withItemName("NG Q3 U62 B55 E31 P30 R48") .withItemQuantity("3") .withItemUnit("MBG") - .withItemBoughtDate("27-05-2022") + .withItemBoughtDate("27-05-2021") .withItemExpiryDate("03-05-2022") .withItemPrice("30") .withItemRemarks("IBO") @@ -38,7 +38,7 @@ public class ItemsToSort { "NI Q4 U87 B117 E107 P114 R56") .withItemQuantity("4") .withItemUnit("RVB") - .withItemBoughtDate("05-08-2022") + .withItemBoughtDate("05-08-2021") .withItemExpiryDate("23-07-2022") .withItemPrice("114") .withItemRemarks("JQM") @@ -47,7 +47,7 @@ public class ItemsToSort { "NA Q5 U93 B134 E122 P128 R55") .withItemQuantity("5") .withItemUnit("TAS") - .withItemBoughtDate("22-08-2022") + .withItemBoughtDate("22-08-2021") .withItemExpiryDate("10-08-2022") .withItemPrice("128") .withItemRemarks("JIT") @@ -55,7 +55,7 @@ public class ItemsToSort { public static final Item NH_Q6_U80_B106_E44_P137_R4 = new ItemBuilder().withItemName("NH Q6 U80 B106 E44 P137 R4") .withItemQuantity("6") .withItemUnit("QPI") - .withItemBoughtDate("22-07-2022") + .withItemBoughtDate("22-07-2021") .withItemExpiryDate("16-05-2022") .withItemPrice("137") .withItemRemarks("AJT") @@ -63,7 +63,7 @@ public class ItemsToSort { public static final Item NJ_Q7_U120_B25_E49_P66_R59 = new ItemBuilder().withItemName("NJ Q7 U120 B25 E49 P66 R59") .withItemQuantity("7") .withItemUnit("WUG") - .withItemBoughtDate("25-04-2022") + .withItemBoughtDate("25-04-2021") .withItemExpiryDate("21-05-2022") .withItemPrice("66") .withItemRemarks("KTU") @@ -71,7 +71,7 @@ public class ItemsToSort { public static final Item NA_Q8_U14_B87_E57_P49_R14 = new ItemBuilder().withItemName("NA Q8 U14 B87 E57 P49 R14") .withItemQuantity("8") .withItemUnit("BWF") - .withItemBoughtDate("03-07-2022") + .withItemBoughtDate("03-07-2021") .withItemExpiryDate("01-06-2022") .withItemPrice("49") .withItemRemarks("BPQ") @@ -79,7 +79,7 @@ public class ItemsToSort { public static final Item NC_Q9_U4_B28_E28_P7_R7 = new ItemBuilder().withItemName("NC Q9 U4 B28 E28 P7 R7") .withItemQuantity("9") .withItemUnit("ATT") - .withItemBoughtDate("28-04-2022") + .withItemBoughtDate("28-04-2021") .withItemExpiryDate("28-04-2022") .withItemPrice("7") .withItemRemarks("ATN") @@ -87,7 +87,7 @@ public class ItemsToSort { public static final Item NK_Q10_U32_B23_E23_P1_R84 = new ItemBuilder().withItemName("NK Q10 U32 B23 E23 P1 R84") .withItemQuantity("10") .withItemUnit("FTT") - .withItemBoughtDate("23-04-2022") + .withItemBoughtDate("23-04-2021") .withItemExpiryDate("23-04-2022") .withItemPrice("1") .withItemRemarks("PWJ") @@ -95,7 +95,7 @@ public class ItemsToSort { public static final Item NB_Q11_U94_B40_E78_P97_R104 = new ItemBuilder().withItemName("NB Q11 U94 B40 E78 P97 R104") .withItemQuantity("11") .withItemUnit("TEO") - .withItemBoughtDate("12-05-2022") + .withItemBoughtDate("12-05-2021") .withItemExpiryDate("22-06-2022") .withItemPrice("97") .withItemRemarks("TQT") @@ -103,7 +103,7 @@ public class ItemsToSort { public static final Item NK_Q12_U91_B62_E60_P41_R18 = new ItemBuilder().withItemName("NK Q12 U91 B62 E60 P41 R18") .withItemQuantity("12") .withItemUnit("SOF") - .withItemBoughtDate("06-06-2022") + .withItemBoughtDate("06-06-2021") .withItemExpiryDate("04-06-2022") .withItemPrice("41") .withItemRemarks("DXN") @@ -111,7 +111,7 @@ public class ItemsToSort { public static final Item NA_Q13_U59_B17_E39_P58_R24 = new ItemBuilder().withItemName("NA Q13 U59 B17 E39 P58 R24") .withItemQuantity("13") .withItemUnit("LRJ") - .withItemBoughtDate("17-04-2022") + .withItemBoughtDate("17-04-2021") .withItemExpiryDate("11-05-2022") .withItemPrice("58") .withItemRemarks("ESW") @@ -120,7 +120,7 @@ public class ItemsToSort { "ND Q14 U44 B136 E128 P132 R43") .withItemQuantity("14") .withItemUnit("HUW") - .withItemBoughtDate("24-08-2022") + .withItemBoughtDate("24-08-2021") .withItemExpiryDate("16-08-2022") .withItemPrice("132") .withItemRemarks("HPI") @@ -129,7 +129,7 @@ public class ItemsToSort { "ND Q15 U53 B120 E55 P103 R135") .withItemQuantity("15") .withItemUnit("KDZ") - .withItemBoughtDate("08-08-2022") + .withItemBoughtDate("08-08-2021") .withItemExpiryDate("27-05-2022") .withItemPrice("103") .withItemRemarks("YQU") @@ -138,7 +138,7 @@ public class ItemsToSort { "NI Q16 U77 B61 E130 P123 R137") .withItemQuantity("16") .withItemUnit("PZW") - .withItemBoughtDate("05-06-2022") + .withItemBoughtDate("05-06-2021") .withItemExpiryDate("18-08-2022") .withItemPrice("123") .withItemRemarks("ZBR") @@ -146,7 +146,7 @@ public class ItemsToSort { public static final Item NJ_Q17_U37_B12_E103_P45_R31 = new ItemBuilder().withItemName("NJ Q17 U37 B12 E103 P45 R31") .withItemQuantity("17") .withItemUnit("GKE") - .withItemBoughtDate("12-04-2022") + .withItemBoughtDate("12-04-2021") .withItemExpiryDate("19-07-2022") .withItemPrice("45") .withItemRemarks("FNY") @@ -154,7 +154,7 @@ public class ItemsToSort { public static final Item NA_Q18_U11_B47_E92_P98_R108 = new ItemBuilder().withItemName("NA Q18 U11 B47 E92 P98 R108") .withItemQuantity("18") .withItemUnit("BTU") - .withItemBoughtDate("19-05-2022") + .withItemBoughtDate("19-05-2021") .withItemExpiryDate("08-07-2022") .withItemPrice("98") .withItemRemarks("TUP") @@ -162,7 +162,7 @@ public class ItemsToSort { public static final Item NC_Q19_U69_B109_E66_P81_R50 = new ItemBuilder().withItemName("NC Q19 U69 B109 E66 P81 R50") .withItemQuantity("19") .withItemUnit("ORL") - .withItemBoughtDate("25-07-2022") + .withItemBoughtDate("25-07-2021") .withItemExpiryDate("10-06-2022") .withItemPrice("81") .withItemRemarks("ISJ") @@ -171,7 +171,7 @@ public class ItemsToSort { "NK Q20 U60 B110 E24 P118 R81") .withItemQuantity("20") .withItemUnit("LVE") - .withItemBoughtDate("26-07-2022") + .withItemBoughtDate("26-07-2021") .withItemExpiryDate("24-04-2022") .withItemPrice("118") .withItemRemarks("OXJ") @@ -180,7 +180,7 @@ public class ItemsToSort { "NK Q21 U112 B118 E42 P8 R142") .withItemQuantity("21") .withItemUnit("VUC") - .withItemBoughtDate("06-08-2022") + .withItemBoughtDate("06-08-2021") .withItemExpiryDate("14-05-2022") .withItemPrice("8") .withItemRemarks("ZJA") @@ -189,7 +189,7 @@ public class ItemsToSort { "NE Q22 U89 B133 E110 P92 R15") .withItemQuantity("22") .withItemUnit("SHN") - .withItemBoughtDate("21-08-2022") + .withItemBoughtDate("21-08-2021") .withItemExpiryDate("26-07-2022") .withItemPrice("92") .withItemRemarks("BTK") @@ -197,7 +197,7 @@ public class ItemsToSort { public static final Item NF_Q23_U1_B82_E59_P116_R139 = new ItemBuilder().withItemName("NF Q23 U1 B82 E59 P116 R139") .withItemQuantity("23") .withItemUnit("AAN") - .withItemBoughtDate("26-06-2022") + .withItemBoughtDate("26-06-2021") .withItemExpiryDate("03-06-2022") .withItemPrice("116") .withItemRemarks("ZDJ") @@ -205,7 +205,7 @@ public class ItemsToSort { public static final Item NL_Q25_U5_B96_E89_P60_R103 = new ItemBuilder().withItemName("NL Q25 U5 B96 E89 P60 R103") .withItemQuantity("25") .withItemUnit("AUX") - .withItemBoughtDate("12-07-2022") + .withItemBoughtDate("12-07-2021") .withItemExpiryDate("05-07-2022") .withItemPrice("60") .withItemRemarks("TJT") @@ -214,7 +214,7 @@ public class ItemsToSort { "NA Q24 U104 B130 E90 P94 R74") .withItemQuantity("24") .withItemUnit("UTM") - .withItemBoughtDate("18-08-2022") + .withItemBoughtDate("18-08-2021") .withItemExpiryDate("06-07-2022") .withItemPrice("94") .withItemRemarks("NDM") @@ -223,7 +223,7 @@ public class ItemsToSort { "ND Q26 U135 B83 E113 P20 R44") .withItemQuantity("26") .withItemUnit("YYK") - .withItemBoughtDate("27-06-2022") + .withItemBoughtDate("27-06-2021") .withItemExpiryDate("01-08-2022") .withItemPrice("20") .withItemRemarks("HQF") @@ -232,7 +232,7 @@ public class ItemsToSort { "NB Q27 U40 B113 E85 P115 R87") .withItemQuantity("27") .withItemUnit("GUO") - .withItemBoughtDate("01-08-2022") + .withItemBoughtDate("01-08-2021") .withItemExpiryDate("01-07-2022") .withItemPrice("115") .withItemRemarks("QPR") @@ -241,7 +241,7 @@ public class ItemsToSort { "NC Q28 U29 B112 E73 P14 R130") .withItemQuantity("28") .withItemUnit("FOX") - .withItemBoughtDate("28-07-2022") + .withItemBoughtDate("28-07-2021") .withItemExpiryDate("17-06-2022") .withItemPrice("14") .withItemRemarks("YCE") @@ -250,7 +250,7 @@ public class ItemsToSort { "NC Q29 U79 B126 E123 P135 R63") .withItemQuantity("29") .withItemUnit("QNW") - .withItemBoughtDate("14-08-2022") + .withItemBoughtDate("14-08-2021") .withItemExpiryDate("11-08-2022") .withItemPrice("135") .withItemRemarks("LLL") @@ -259,7 +259,7 @@ public class ItemsToSort { "NA Q30 U45 B128 E82 P68 R116") .withItemQuantity("30") .withItemUnit("HVO") - .withItemBoughtDate("16-08-2022") + .withItemBoughtDate("16-08-2021") .withItemExpiryDate("26-06-2022") .withItemPrice("68") .withItemRemarks("VDK") @@ -268,7 +268,7 @@ public class ItemsToSort { "NB Q31 U20 B94 E138 P35 R123") .withItemQuantity("31") .withItemUnit("DHR") - .withItemBoughtDate("10-07-2022") + .withItemBoughtDate("10-07-2021") .withItemExpiryDate("26-08-2022") .withItemPrice("35") .withItemRemarks("WNU") @@ -277,7 +277,7 @@ public class ItemsToSort { "NF Q32 U113 B35 E96 P111 R98") .withItemQuantity("32") .withItemUnit("VWP") - .withItemBoughtDate("07-05-2022") + .withItemBoughtDate("07-05-2021") .withItemExpiryDate("12-07-2022") .withItemPrice("111") .withItemRemarks("SNH") @@ -286,7 +286,7 @@ public class ItemsToSort { "ND Q33 U15 B116 E91 P127 R39") .withItemQuantity("33") .withItemUnit("CJO") - .withItemBoughtDate("04-08-2022") + .withItemBoughtDate("04-08-2021") .withItemExpiryDate("07-07-2022") .withItemPrice("127") .withItemRemarks("GUB") @@ -295,7 +295,7 @@ public class ItemsToSort { "NB Q34 U16 B27 E98 P136 R111") .withItemQuantity("34") .withItemUnit("CKK") - .withItemBoughtDate("27-04-2022") + .withItemBoughtDate("27-04-2021") .withItemExpiryDate("14-07-2022") .withItemPrice("136") .withItemRemarks("UFA") @@ -304,7 +304,7 @@ public class ItemsToSort { "NI Q35 U100 B114 E81 P44 R114") .withItemQuantity("35") .withItemUnit("TWG") - .withItemBoughtDate("02-08-2022") + .withItemBoughtDate("02-08-2021") .withItemExpiryDate("25-06-2022") .withItemPrice("44") .withItemRemarks("UPN") @@ -312,7 +312,7 @@ public class ItemsToSort { public static final Item NH_Q36_U73_B81_E16_P110_R86 = new ItemBuilder().withItemName("NH Q36 U73 B81 E16 P110 R86") .withItemQuantity("36") .withItemUnit("PFH") - .withItemBoughtDate("25-06-2022") + .withItemBoughtDate("25-06-2021") .withItemExpiryDate("16-04-2022") .withItemPrice("110") .withItemRemarks("QCK") @@ -320,7 +320,7 @@ public class ItemsToSort { public static final Item NG_Q37_U108_B10_E8_P31_R127 = new ItemBuilder().withItemName("NG Q37 U108 B10 E8 P31 R127") .withItemQuantity("37") .withItemUnit("VJW") - .withItemBoughtDate("10-04-2022") + .withItemBoughtDate("10-04-2021") .withItemExpiryDate("08-04-2022") .withItemPrice("31") .withItemRemarks("XQD") @@ -328,7 +328,7 @@ public class ItemsToSort { public static final Item NE_Q38_U19_B70_E7_P124_R36 = new ItemBuilder().withItemName("NE Q38 U19 B70 E7 P124 R36") .withItemQuantity("38") .withItemUnit("CWM") - .withItemBoughtDate("14-06-2022") + .withItemBoughtDate("14-06-2021") .withItemExpiryDate("07-04-2022") .withItemPrice("124") .withItemRemarks("GNY") @@ -336,7 +336,7 @@ public class ItemsToSort { public static final Item NJ_Q39_U68_B14_E34_P88_R96 = new ItemBuilder().withItemName("NJ Q39 U68 B14 E34 P88 R96") .withItemQuantity("39") .withItemUnit("ODS") - .withItemBoughtDate("14-04-2022") + .withItemBoughtDate("14-04-2021") .withItemExpiryDate("06-05-2022") .withItemPrice("88") .withItemRemarks("SEA") @@ -344,7 +344,7 @@ public class ItemsToSort { public static final Item NH_Q40_U96_B6_E140_P16_R68 = new ItemBuilder().withItemName("NH Q40 U96 B6 E140 P16 R68") .withItemQuantity("40") .withItemUnit("TNM") - .withItemBoughtDate("06-04-2022") + .withItemBoughtDate("06-04-2021") .withItemExpiryDate("28-08-2022") .withItemPrice("16") .withItemRemarks("MIJ") @@ -352,7 +352,7 @@ public class ItemsToSort { public static final Item NK_Q41_U131_B4_E95_P37_R1 = new ItemBuilder().withItemName("NK Q41 U131 B4 E95 P37 R1") .withItemQuantity("41") .withItemUnit("YTP") - .withItemBoughtDate("04-04-2022") + .withItemBoughtDate("04-04-2021") .withItemExpiryDate("11-07-2022") .withItemPrice("37") .withItemRemarks("AAI") @@ -360,7 +360,7 @@ public class ItemsToSort { public static final Item NA_Q42_U67_B53_E40_P65_R140 = new ItemBuilder().withItemName("NA Q42 U67 B53 E40 P65 R140") .withItemQuantity("42") .withItemUnit("OBF") - .withItemBoughtDate("25-05-2022") + .withItemBoughtDate("25-05-2021") .withItemExpiryDate("12-05-2022") .withItemPrice("65") .withItemRemarks("ZHF") @@ -369,7 +369,7 @@ public class ItemsToSort { "NH Q43 U65 B15 E141 P141 R72") .withItemQuantity("43") .withItemUnit("NFM") - .withItemBoughtDate("15-04-2022") + .withItemBoughtDate("15-04-2021") .withItemExpiryDate("01-09-2022") .withItemPrice("141") .withItemRemarks("MRJ") @@ -378,7 +378,7 @@ public class ItemsToSort { "NH Q44 U43 B69 E47 P100 R109") .withItemQuantity("44") .withItemUnit("HSL") - .withItemBoughtDate("13-06-2022") + .withItemBoughtDate("13-06-2021") .withItemExpiryDate("19-05-2022") .withItemPrice("100") .withItemRemarks("TZU") @@ -387,7 +387,7 @@ public class ItemsToSort { "NK Q45 U143 B111 E20 P24 R60") .withItemQuantity("45") .withItemUnit("ZWL") - .withItemBoughtDate("27-07-2022") + .withItemBoughtDate("27-07-2021") .withItemExpiryDate("20-04-2022") .withItemPrice("24") .withItemRemarks("LGP") @@ -395,7 +395,7 @@ public class ItemsToSort { public static final Item ND_Q46_U74_B97_E48_P99_R12 = new ItemBuilder().withItemName("ND Q46 U74 B97 E48 P99 R12") .withItemQuantity("46") .withItemUnit("PKA") - .withItemBoughtDate("13-07-2022") + .withItemBoughtDate("13-07-2021") .withItemExpiryDate("20-05-2022") .withItemPrice("99") .withItemRemarks("BJN") @@ -403,7 +403,7 @@ public class ItemsToSort { public static final Item NL_Q47_U81_B76_E77_P122_R93 = new ItemBuilder().withItemName("NL Q47 U81 B76 E77 P122 R93") .withItemQuantity("47") .withItemUnit("QSZ") - .withItemBoughtDate("20-06-2022") + .withItemBoughtDate("20-06-2021") .withItemExpiryDate("21-06-2022") .withItemPrice("122") .withItemRemarks("RNU") @@ -412,7 +412,7 @@ public class ItemsToSort { "NB Q48 U51 B51 E116 P17 R100") .withItemQuantity("48") .withItemUnit("JQV") - .withItemBoughtDate("23-05-2022") + .withItemBoughtDate("23-05-2021") .withItemExpiryDate("04-08-2022") .withItemPrice("17") .withItemRemarks("SWN") @@ -420,7 +420,7 @@ public class ItemsToSort { public static final Item NG_Q49_U133_B86_E87_P46_R19 = new ItemBuilder().withItemName("NG Q49 U133 B86 E87 P46 R19") .withItemQuantity("49") .withItemUnit("YVS") - .withItemBoughtDate("02-07-2022") + .withItemBoughtDate("02-07-2021") .withItemExpiryDate("03-07-2022") .withItemPrice("46") .withItemRemarks("DZB") @@ -428,7 +428,7 @@ public class ItemsToSort { public static final Item NL_Q50_U84_B60_E13_P48_R21 = new ItemBuilder().withItemName("NL Q50 U84 B60 E13 P48 R21") .withItemQuantity("50") .withItemUnit("RHV") - .withItemBoughtDate("04-06-2022") + .withItemBoughtDate("04-06-2021") .withItemExpiryDate("13-04-2022") .withItemPrice("48") .withItemRemarks("ECZ") @@ -436,7 +436,7 @@ public class ItemsToSort { public static final Item NB_Q51_U10_B30_E1_P105_R94 = new ItemBuilder().withItemName("NB Q51 U10 B30 E1 P105 R94") .withItemQuantity("51") .withItemUnit("BET") - .withItemBoughtDate("02-05-2022") + .withItemBoughtDate("02-05-2021") .withItemExpiryDate("01-04-2022") .withItemPrice("105") .withItemRemarks("RQU") @@ -444,7 +444,7 @@ public class ItemsToSort { public static final Item NI_Q52_U140_B77_E61_P71_R85 = new ItemBuilder().withItemName("NI Q52 U140 B77 E61 P71 R85") .withItemQuantity("52") .withItemUnit("ZLZ") - .withItemBoughtDate("21-06-2022") + .withItemBoughtDate("21-06-2021") .withItemExpiryDate("05-06-2022") .withItemPrice("71") .withItemRemarks("QAH") @@ -452,7 +452,7 @@ public class ItemsToSort { public static final Item NE_Q53_U64_B44_E45_P95_R46 = new ItemBuilder().withItemName("NE Q53 U64 B44 E45 P95 R46") .withItemQuantity("53") .withItemUnit("MXC") - .withItemBoughtDate("16-05-2022") + .withItemBoughtDate("16-05-2021") .withItemExpiryDate("17-05-2022") .withItemPrice("95") .withItemRemarks("HWI") @@ -460,7 +460,7 @@ public class ItemsToSort { public static final Item ND_Q54_U17_B104_E88_P3_R29 = new ItemBuilder().withItemName("ND Q54 U17 B104 E88 P3 R29") .withItemQuantity("54") .withItemUnit("CMD") - .withItemBoughtDate("20-07-2022") + .withItemBoughtDate("20-07-2021") .withItemExpiryDate("04-07-2022") .withItemPrice("3") .withItemRemarks("FNB") @@ -469,7 +469,7 @@ public class ItemsToSort { "NG Q55 U82 B141 E19 P85 R128") .withItemQuantity("55") .withItemUnit("QXZ") - .withItemBoughtDate("01-09-2022") + .withItemBoughtDate("01-09-2021") .withItemExpiryDate("19-04-2022") .withItemPrice("85") .withItemRemarks("XUP") @@ -477,7 +477,7 @@ public class ItemsToSort { public static final Item NL_Q56_U105_B131_E22_P62_R6 = new ItemBuilder().withItemName("NL Q56 U105 B131 E22 P62 R6") .withItemQuantity("56") .withItemUnit("UUC") - .withItemBoughtDate("19-08-2022") + .withItemBoughtDate("19-08-2021") .withItemExpiryDate("22-04-2022") .withItemPrice("62") .withItemRemarks("AQO") @@ -485,7 +485,7 @@ public class ItemsToSort { public static final Item NL_Q57_U75_B57_E101_P50_R30 = new ItemBuilder().withItemName("NL Q57 U75 B57 E101 P50 R30") .withItemQuantity("57") .withItemUnit("PLT") - .withItemBoughtDate("01-06-2022") + .withItemBoughtDate("01-06-2021") .withItemExpiryDate("17-07-2022") .withItemPrice("50") .withItemRemarks("FNB") @@ -493,7 +493,7 @@ public class ItemsToSort { public static final Item NL_Q58_U101_B50_E75_P112_R5 = new ItemBuilder().withItemName("NL Q58 U101 B50 E75 P112 R5") .withItemQuantity("58") .withItemUnit("UCM") - .withItemBoughtDate("22-05-2022") + .withItemBoughtDate("22-05-2021") .withItemExpiryDate("19-06-2022") .withItemPrice("112") .withItemRemarks("ALF") @@ -502,7 +502,7 @@ public class ItemsToSort { "NJ Q59 U128 B137 E102 P78 R64") .withItemQuantity("59") .withItemUnit("YDH") - .withItemBoughtDate("25-08-2022") + .withItemBoughtDate("25-08-2021") .withItemExpiryDate("18-07-2022") .withItemPrice("78") .withItemRemarks("LLP") @@ -510,7 +510,7 @@ public class ItemsToSort { public static final Item NC_Q60_U85_B7_E118_P86_R132 = new ItemBuilder().withItemName("NC Q60 U85 B7 E118 P86 R132") .withItemQuantity("60") .withItemUnit("RIU") - .withItemBoughtDate("07-04-2022") + .withItemBoughtDate("07-04-2021") .withItemExpiryDate("06-08-2022") .withItemPrice("86") .withItemRemarks("YHO") @@ -519,7 +519,7 @@ public class ItemsToSort { "NF Q61 U34 B79 E129 P28 R107") .withItemQuantity("61") .withItemUnit("FYL") - .withItemBoughtDate("23-06-2022") + .withItemBoughtDate("23-06-2021") .withItemExpiryDate("17-08-2022") .withItemPrice("28") .withItemRemarks("TRG") @@ -527,7 +527,7 @@ public class ItemsToSort { public static final Item NK_Q62_U47_B29_E62_P26_R23 = new ItemBuilder().withItemName("NK Q62 U47 B29 E62 P26 R23") .withItemQuantity("62") .withItemUnit("HYH") - .withItemBoughtDate("01-05-2022") + .withItemBoughtDate("01-05-2021") .withItemExpiryDate("06-06-2022") .withItemPrice("26") .withItemRemarks("EPO") @@ -535,7 +535,7 @@ public class ItemsToSort { public static final Item NJ_Q63_U18_B72_E52_P12_R66 = new ItemBuilder().withItemName("NJ Q63 U18 B72 E52 P12 R66") .withItemQuantity("63") .withItemUnit("CME") - .withItemBoughtDate("16-06-2022") + .withItemBoughtDate("16-06-2021") .withItemExpiryDate("24-05-2022") .withItemPrice("12") .withItemRemarks("LZV") @@ -543,7 +543,7 @@ public class ItemsToSort { public static final Item NB_Q64_U110_B31_E5_P67_R91 = new ItemBuilder().withItemName("NB Q64 U110 B31 E5 P67 R91") .withItemQuantity("64") .withItemUnit("VMW") - .withItemBoughtDate("03-05-2022") + .withItemBoughtDate("03-05-2021") .withItemExpiryDate("05-04-2022") .withItemPrice("67") .withItemRemarks("REW") @@ -551,7 +551,7 @@ public class ItemsToSort { public static final Item NL_Q65_U36_B88_E133_P4_R136 = new ItemBuilder().withItemName("NL Q65 U36 B88 E133 P4 R136") .withItemQuantity("65") .withItemUnit("GHF") - .withItemBoughtDate("04-07-2022") + .withItemBoughtDate("04-07-2021") .withItemExpiryDate("21-08-2022") .withItemPrice("4") .withItemRemarks("YRB") @@ -560,7 +560,7 @@ public class ItemsToSort { "NE Q66 U27 B132 E117 P83 R54") .withItemQuantity("66") .withItemUnit("FHL") - .withItemBoughtDate("20-08-2022") + .withItemBoughtDate("20-08-2021") .withItemExpiryDate("05-08-2022") .withItemPrice("83") .withItemRemarks("JDQ") @@ -568,7 +568,7 @@ public class ItemsToSort { public static final Item NK_Q67_U139_B26_E15_P57_R37 = new ItemBuilder().withItemName("NK Q67 U139 B26 E15 P57 R37") .withItemQuantity("67") .withItemUnit("ZGZ") - .withItemBoughtDate("26-04-2022") + .withItemBoughtDate("26-04-2021") .withItemExpiryDate("15-04-2022") .withItemPrice("57") .withItemRemarks("GOE") @@ -576,7 +576,7 @@ public class ItemsToSort { public static final Item NF_Q68_U31_B101_E2_P93_R131 = new ItemBuilder().withItemName("NF Q68 U31 B101 E2 P93 R131") .withItemQuantity("68") .withItemUnit("FQV") - .withItemBoughtDate("17-07-2022") + .withItemBoughtDate("17-07-2021") .withItemExpiryDate("02-04-2022") .withItemPrice("93") .withItemRemarks("YET") @@ -584,7 +584,7 @@ public class ItemsToSort { public static final Item NI_Q69_U127_B9_E72_P53_R77 = new ItemBuilder().withItemName("NI Q69 U127 B9 E72 P53 R77") .withItemQuantity("69") .withItemUnit("XYL") - .withItemBoughtDate("09-04-2022") + .withItemBoughtDate("09-04-2021") .withItemExpiryDate("16-06-2022") .withItemPrice("53") .withItemRemarks("NWZ") @@ -593,7 +593,7 @@ public class ItemsToSort { "NJ Q70 U24 B102 E21 P143 R76") .withItemQuantity("70") .withItemUnit("EDR") - .withItemBoughtDate("18-07-2022") + .withItemBoughtDate("18-07-2021") .withItemExpiryDate("21-04-2022") .withItemPrice("143") .withItemRemarks("NQD") @@ -601,7 +601,7 @@ public class ItemsToSort { public static final Item NI_Q71_U50_B32_E80_P27_R80 = new ItemBuilder().withItemName("NI Q71 U50 B32 E80 P27 R80") .withItemQuantity("71") .withItemUnit("JHP") - .withItemBoughtDate("04-05-2022") + .withItemBoughtDate("04-05-2021") .withItemExpiryDate("24-06-2022") .withItemPrice("27") .withItemRemarks("OTP") @@ -610,7 +610,7 @@ public class ItemsToSort { "NK Q72 U136 B95 E111 P43 R113") .withItemQuantity("72") .withItemUnit("YYN") - .withItemBoughtDate("11-07-2022") + .withItemBoughtDate("11-07-2021") .withItemExpiryDate("27-07-2022") .withItemPrice("43") .withItemRemarks("UPM") @@ -618,7 +618,7 @@ public class ItemsToSort { public static final Item NL_Q73_U23_B5_E32_P82_R8 = new ItemBuilder().withItemName("NL Q73 U23 B5 E32 P82 R8") .withItemQuantity("73") .withItemUnit("ECA") - .withItemBoughtDate("05-04-2022") + .withItemBoughtDate("05-04-2021") .withItemExpiryDate("04-05-2022") .withItemPrice("82") .withItemRemarks("AZM") @@ -626,7 +626,7 @@ public class ItemsToSort { public static final Item NF_Q74_U98_B48_E70_P42_R20 = new ItemBuilder().withItemName("NF Q74 U98 B48 E70 P42 R20") .withItemQuantity("74") .withItemUnit("TRV") - .withItemBoughtDate("20-05-2022") + .withItemBoughtDate("20-05-2021") .withItemExpiryDate("14-06-2022") .withItemPrice("42") .withItemRemarks("ECM") @@ -634,7 +634,7 @@ public class ItemsToSort { public static final Item NC_Q75_U30_B2_E86_P77_R47 = new ItemBuilder().withItemName("NC Q75 U30 B2 E86 P77 R47") .withItemQuantity("75") .withItemUnit("FQQ") - .withItemBoughtDate("02-04-2022") + .withItemBoughtDate("02-04-2021") .withItemExpiryDate("02-07-2022") .withItemPrice("77") .withItemRemarks("HXA") @@ -642,7 +642,7 @@ public class ItemsToSort { public static final Item NA_Q76_U2_B98_E114_P19_R117 = new ItemBuilder().withItemName("NA Q76 U2 B98 E114 P19 R117") .withItemQuantity("76") .withItemUnit("AJA") - .withItemBoughtDate("14-07-2022") + .withItemBoughtDate("14-07-2021") .withItemExpiryDate("02-08-2022") .withItemPrice("19") .withItemRemarks("VKZ") @@ -650,7 +650,7 @@ public class ItemsToSort { public static final Item NF_Q77_U123_B3_E4_P59_R25 = new ItemBuilder().withItemName("NF Q77 U123 B3 E4 P59 R25") .withItemQuantity("77") .withItemUnit("XFK") - .withItemBoughtDate("03-04-2022") + .withItemBoughtDate("03-04-2021") .withItemExpiryDate("04-04-2022") .withItemPrice("59") .withItemRemarks("ETA") @@ -659,7 +659,7 @@ public class ItemsToSort { "NC Q78 U71 B85 E56 P106 R134") .withItemQuantity("78") .withItemUnit("PBH") - .withItemBoughtDate("01-07-2022") + .withItemBoughtDate("01-07-2021") .withItemExpiryDate("28-05-2022") .withItemPrice("106") .withItemRemarks("YOB") @@ -667,7 +667,7 @@ public class ItemsToSort { public static final Item NC_Q79_U58_B103_E14_P52_R61 = new ItemBuilder().withItemName("NC Q79 U58 B103 E14 P52 R61") .withItemQuantity("79") .withItemUnit("LCN") - .withItemBoughtDate("19-07-2022") + .withItemBoughtDate("19-07-2021") .withItemExpiryDate("14-04-2022") .withItemPrice("52") .withItemRemarks("LJV") @@ -676,7 +676,7 @@ public class ItemsToSort { "NE Q80 U99 B16 E120 P142 R82") .withItemQuantity("80") .withItemUnit("TTC") - .withItemBoughtDate("16-04-2022") + .withItemBoughtDate("16-04-2021") .withItemExpiryDate("08-08-2022") .withItemPrice("142") .withItemRemarks("PMX") @@ -685,7 +685,7 @@ public class ItemsToSort { "NF Q81 U141 B122 E58 P29 R79") .withItemQuantity("81") .withItemUnit("ZML") - .withItemBoughtDate("10-08-2022") + .withItemBoughtDate("10-08-2021") .withItemExpiryDate("02-06-2022") .withItemPrice("29") .withItemRemarks("OLU") @@ -694,7 +694,7 @@ public class ItemsToSort { "NF Q82 U125 B34 E76 P129 R28") .withItemQuantity("82") .withItemUnit("XQW") - .withItemBoughtDate("06-05-2022") + .withItemBoughtDate("06-05-2021") .withItemExpiryDate("20-06-2022") .withItemPrice("129") .withItemRemarks("FFT") @@ -703,7 +703,7 @@ public class ItemsToSort { "NB Q83 U63 B33 E104 P130 R62") .withItemQuantity("83") .withItemUnit("MFD") - .withItemBoughtDate("05-05-2022") + .withItemBoughtDate("05-05-2021") .withItemExpiryDate("20-07-2022") .withItemPrice("130") .withItemRemarks("LKZ") @@ -711,7 +711,7 @@ public class ItemsToSort { public static final Item NH_Q84_U13_B52_E41_P72_R78 = new ItemBuilder().withItemName("NH Q84 U13 B52 E41 P72 R78") .withItemQuantity("84") .withItemUnit("BVP") - .withItemBoughtDate("24-05-2022") + .withItemBoughtDate("24-05-2021") .withItemExpiryDate("13-05-2022") .withItemPrice("72") .withItemRemarks("OFY") @@ -719,7 +719,7 @@ public class ItemsToSort { public static final Item NB_Q85_U144_B56_E11_P10_R40 = new ItemBuilder().withItemName("NB Q85 U144 B56 E11 P10 R40") .withItemQuantity("85") .withItemUnit("ZXV") - .withItemBoughtDate("28-05-2022") + .withItemBoughtDate("28-05-2021") .withItemExpiryDate("11-04-2022") .withItemPrice("10") .withItemRemarks("GVN") @@ -728,7 +728,7 @@ public class ItemsToSort { "NJ Q86 U52 B92 E112 P39 R124") .withItemQuantity("86") .withItemUnit("JRP") - .withItemBoughtDate("08-07-2022") + .withItemBoughtDate("08-07-2021") .withItemExpiryDate("28-07-2022") .withItemPrice("39") .withItemRemarks("WSN") @@ -737,7 +737,7 @@ public class ItemsToSort { "NJ Q87 U122 B90 E134 P21 R119") .withItemQuantity("87") .withItemUnit("XCH") - .withItemBoughtDate("06-07-2022") + .withItemBoughtDate("06-07-2021") .withItemExpiryDate("22-08-2022") .withItemPrice("21") .withItemRemarks("VSV") @@ -745,7 +745,7 @@ public class ItemsToSort { public static final Item NJ_Q88_U90_B143_E97_P5_R138 = new ItemBuilder().withItemName("NJ Q88 U90 B143 E97 P5 R138") .withItemQuantity("88") .withItemUnit("SKB") - .withItemBoughtDate("03-09-2022") + .withItemBoughtDate("03-09-2021") .withItemExpiryDate("13-07-2022") .withItemPrice("5") .withItemRemarks("ZDI") @@ -753,7 +753,7 @@ public class ItemsToSort { public static final Item ND_Q89_U7_B74_E37_P11_R101 = new ItemBuilder().withItemName("ND Q89 U7 B74 E37 P11 R101") .withItemQuantity("89") .withItemUnit("AYG") - .withItemBoughtDate("18-06-2022") + .withItemBoughtDate("18-06-2021") .withItemExpiryDate("09-05-2022") .withItemPrice("11") .withItemRemarks("TBK") @@ -761,7 +761,7 @@ public class ItemsToSort { public static final Item NI_Q90_U126_B108_E3_P38_R52 = new ItemBuilder().withItemName("NI Q90 U126 B108 E3 P38 R52") .withItemQuantity("90") .withItemUnit("XUF") - .withItemBoughtDate("24-07-2022") + .withItemBoughtDate("24-07-2021") .withItemExpiryDate("03-04-2022") .withItemPrice("38") .withItemRemarks("IXR") @@ -770,7 +770,7 @@ public class ItemsToSort { "NF Q91 U132 B11 E84 P107 R17") .withItemQuantity("91") .withItemUnit("YUE") - .withItemBoughtDate("11-04-2022") + .withItemBoughtDate("11-04-2021") .withItemExpiryDate("28-06-2022") .withItemPrice("107") .withItemRemarks("DDT") @@ -779,7 +779,7 @@ public class ItemsToSort { "NG Q92 U117 B54 E105 P75 R49") .withItemQuantity("92") .withItemUnit("WCL") - .withItemBoughtDate("26-05-2022") + .withItemBoughtDate("26-05-2021") .withItemExpiryDate("21-07-2022") .withItemPrice("75") .withItemRemarks("IOI") @@ -787,7 +787,7 @@ public class ItemsToSort { public static final Item NG_Q93_U121_B36_E17_P79_R90 = new ItemBuilder().withItemName("NG Q93 U121 B36 E17 P79 R90") .withItemQuantity("93") .withItemUnit("WVA") - .withItemBoughtDate("08-05-2022") + .withItemBoughtDate("08-05-2021") .withItemExpiryDate("17-04-2022") .withItemPrice("79") .withItemRemarks("RCU") @@ -795,7 +795,7 @@ public class ItemsToSort { public static final Item NE_Q94_U57_B39_E29_P34_R34 = new ItemBuilder().withItemName("NE Q94 U57 B39 E29 P34 R34") .withItemQuantity("94") .withItemUnit("LAK") - .withItemBoughtDate("11-05-2022") + .withItemBoughtDate("11-05-2021") .withItemExpiryDate("01-05-2022") .withItemPrice("34") .withItemRemarks("GBM") @@ -803,7 +803,7 @@ public class ItemsToSort { public static final Item NF_Q95_U97_B42_E74_P119_R13 = new ItemBuilder().withItemName("NF Q95 U97 B42 E74 P119 R13") .withItemQuantity("95") .withItemUnit("TOF") - .withItemBoughtDate("14-05-2022") + .withItemBoughtDate("14-05-2021") .withItemExpiryDate("18-06-2022") .withItemPrice("119") .withItemRemarks("BKU") @@ -811,7 +811,7 @@ public class ItemsToSort { public static final Item NC_Q96_U49_B107_E71_P47_R32 = new ItemBuilder().withItemName("NC Q96 U49 B107 E71 P47 R32") .withItemQuantity("96") .withItemUnit("IWL") - .withItemBoughtDate("23-07-2022") + .withItemBoughtDate("23-07-2021") .withItemExpiryDate("15-06-2022") .withItemPrice("47") .withItemRemarks("FXN") @@ -820,7 +820,7 @@ public class ItemsToSort { "NE Q97 U118 B142 E93 P131 R99") .withItemQuantity("97") .withItemUnit("WNM") - .withItemBoughtDate("02-09-2022") + .withItemBoughtDate("02-09-2021") .withItemExpiryDate("09-07-2022") .withItemPrice("131") .withItemRemarks("SVW") @@ -829,7 +829,7 @@ public class ItemsToSort { "NH Q98 U70 B129 E53 P54 R105") .withItemQuantity("98") .withItemUnit("OZT") - .withItemBoughtDate("17-08-2022") + .withItemBoughtDate("17-08-2021") .withItemExpiryDate("25-05-2022") .withItemPrice("54") .withItemRemarks("TQT") @@ -838,7 +838,7 @@ public class ItemsToSort { "NG Q99 U130 B8 E69 P139 R112") .withItemQuantity("99") .withItemUnit("YPF") - .withItemBoughtDate("08-04-2022") + .withItemBoughtDate("08-04-2021") .withItemExpiryDate("13-06-2022") .withItemPrice("139") .withItemRemarks("UNE") @@ -847,7 +847,7 @@ public class ItemsToSort { "NF Q100 U88 B45 E6 P109 R106") .withItemQuantity("100") .withItemUnit("RVI") - .withItemBoughtDate("17-05-2022") + .withItemBoughtDate("17-05-2021") .withItemExpiryDate("06-04-2022") .withItemPrice("109") .withItemRemarks("TQW") @@ -856,7 +856,7 @@ public class ItemsToSort { "NH Q101 U35 B68 E131 P74 R125") .withItemQuantity("101") .withItemUnit("GDT") - .withItemBoughtDate("12-06-2022") + .withItemBoughtDate("12-06-2021") .withItemExpiryDate("19-08-2022") .withItemPrice("74") .withItemRemarks("WWV") @@ -865,7 +865,7 @@ public class ItemsToSort { "NG Q102 U28 B139 E94 P102 R26") .withItemQuantity("102") .withItemUnit("FIS") - .withItemBoughtDate("27-08-2022") + .withItemBoughtDate("27-08-2021") .withItemExpiryDate("10-07-2022") .withItemPrice("102") .withItemRemarks("EWA") @@ -874,7 +874,7 @@ public class ItemsToSort { "NE Q103 U48 B99 E143 P140 R144") .withItemQuantity("103") .withItemUnit("IIP") - .withItemBoughtDate("15-07-2022") + .withItemBoughtDate("15-07-2021") .withItemExpiryDate("03-09-2022") .withItemPrice("140") .withItemRemarks("ZWA") @@ -883,7 +883,7 @@ public class ItemsToSort { "NC Q104 U119 B59 E63 P32 R57") .withItemQuantity("104") .withItemUnit("WQT") - .withItemBoughtDate("03-06-2022") + .withItemBoughtDate("03-06-2021") .withItemExpiryDate("07-06-2022") .withItemPrice("32") .withItemRemarks("KCX") @@ -892,7 +892,7 @@ public class ItemsToSort { "NL Q105 U116 B127 E83 P69 R65") .withItemQuantity("105") .withItemUnit("VZT") - .withItemBoughtDate("15-08-2022") + .withItemBoughtDate("15-08-2021") .withItemExpiryDate("27-06-2022") .withItemPrice("69") .withItemRemarks("LVF") @@ -900,7 +900,7 @@ public class ItemsToSort { public static final Item NB_Q106_U55_B66_E132_P9_R67 = new ItemBuilder().withItemName("NB Q106 U55 B66 E132 P9 R67") .withItemQuantity("106") .withItemUnit("KWF") - .withItemBoughtDate("10-06-2022") + .withItemBoughtDate("10-06-2021") .withItemExpiryDate("20-08-2022") .withItemPrice("9") .withItemRemarks("MBG") @@ -908,7 +908,7 @@ public class ItemsToSort { public static final Item NK_Q107_U76_B1_E127_P63_R35 = new ItemBuilder().withItemName("NK Q107 U76 B1 E127 P63 R35") .withItemQuantity("107") .withItemUnit("PPZ") - .withItemBoughtDate("01-04-2022") + .withItemBoughtDate("01-04-2021") .withItemExpiryDate("15-08-2022") .withItemPrice("63") .withItemRemarks("GBP") @@ -916,7 +916,7 @@ public class ItemsToSort { public static final Item NH_Q108_U33_B13_E43_P23_R70 = new ItemBuilder().withItemName("NH Q108 U33 B13 E43 P23 R70") .withItemQuantity("108") .withItemUnit("FVO") - .withItemBoughtDate("13-04-2022") + .withItemBoughtDate("13-04-2021") .withItemExpiryDate("15-05-2022") .withItemPrice("23") .withItemRemarks("MMY") @@ -924,7 +924,7 @@ public class ItemsToSort { public static final Item NG_Q109_U39_B71_E50_P64_R9 = new ItemBuilder().withItemName("NG Q109 U39 B71 E50 P64 R9") .withItemQuantity("109") .withItemUnit("GQK") - .withItemBoughtDate("15-06-2022") + .withItemBoughtDate("15-06-2021") .withItemExpiryDate("22-05-2022") .withItemPrice("64") .withItemRemarks("BDT") @@ -933,7 +933,7 @@ public class ItemsToSort { "NI Q110 U111 B135 E25 P6 R89") .withItemQuantity("110") .withItemUnit("VOB") - .withItemBoughtDate("23-08-2022") + .withItemBoughtDate("23-08-2021") .withItemExpiryDate("25-04-2022") .withItemPrice("6") .withItemRemarks("RBN") @@ -942,7 +942,7 @@ public class ItemsToSort { "NG Q111 U92 B75 E54 P33 R118") .withItemQuantity("111") .withItemUnit("SPR") - .withItemBoughtDate("19-06-2022") + .withItemBoughtDate("19-06-2021") .withItemExpiryDate("26-05-2022") .withItemPrice("33") .withItemRemarks("VON") @@ -951,7 +951,7 @@ public class ItemsToSort { "NC Q112 U41 B49 E139 P2 R141") .withItemQuantity("112") .withItemUnit("HDM") - .withItemBoughtDate("21-05-2022") + .withItemBoughtDate("21-05-2021") .withItemExpiryDate("27-08-2022") .withItemPrice("2") .withItemRemarks("ZIB") @@ -960,7 +960,7 @@ public class ItemsToSort { "NJ Q113 U21 B46 E119 P120 R53") .withItemQuantity("113") .withItemUnit("DRL") - .withItemBoughtDate("18-05-2022") + .withItemBoughtDate("18-05-2021") .withItemExpiryDate("07-08-2022") .withItemPrice("120") .withItemRemarks("IZV") @@ -969,7 +969,7 @@ public class ItemsToSort { "NH Q114 U46 B37 E121 P126 R110") .withItemQuantity("114") .withItemUnit("HWR") - .withItemBoughtDate("09-05-2022") + .withItemBoughtDate("09-05-2021") .withItemExpiryDate("09-08-2022") .withItemPrice("126") .withItemRemarks("UCE") @@ -978,7 +978,7 @@ public class ItemsToSort { "NL Q115 U102 B121 E115 P117 R42") .withItemQuantity("115") .withItemUnit("UIR") - .withItemBoughtDate("09-08-2022") + .withItemBoughtDate("09-08-2021") .withItemExpiryDate("03-08-2022") .withItemPrice("117") .withItemRemarks("HMU") @@ -987,7 +987,7 @@ public class ItemsToSort { "ND Q116 U86 B58 E10 P134 R27") .withItemQuantity("116") .withItemUnit("RMY") - .withItemBoughtDate("02-06-2022") + .withItemBoughtDate("02-06-2021") .withItemExpiryDate("10-04-2022") .withItemPrice("134") .withItemRemarks("EZE") @@ -996,7 +996,7 @@ public class ItemsToSort { "NL Q117 U129 B19 E79 P104 R126") .withItemQuantity("117") .withItemUnit("YEA") - .withItemBoughtDate("19-04-2022") + .withItemBoughtDate("19-04-2021") .withItemExpiryDate("23-06-2022") .withItemPrice("104") .withItemRemarks("XBR") @@ -1005,7 +1005,7 @@ public class ItemsToSort { "NJ Q118 U107 B115 E109 P18 R51") .withItemQuantity("118") .withItemUnit("VEA") - .withItemBoughtDate("03-08-2022") + .withItemBoughtDate("03-08-2021") .withItemExpiryDate("25-07-2022") .withItemPrice("18") .withItemRemarks("IWK") @@ -1014,7 +1014,7 @@ public class ItemsToSort { "NE Q119 U56 B138 E27 P113 R129") .withItemQuantity("119") .withItemUnit("KWY") - .withItemBoughtDate("26-08-2022") + .withItemBoughtDate("26-08-2021") .withItemExpiryDate("27-04-2022") .withItemPrice("113") .withItemRemarks("XXS") @@ -1023,7 +1023,7 @@ public class ItemsToSort { "NA Q120 U9 B125 E144 P89 R143") .withItemQuantity("120") .withItemUnit("BCN") - .withItemBoughtDate("13-08-2022") + .withItemBoughtDate("13-08-2021") .withItemExpiryDate("04-09-2022") .withItemPrice("89") .withItemRemarks("ZNJ") @@ -1031,7 +1031,7 @@ public class ItemsToSort { public static final Item ND_Q121_U26_B43_E36_P133_R2 = new ItemBuilder().withItemName("ND Q121 U26 B43 E36 P133 R2") .withItemQuantity("121") .withItemUnit("FBX") - .withItemBoughtDate("15-05-2022") + .withItemBoughtDate("15-05-2021") .withItemExpiryDate("08-05-2022") .withItemPrice("133") .withItemRemarks("ABE") @@ -1039,7 +1039,7 @@ public class ItemsToSort { public static final Item NE_Q122_U61_B38_E99_P56_R92 = new ItemBuilder().withItemName("NE Q122 U61 B38 E99 P56 R92") .withItemQuantity("122") .withItemUnit("LVJ") - .withItemBoughtDate("10-05-2022") + .withItemBoughtDate("10-05-2021") .withItemExpiryDate("15-07-2022") .withItemPrice("56") .withItemRemarks("RKP") @@ -1048,7 +1048,7 @@ public class ItemsToSort { "NJ Q124 U83 B78 E100 P73 R71") .withItemQuantity("124") .withItemUnit("RHE") - .withItemBoughtDate("22-06-2022") + .withItemBoughtDate("22-06-2021") .withItemExpiryDate("16-07-2022") .withItemPrice("73") .withItemRemarks("MNW") @@ -1057,7 +1057,7 @@ public class ItemsToSort { "NF Q123 U54 B73 E135 P91 R58") .withItemQuantity("123") .withItemUnit("KRV") - .withItemBoughtDate("17-06-2022") + .withItemBoughtDate("17-06-2021") .withItemExpiryDate("23-08-2022") .withItemPrice("91") .withItemRemarks("KQH") @@ -1066,7 +1066,7 @@ public class ItemsToSort { "ND Q125 U72 B100 E35 P138 R95") .withItemQuantity("125") .withItemUnit("PDO") - .withItemBoughtDate("16-07-2022") + .withItemBoughtDate("16-07-2021") .withItemExpiryDate("07-05-2022") .withItemPrice("138") .withItemRemarks("RVQ") @@ -1075,7 +1075,7 @@ public class ItemsToSort { "NI Q126 U106 B22 E51 P55 R120") .withItemQuantity("126") .withItemUnit("VDJ") - .withItemBoughtDate("22-04-2022") + .withItemBoughtDate("22-04-2021") .withItemExpiryDate("23-05-2022") .withItemPrice("55") .withItemRemarks("VYW") @@ -1084,7 +1084,7 @@ public class ItemsToSort { "NC Q127 U38 B18 E126 P90 R88") .withItemQuantity("127") .withItemUnit("GPN") - .withItemBoughtDate("18-04-2022") + .withItemBoughtDate("18-04-2021") .withItemExpiryDate("14-08-2022") .withItemPrice("90") .withItemRemarks("RAO") @@ -1093,7 +1093,7 @@ public class ItemsToSort { "ND Q128 U42 B124 E124 P84 R97") .withItemQuantity("128") .withItemUnit("HFL") - .withItemBoughtDate("12-08-2022") + .withItemBoughtDate("12-08-2021") .withItemExpiryDate("12-08-2022") .withItemPrice("84") .withItemRemarks("SLT") @@ -1101,7 +1101,7 @@ public class ItemsToSort { public static final Item NI_Q129_U8_B64_E137_P87_R41 = new ItemBuilder().withItemName("NI Q129 U8 B64 E137 P87 R41") .withItemQuantity("129") .withItemUnit("AYP") - .withItemBoughtDate("08-06-2022") + .withItemBoughtDate("08-06-2021") .withItemExpiryDate("25-08-2022") .withItemPrice("87") .withItemRemarks("HCR") @@ -1110,7 +1110,7 @@ public class ItemsToSort { "NA Q130 U12 B21 E108 P144 R115") .withItemQuantity("130") .withItemUnit("BVC") - .withItemBoughtDate("21-04-2022") + .withItemBoughtDate("21-04-2021") .withItemExpiryDate("24-07-2022") .withItemPrice("144") .withItemRemarks("UPZ") @@ -1118,7 +1118,7 @@ public class ItemsToSort { public static final Item ND_Q131_U25_B89_E30_P61_R75 = new ItemBuilder().withItemName("ND Q131 U25 B89 E30 P61 R75") .withItemQuantity("131") .withItemUnit("EMQ") - .withItemBoughtDate("05-07-2022") + .withItemBoughtDate("05-07-2021") .withItemExpiryDate("02-05-2022") .withItemPrice("61") .withItemRemarks("NNP") @@ -1126,7 +1126,7 @@ public class ItemsToSort { public static final Item NA_Q132_U115_B91_E9_P76_R33 = new ItemBuilder().withItemName("NA Q132 U115 B91 E9 P76 R33") .withItemQuantity("132") .withItemUnit("VXZ") - .withItemBoughtDate("07-07-2022") + .withItemBoughtDate("07-07-2021") .withItemExpiryDate("09-04-2022") .withItemPrice("76") .withItemRemarks("GAG") @@ -1135,7 +1135,7 @@ public class ItemsToSort { "NE Q133 U22 B144 E46 P25 R22") .withItemQuantity("133") .withItemUnit("DXK") - .withItemBoughtDate("04-09-2022") + .withItemBoughtDate("04-09-2021") .withItemExpiryDate("18-05-2022") .withItemPrice("25") .withItemRemarks("ELV") @@ -1144,7 +1144,7 @@ public class ItemsToSort { "NH Q134 U137 B67 E38 P40 R10") .withItemQuantity("134") .withItemUnit("ZAU") - .withItemBoughtDate("11-06-2022") + .withItemBoughtDate("11-06-2021") .withItemExpiryDate("10-05-2022") .withItemPrice("40") .withItemRemarks("BEU") @@ -1153,7 +1153,7 @@ public class ItemsToSort { "NL Q135 U103 B140 E12 P15 R73") .withItemQuantity("135") .withItemUnit("UNP") - .withItemBoughtDate("28-08-2022") + .withItemBoughtDate("28-08-2021") .withItemExpiryDate("12-04-2022") .withItemPrice("15") .withItemRemarks("MWC") @@ -1162,7 +1162,7 @@ public class ItemsToSort { "NI Q136 U66 B24 E125 P121 R11") .withItemQuantity("136") .withItemUnit("NTP") - .withItemBoughtDate("24-04-2022") + .withItemBoughtDate("24-04-2021") .withItemExpiryDate("13-08-2022") .withItemPrice("121") .withItemRemarks("BFO") @@ -1171,7 +1171,7 @@ public class ItemsToSort { "NA Q137 U138 B20 E142 P80 R16") .withItemQuantity("137") .withItemUnit("ZDQ") - .withItemBoughtDate("20-04-2022") + .withItemBoughtDate("20-04-2021") .withItemExpiryDate("02-09-2022") .withItemPrice("80") .withItemRemarks("CHR") @@ -1180,7 +1180,7 @@ public class ItemsToSort { "NG Q138 U109 B80 E67 P36 R121") .withItemQuantity("138") .withItemUnit("VMJ") - .withItemBoughtDate("24-06-2022") + .withItemBoughtDate("24-06-2021") .withItemExpiryDate("11-06-2022") .withItemPrice("36") .withItemRemarks("WHF") @@ -1188,7 +1188,7 @@ public class ItemsToSort { public static final Item NK_Q139_U3_B93_E26_P101_R45 = new ItemBuilder().withItemName("NK Q139 U3 B93 E26 P101 R45") .withItemQuantity("139") .withItemUnit("AMM") - .withItemBoughtDate("09-07-2022") + .withItemBoughtDate("09-07-2021") .withItemExpiryDate("26-04-2022") .withItemPrice("101") .withItemRemarks("HRI") @@ -1197,7 +1197,7 @@ public class ItemsToSort { "NB Q140 U95 B65 E106 P22 R83") .withItemQuantity("140") .withItemUnit("TJL") - .withItemBoughtDate("09-06-2022") + .withItemBoughtDate("09-06-2021") .withItemExpiryDate("22-07-2022") .withItemPrice("22") .withItemRemarks("PSE") @@ -1206,7 +1206,7 @@ public class ItemsToSort { "NE Q142 U142 B41 E68 P70 R38") .withItemQuantity("142") .withItemUnit("ZNJ") - .withItemBoughtDate("13-05-2022") + .withItemBoughtDate("13-05-2021") .withItemExpiryDate("12-06-2022") .withItemPrice("70") .withItemRemarks("GOK") @@ -1215,7 +1215,7 @@ public class ItemsToSort { "NB Q141 U134 B123 E33 P125 R69") .withItemQuantity("141") .withItemUnit("YXL") - .withItemBoughtDate("11-08-2022") + .withItemBoughtDate("11-08-2021") .withItemExpiryDate("05-05-2022") .withItemPrice("125") .withItemRemarks("MKO") @@ -1224,7 +1224,7 @@ public class ItemsToSort { "NH Q143 U78 B84 E136 P108 R102") .withItemQuantity("143") .withItemUnit("QER") - .withItemBoughtDate("28-06-2022") + .withItemBoughtDate("28-06-2021") .withItemExpiryDate("24-08-2022") .withItemPrice("108") .withItemRemarks("TDC") @@ -1233,7 +1233,7 @@ public class ItemsToSort { "NK Q144 U6 B105 E64 P51 R122") .withItemQuantity("144") .withItemUnit("AXP") - .withItemBoughtDate("21-07-2022") + .withItemBoughtDate("21-07-2021") .withItemExpiryDate("08-06-2022") .withItemPrice("51") .withItemRemarks("WMZ") From c0cb1c9f339f134ff86212e1cd606c9527dffe01 Mon Sep 17 00:00:00 2001 From: Tan Yi Xian <> Date: Tue, 1 Nov 2022 22:09:54 +0800 Subject: [PATCH 05/10] Modify ug to match bought date earlier than expiry date --- docs/_ug/commands/ItemCommands.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/_ug/commands/ItemCommands.md b/docs/_ug/commands/ItemCommands.md index 625d170109d..d04b82d81fb 100644 --- a/docs/_ug/commands/ItemCommands.md +++ b/docs/_ug/commands/ItemCommands.md @@ -11,15 +11,15 @@ Example of an [Item](#item): ```info * All fields apart from `ITEM_NAME` are optional. -* The `BOUGHT_DATE` ideally should not be after the `EXPIRY_DATE` but we will allow that. +* The `BOUGHT_DATE` should not be after the `EXPIRY_DATE`. * The format for `BOUGHT_DATE` and `EXPIRY_DATE` should follow: "dd-mm-yyyy". * dd: Day of the month. For example, "10" would represent the 10th day of the month. * mm: Month of the year, ranging from 1 to 12. This represents the months from January to December. For example, "01" would represent January. * yyyy: The current year. For example, "2019" would represent the year 2019. +* The value of `BOUGHT_DATE`, `EXPIRY_DATE` will be `Not Set` if it is not provided. * The default values for `QUANTITY` and `PRICE` is `0`. * The default values for `UNIT` is blank. -* The value of `BOUGHT_DATE`, `EXPIRY_DATE` will be `Not Set` if not provided. -* The value of `REMARKS` will be `-` if not provided. +* The value of `REMARKS` will be `-` if is it not provided. * `PRICE` do not require you to include the currency. Only include the value. * You cannot create an item with a tag immediately. * If two or more of the same parameters are provided, the last parameter will be taken. @@ -272,6 +272,7 @@ Tags: {vegetables} ```info * All fields are optional. However, you need to include at least one parameter. +* The `BOUGHT_DATE` should not be after the `EXPIRY_DATE`. * The format for `BOUGHT_DATE` and `EXPIRY_DATE` should follow: "dd-mm-yyyy". * dd: Day of the month. For example, "10" would represent the 10th day of the month. * mm: Month of the year, ranging from 1 to 12. This represents the months from January to December. For example, "01" would represent January. From 24a99f8131623d151fbf6f8b606456c44911c674 Mon Sep 17 00:00:00 2001 From: Tan Yi Xian <> Date: Tue, 1 Nov 2022 22:10:09 +0800 Subject: [PATCH 06/10] Rename getItemCost to getItemValue --- src/main/java/seedu/foodrem/views/ItemView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/seedu/foodrem/views/ItemView.java b/src/main/java/seedu/foodrem/views/ItemView.java index a9684c30d25..2005aa5101a 100644 --- a/src/main/java/seedu/foodrem/views/ItemView.java +++ b/src/main/java/seedu/foodrem/views/ItemView.java @@ -48,7 +48,7 @@ public static Node from(Item item) { final Label priceValue = new Label(item.getPrice().toString()); priceValue.getStyleClass().add("bold"); final Label costLabel = new Label("Total Cost: $"); - final Label costValue = new Label(String.format("%.2f", item.getItemCost())); + final Label costValue = new Label(String.format("%.2f", item.getItemValue())); costValue.getStyleClass().add("bold"); final Label remarks = new Label(item.getRemarks().toString().isBlank() ? "-" : item.getRemarks().toString()); From b9c1fd045a798997e268ff1f37ab6e3f1d0067a4 Mon Sep 17 00:00:00 2001 From: Tan Yi Xian <> Date: Tue, 1 Nov 2022 22:10:25 +0800 Subject: [PATCH 07/10] Rename ItemCostComparator to ItemValueComparator --- .../item/itemcomparators/ItemCostComparator.java | 13 ------------- .../item/itemcomparators/ItemValueComparator.java | 13 +++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 src/main/java/seedu/foodrem/model/item/itemcomparators/ItemCostComparator.java create mode 100644 src/main/java/seedu/foodrem/model/item/itemcomparators/ItemValueComparator.java diff --git a/src/main/java/seedu/foodrem/model/item/itemcomparators/ItemCostComparator.java b/src/main/java/seedu/foodrem/model/item/itemcomparators/ItemCostComparator.java deleted file mode 100644 index ba7bcae409e..00000000000 --- a/src/main/java/seedu/foodrem/model/item/itemcomparators/ItemCostComparator.java +++ /dev/null @@ -1,13 +0,0 @@ -package seedu.foodrem.model.item.itemcomparators; - -import seedu.foodrem.model.item.Item; - -/** - * Comparator comparing between ItemPrices - */ -public class ItemCostComparator implements ItemComparator { - @Override - public int compare(Item item1, Item item2) { - return Double.compare(item1.getItemCost(), item2.getItemCost()); - } -} diff --git a/src/main/java/seedu/foodrem/model/item/itemcomparators/ItemValueComparator.java b/src/main/java/seedu/foodrem/model/item/itemcomparators/ItemValueComparator.java new file mode 100644 index 00000000000..aae670b73e1 --- /dev/null +++ b/src/main/java/seedu/foodrem/model/item/itemcomparators/ItemValueComparator.java @@ -0,0 +1,13 @@ +package seedu.foodrem.model.item.itemcomparators; + +import seedu.foodrem.model.item.Item; + +/** + * Comparator comparing between ItemValues + */ +public class ItemValueComparator implements ItemComparator { + @Override + public int compare(Item item1, Item item2) { + return Double.compare(item1.getItemValue(), item2.getItemValue()); + } +} From 17b4a547aeb4ac74f07ef5e7f30f488006aec294 Mon Sep 17 00:00:00 2001 From: Tan Yi Xian <> Date: Tue, 1 Nov 2022 22:10:43 +0800 Subject: [PATCH 08/10] Modify validators to reference ItemDate --- .../model/item/itemvalidators/ItemBoughtDateValidator.java | 7 +++---- .../model/item/itemvalidators/ItemExpiryDateValidator.java | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/seedu/foodrem/model/item/itemvalidators/ItemBoughtDateValidator.java b/src/main/java/seedu/foodrem/model/item/itemvalidators/ItemBoughtDateValidator.java index e80360d8c69..7719546136b 100644 --- a/src/main/java/seedu/foodrem/model/item/itemvalidators/ItemBoughtDateValidator.java +++ b/src/main/java/seedu/foodrem/model/item/itemvalidators/ItemBoughtDateValidator.java @@ -1,12 +1,11 @@ package seedu.foodrem.model.item.itemvalidators; import static seedu.foodrem.commons.util.AppUtil.checkArgument; -import static seedu.foodrem.model.item.ItemBoughtDate.BOUGHT_DATE_FORMATTER; -import static seedu.foodrem.model.item.ItemBoughtDate.BOUGHT_DATE_PATTERN_REGEX; import java.time.LocalDate; import seedu.foodrem.commons.util.ValidationUtil; +import seedu.foodrem.model.item.ItemDate; /** * Validation class for item dates. @@ -34,11 +33,11 @@ public class ItemBoughtDateValidator implements Validator { */ public static Void validate(String dateString) { boolean isDateStringInRightFormat = dateString.matches("[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]"); - boolean isDateStringParsable = ValidationUtil.isParsableDateString(dateString, BOUGHT_DATE_PATTERN_REGEX); + boolean isDateStringParsable = ValidationUtil.isParsableDateString(dateString, ItemDate.DATE_PATTERN_REGEX); checkArgument(isDateStringInRightFormat, MESSAGE_FOR_BOUGHT_DATE_NOT_DDMMYYYY); checkArgument(isDateStringParsable, MESSAGE_FOR_BOUGHT_DATE_DO_NOT_EXIST); - LocalDate date = LocalDate.parse(dateString, BOUGHT_DATE_FORMATTER); + LocalDate date = LocalDate.parse(dateString, ItemDate.DATE_FORMATTER); boolean isYearLessThanEqualToMaxYear = date.getYear() <= MAX_YEAR; boolean isYearMoreThanEqualToMinYear = date.getYear() >= MIN_YEAR; diff --git a/src/main/java/seedu/foodrem/model/item/itemvalidators/ItemExpiryDateValidator.java b/src/main/java/seedu/foodrem/model/item/itemvalidators/ItemExpiryDateValidator.java index 4c96df7b760..b73b92f300d 100644 --- a/src/main/java/seedu/foodrem/model/item/itemvalidators/ItemExpiryDateValidator.java +++ b/src/main/java/seedu/foodrem/model/item/itemvalidators/ItemExpiryDateValidator.java @@ -1,12 +1,11 @@ package seedu.foodrem.model.item.itemvalidators; import static seedu.foodrem.commons.util.AppUtil.checkArgument; -import static seedu.foodrem.model.item.ItemExpiryDate.EXPIRY_DATE_FORMATTER; -import static seedu.foodrem.model.item.ItemExpiryDate.EXPIRY_DATE_PATTERN_REGEX; import java.time.LocalDate; import seedu.foodrem.commons.util.ValidationUtil; +import seedu.foodrem.model.item.ItemDate; /** * Validation class for item dates. @@ -35,11 +34,11 @@ public class ItemExpiryDateValidator implements Validator { public static Void validate(String dateString) { boolean isDateStringInRightFormat = dateString.matches("[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]"); - boolean isDateStringParsable = ValidationUtil.isParsableDateString(dateString, EXPIRY_DATE_PATTERN_REGEX); + boolean isDateStringParsable = ValidationUtil.isParsableDateString(dateString, ItemDate.DATE_PATTERN_REGEX); checkArgument(isDateStringInRightFormat, MESSAGE_FOR_EXPIRY_DATE_NOT_DDMMYYYY); checkArgument(isDateStringParsable, MESSAGE_FOR_EXPIRY_DATE_DO_NOT_EXIST); - LocalDate date = LocalDate.parse(dateString, EXPIRY_DATE_FORMATTER); + LocalDate date = LocalDate.parse(dateString, ItemDate.DATE_FORMATTER); boolean isYearMoreThanEqualToMinYear = date.getYear() >= MIN_YEAR; boolean isYearLessThanEqualToMaxYear = date.getYear() <= MAX_YEAR; From 54f76f8184607eca3afb41dc4269be216df8c751 Mon Sep 17 00:00:00 2001 From: Tan Yi Xian <> Date: Tue, 1 Nov 2022 22:10:55 +0800 Subject: [PATCH 09/10] Fix Stats Command --- .../commands/statscommands/StatsCommand.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/seedu/foodrem/logic/commands/statscommands/StatsCommand.java b/src/main/java/seedu/foodrem/logic/commands/statscommands/StatsCommand.java index e35aa3ab193..b9200b67d4d 100644 --- a/src/main/java/seedu/foodrem/logic/commands/statscommands/StatsCommand.java +++ b/src/main/java/seedu/foodrem/logic/commands/statscommands/StatsCommand.java @@ -3,8 +3,6 @@ import static java.util.Objects.requireNonNull; import static seedu.foodrem.commons.enums.CommandType.STATS_COMMAND; -import java.time.LocalDate; -import java.util.ArrayList; import java.util.Comparator; import java.util.HashMap; import java.util.List; @@ -16,7 +14,7 @@ import seedu.foodrem.logic.commands.CommandResult; import seedu.foodrem.model.Model; import seedu.foodrem.model.item.Item; -import seedu.foodrem.model.item.itemcomparators.ItemCostComparator; +import seedu.foodrem.model.item.itemcomparators.ItemValueComparator; import seedu.foodrem.model.tag.Tag; import seedu.foodrem.viewmodels.Stats; @@ -40,15 +38,18 @@ public static String getUsage() { } private List getTopThreeExpensiveItems(List itemList) { - final List copy = new ArrayList<>(itemList); - copy.sort(new ItemCostComparator().reversed()); - return copy.subList(0, 3); + return itemList.stream() + .sorted(new ItemValueComparator().reversed()) + .limit(3) + .collect(Collectors.toList()); } private double getAmountWasted(List itemList) { return itemList.stream() - .filter(i -> !i.getQuantity().isZero() && i.getExpiryDate().isAfterExpiryDate(LocalDate.now())) - .map(i -> i.getPrice().getItemPrice()).reduce(0.0, Double::sum); + .filter(Item::hasNonZeroQuantity) + .filter(Item::isExpired) + .map(Item::getItemValue) + .reduce(0.0, Double::sum); } private List getTopThreeCommonTags(List itemList, List tagList) { From de3de1959d44116cfcdb5e200c58f930a27076e6 Mon Sep 17 00:00:00 2001 From: Tan Yi Xian <> Date: Wed, 2 Nov 2022 17:04:58 +0800 Subject: [PATCH 10/10] Convert ItemDate to abstract. Implement hashcode in both dates. --- src/main/java/seedu/foodrem/model/item/Item.java | 2 +- .../java/seedu/foodrem/model/item/ItemBoughtDate.java | 8 ++++++++ src/main/java/seedu/foodrem/model/item/ItemDate.java | 2 +- .../java/seedu/foodrem/model/item/ItemExpiryDate.java | 8 ++++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/java/seedu/foodrem/model/item/Item.java b/src/main/java/seedu/foodrem/model/item/Item.java index 3b02a0530bc..c7a36766124 100644 --- a/src/main/java/seedu/foodrem/model/item/Item.java +++ b/src/main/java/seedu/foodrem/model/item/Item.java @@ -52,7 +52,7 @@ public Item(ItemName name, Set tagSet) { requireAllNonNull(name, quantity, unit, boughtDate, expiryDate, price, remarks, tagSet); - // Same date is accepted + // Same Bought date and Expiry date is accepted if (!boughtDate.isNotSet() && !expiryDate.isNotSet() && boughtDate.isAfterDate(expiryDate)) { throw new IllegalArgumentException("The item bought date should not be after the item expiry date."); } diff --git a/src/main/java/seedu/foodrem/model/item/ItemBoughtDate.java b/src/main/java/seedu/foodrem/model/item/ItemBoughtDate.java index 386ffe365c5..15f9ebe70e8 100644 --- a/src/main/java/seedu/foodrem/model/item/ItemBoughtDate.java +++ b/src/main/java/seedu/foodrem/model/item/ItemBoughtDate.java @@ -58,6 +58,14 @@ public boolean equals(Object other) { && getDate().equals(((ItemBoughtDate) other).getDate())); } + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + return super.hashCode(); + } + /** * {@inheritDoc} */ diff --git a/src/main/java/seedu/foodrem/model/item/ItemDate.java b/src/main/java/seedu/foodrem/model/item/ItemDate.java index 9c876460d19..10fdfc82bf4 100644 --- a/src/main/java/seedu/foodrem/model/item/ItemDate.java +++ b/src/main/java/seedu/foodrem/model/item/ItemDate.java @@ -7,7 +7,7 @@ * Represents an item date in an {@link Item}. * Guarantees: details are present and not null, immutable. */ -public class ItemDate { +public abstract class ItemDate { // Remember to change relevant messages displayed to users when changing the regex. public static final String DATE_PATTERN_REGEX = "dd-MM-uuuu"; public static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter diff --git a/src/main/java/seedu/foodrem/model/item/ItemExpiryDate.java b/src/main/java/seedu/foodrem/model/item/ItemExpiryDate.java index 09829479c14..8394be5f947 100644 --- a/src/main/java/seedu/foodrem/model/item/ItemExpiryDate.java +++ b/src/main/java/seedu/foodrem/model/item/ItemExpiryDate.java @@ -46,6 +46,14 @@ public boolean isNotSet() { return this == NOT_SET_EXPIRY_DATE; } + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + return super.hashCode(); + } + /** * Returns {@code true} if both {@link ItemExpiryDate} have the same date by * {@link LocalDate#equals(Object)}.