diff --git a/src/main/java/seedu/address/logic/commands/AddLeadCommand.java b/src/main/java/seedu/address/logic/commands/AddLeadCommand.java index 34f70fa6f40..355d682ca6f 100644 --- a/src/main/java/seedu/address/logic/commands/AddLeadCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddLeadCommand.java @@ -3,7 +3,7 @@ import static java.util.Objects.requireNonNull; import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS; import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL; -import static seedu.address.logic.parser.CliSyntax.PREFIX_KEYMILESTONE; +import static seedu.address.logic.parser.CliSyntax.PREFIX_KEY_MILESTONE; import static seedu.address.logic.parser.CliSyntax.PREFIX_MEETING_TIME; import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; @@ -28,6 +28,7 @@ public class AddLeadCommand extends Command { + PREFIX_PHONE + "PHONE " + PREFIX_EMAIL + "EMAIL " + PREFIX_ADDRESS + "ADDRESS " + + PREFIX_KEY_MILESTONE + "KEY_MILESTONE " + PREFIX_MEETING_TIME + "MEETING_TIME " + "[" + PREFIX_TAG + "TAG]...\n" + "Example: " + COMMAND_WORD + " " @@ -35,7 +36,7 @@ public class AddLeadCommand extends Command { + PREFIX_PHONE + "98765432 " + PREFIX_EMAIL + "johnd@example.com " + PREFIX_ADDRESS + "311, Clementi Ave 2, #02-25 " - + PREFIX_KEYMILESTONE + "2023-10-20 " + + PREFIX_KEY_MILESTONE + "01/12/2023 " + PREFIX_MEETING_TIME + "10/10/2023 14:30 " + PREFIX_TAG + "classmate"; diff --git a/src/main/java/seedu/address/logic/commands/EditLeadCommand.java b/src/main/java/seedu/address/logic/commands/EditLeadCommand.java index 331bbaaa318..850af8b3e17 100644 --- a/src/main/java/seedu/address/logic/commands/EditLeadCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditLeadCommand.java @@ -3,7 +3,7 @@ import static java.util.Objects.requireNonNull; import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS; import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL; -import static seedu.address.logic.parser.CliSyntax.PREFIX_KEYMILESTONE; +import static seedu.address.logic.parser.CliSyntax.PREFIX_KEY_MILESTONE; import static seedu.address.logic.parser.CliSyntax.PREFIX_MEETING_TIME; import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; @@ -43,8 +43,8 @@ public class EditLeadCommand extends EditCommand { + "[" + PREFIX_PHONE + "PHONE] " + "[" + PREFIX_EMAIL + "EMAIL] " + "[" + PREFIX_ADDRESS + "ADDRESS] " - + "[" + PREFIX_KEYMILESTONE + "KEY MILESTONE] " - + "[" + PREFIX_MEETING_TIME + "MEETING TIME] " + + "[" + PREFIX_KEY_MILESTONE + "KEY_MILESTONE] " + + "[" + PREFIX_MEETING_TIME + "MEETING_TIME] " + "[" + PREFIX_TAG + "TAG]...\n" + "Example: " + COMMAND_WORD + " 1 " + PREFIX_PHONE + "91234567 " diff --git a/src/main/java/seedu/address/logic/parser/AddLeadCommandParser.java b/src/main/java/seedu/address/logic/parser/AddLeadCommandParser.java index 76d0b2875d9..7006892e032 100644 --- a/src/main/java/seedu/address/logic/parser/AddLeadCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/AddLeadCommandParser.java @@ -3,7 +3,7 @@ import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT; import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS; import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL; -import static seedu.address.logic.parser.CliSyntax.PREFIX_KEYMILESTONE; +import static seedu.address.logic.parser.CliSyntax.PREFIX_KEY_MILESTONE; import static seedu.address.logic.parser.CliSyntax.PREFIX_MEETING_TIME; import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; @@ -37,21 +37,21 @@ public class AddLeadCommandParser implements Parser { public AddLeadCommand parse(String args) throws ParseException { ArgumentMultimap argMultimap = ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, - PREFIX_ADDRESS, PREFIX_KEYMILESTONE, PREFIX_MEETING_TIME, PREFIX_TAG); + PREFIX_ADDRESS, PREFIX_KEY_MILESTONE, PREFIX_MEETING_TIME, PREFIX_TAG); - if (!arePrefixesPresent(argMultimap, PREFIX_NAME, PREFIX_ADDRESS, PREFIX_PHONE, PREFIX_KEYMILESTONE, + if (!arePrefixesPresent(argMultimap, PREFIX_NAME, PREFIX_ADDRESS, PREFIX_PHONE, PREFIX_KEY_MILESTONE, PREFIX_EMAIL) || !argMultimap.getPreamble().isEmpty()) { throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddLeadCommand.MESSAGE_USAGE)); } argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS, - PREFIX_MEETING_TIME, PREFIX_KEYMILESTONE); + PREFIX_MEETING_TIME, PREFIX_KEY_MILESTONE); Name name = ParserUtil.parseName(argMultimap.getValue(PREFIX_NAME).get()); Phone phone = ParserUtil.parsePhone(argMultimap.getValue(PREFIX_PHONE).get()); Email email = ParserUtil.parseEmail(argMultimap.getValue(PREFIX_EMAIL).get()); Address address = ParserUtil.parseAddress(argMultimap.getValue(PREFIX_ADDRESS).get()); - KeyMilestone keyMilestone = ParserUtil.parseKeyMilestone(argMultimap.getValue(PREFIX_KEYMILESTONE).get()); + KeyMilestone keyMilestone = ParserUtil.parseKeyMilestone(argMultimap.getValue(PREFIX_KEY_MILESTONE).get()); Optional meetingTime = argMultimap.getValue(PREFIX_MEETING_TIME).isPresent() ? Optional.of(ParserUtil.parseMeetingTime(argMultimap.getValue(PREFIX_MEETING_TIME).get())) : Optional.empty(); diff --git a/src/main/java/seedu/address/logic/parser/CliSyntax.java b/src/main/java/seedu/address/logic/parser/CliSyntax.java index 95f57cb24fb..35e43589e6d 100644 --- a/src/main/java/seedu/address/logic/parser/CliSyntax.java +++ b/src/main/java/seedu/address/logic/parser/CliSyntax.java @@ -12,7 +12,7 @@ public class CliSyntax { public static final Prefix PREFIX_ADDRESS = new Prefix("a/"); public static final Prefix PREFIX_MEETING_TIME = new Prefix("m/"); public static final Prefix PREFIX_TAG = new Prefix("t/"); - public static final Prefix PREFIX_KEYMILESTONE = new Prefix("k/"); + public static final Prefix PREFIX_KEY_MILESTONE = new Prefix("k/"); public static final Prefix PREFIX_NAME_TP = new Prefix("--name"); public static final Prefix PREFIX_PHONE_TP = new Prefix("--phone"); diff --git a/src/main/java/seedu/address/logic/parser/EditCommandParser.java b/src/main/java/seedu/address/logic/parser/EditCommandParser.java index 5a09d714cde..6b8fec9125f 100644 --- a/src/main/java/seedu/address/logic/parser/EditCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/EditCommandParser.java @@ -4,7 +4,7 @@ import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT; import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS; import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL; -import static seedu.address.logic.parser.CliSyntax.PREFIX_KEYMILESTONE; +import static seedu.address.logic.parser.CliSyntax.PREFIX_KEY_MILESTONE; import static seedu.address.logic.parser.CliSyntax.PREFIX_MEETING_TIME; import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; @@ -38,7 +38,7 @@ public EditCommand parse(String args) throws ParseException { boolean isLead = false; ArgumentMultimap argMultimap = ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS, - PREFIX_KEYMILESTONE, PREFIX_MEETING_TIME, PREFIX_TAG); + PREFIX_KEY_MILESTONE, PREFIX_MEETING_TIME, PREFIX_TAG); Index index; @@ -48,14 +48,14 @@ public EditCommand parse(String args) throws ParseException { throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, EditCommand.MESSAGE_USAGE), pe); } - argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_KEYMILESTONE, + argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_KEY_MILESTONE, PREFIX_MEETING_TIME, PREFIX_ADDRESS); EditPersonDescriptor editPersonDescriptor = new EditPersonDescriptor(); EditLeadDescriptor editLeadDescriptor = new EditLeadDescriptor(); - if (argMultimap.getValue(PREFIX_KEYMILESTONE).isPresent()) { + if (argMultimap.getValue(PREFIX_KEY_MILESTONE).isPresent()) { isLead = true; editLeadDescriptor.setKeyMilestone(ParserUtil.parseKeyMilestone( - argMultimap.getValue(PREFIX_KEYMILESTONE).get())); + argMultimap.getValue(PREFIX_KEY_MILESTONE).get())); } if (argMultimap.getValue(PREFIX_NAME).isPresent()) { diff --git a/src/main/java/seedu/address/model/person/KeyMilestone.java b/src/main/java/seedu/address/model/person/KeyMilestone.java index f1d983119fe..2e688bdda2b 100644 --- a/src/main/java/seedu/address/model/person/KeyMilestone.java +++ b/src/main/java/seedu/address/model/person/KeyMilestone.java @@ -6,15 +6,22 @@ import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; +import java.time.format.ResolverStyle; /** * Represents a lead's key milestone in the address book. * Guarantees: immutable; is valid as declared in {@link #isValidKeyMilestone(String)} */ public class KeyMilestone { + public static final String DATE_FORMAT = "dd/MM/uuuu"; + + // Replace uuuu in format to yyyy to not confuse users public static final String MESSAGE_CONSTRAINTS = - "Key milestone is the date of Lead's milestone moment, should be in the format of yyyy-MM-dd"; + "Key milestone is the date of Lead's milestone moment, should be in the format of " + + DATE_FORMAT.replace("u", "y"); + public final String value; + /** * Constructs an {@code KeyMilestone}. * @@ -31,7 +38,10 @@ public KeyMilestone(String keyMilestone) { */ public static boolean isValidKeyMilestone(String test) { try { - LocalDate.parse(test, DateTimeFormatter.ofPattern("yyyy-MM-dd")); + LocalDate.parse(test, + DateTimeFormatter + .ofPattern(DATE_FORMAT) + .withResolverStyle(ResolverStyle.STRICT)); return true; } catch (DateTimeParseException e) { return false; diff --git a/src/main/java/seedu/address/model/person/MeetingTime.java b/src/main/java/seedu/address/model/person/MeetingTime.java index 4968418d281..5857861d9c6 100644 --- a/src/main/java/seedu/address/model/person/MeetingTime.java +++ b/src/main/java/seedu/address/model/person/MeetingTime.java @@ -11,7 +11,9 @@ */ public class MeetingTime { - public static final String MESSAGE_CONSTRAINTS = "Meeting time should be in the format of " + DATE_TIME_FORMAT; + // Replace uuuu in format to yyyy to not confuse users + public static final String MESSAGE_CONSTRAINTS = "Meeting time should be in the format of " + + DATE_TIME_FORMAT.replace("u", "y"); public final LocalDateTime value; diff --git a/src/main/java/seedu/address/model/person/MeetingTimeFormatter.java b/src/main/java/seedu/address/model/person/MeetingTimeFormatter.java index d297bff94c6..82c21d2fb53 100644 --- a/src/main/java/seedu/address/model/person/MeetingTimeFormatter.java +++ b/src/main/java/seedu/address/model/person/MeetingTimeFormatter.java @@ -3,15 +3,18 @@ import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; +import java.time.format.ResolverStyle; /** * Helper class for handling meeting time formatting and parsing. */ public class MeetingTimeFormatter { - public static final String DATE_TIME_FORMAT = "dd/MM/yyyy HH:mm"; + public static final String DATE_TIME_FORMAT = "dd/MM/uuuu HH:mm"; private static DateTimeFormatter getFormatter() { - return DateTimeFormatter.ofPattern(DATE_TIME_FORMAT); + return DateTimeFormatter + .ofPattern(DATE_TIME_FORMAT) + .withResolverStyle(ResolverStyle.STRICT); } public static LocalDateTime parse(String meetingTime) { diff --git a/src/main/java/seedu/address/model/util/SampleDataUtil.java b/src/main/java/seedu/address/model/util/SampleDataUtil.java index 869eeb11eff..539da85fb42 100644 --- a/src/main/java/seedu/address/model/util/SampleDataUtil.java +++ b/src/main/java/seedu/address/model/util/SampleDataUtil.java @@ -37,16 +37,16 @@ public static Person[] getSamplePersons() { getTagSet("neighbours")), new Lead(new Name("David Li"), new Phone("91031282"), new Email("lidavid@example.com"), new Address("Blk 436 Serangoon Gardens Street 26, #16-43"), - new KeyMilestone("2022-12-01"), Optional.of(new MeetingTime("10/10/2023 14:30")), + new KeyMilestone("01/12/2023"), Optional.of(new MeetingTime("10/10/2023 14:30")), getTagSet("family")), new Lead(new Name("Irfan Ibrahim"), new Phone("92492021"), new Email("irfan@example.com"), new Address("Blk 47 Tampines Street 20, #17-35"), - new KeyMilestone("2022-12-01"), + new KeyMilestone("01/12/2023"), Optional.of(new MeetingTime("10/10/2023 14:30")), getTagSet("classmates")), new Lead(new Name("Roy Balakrishnan"), new Phone("92624417"), new Email("royb@example.com"), new Address("Blk 45 Aljunied Street 85, #11-31"), - new KeyMilestone("2022-12-01"), Optional.of(new MeetingTime("10/10/2023 14:30")), + new KeyMilestone("01/12/2023"), Optional.of(new MeetingTime("10/10/2023 14:30")), getTagSet("colleagues")) }; } diff --git a/src/test/data/JsonSerializableAddressBookTest/duplicatePersonAddressBook.json b/src/test/data/JsonSerializableAddressBookTest/duplicatePersonAddressBook.json index 1e77b76a3cb..9986ce2153e 100644 --- a/src/test/data/JsonSerializableAddressBookTest/duplicatePersonAddressBook.json +++ b/src/test/data/JsonSerializableAddressBookTest/duplicatePersonAddressBook.json @@ -5,7 +5,7 @@ "email": "alice@example.com", "type": "lead", "address": "123, Jurong West Ave 6, #08-111", - "keyMilestone": "2022-12-01", + "keyMilestone": "01/12/2023", "meetingTime" : "25/10/2023 11:21", "tags": [ "Client", "friends" ] }, { @@ -14,7 +14,7 @@ "email": "pauline@example.com", "type": "lead", "address": "4th street", - "keyMilestone": "2022-12-01", + "keyMilestone": "01/12/2023", "meetingTime" : "25/10/2023 11:21", "tags": [ "Client" ] } ] diff --git a/src/test/data/JsonSerializableAddressBookTest/typicalPersonsAddressBook.json b/src/test/data/JsonSerializableAddressBookTest/typicalPersonsAddressBook.json index e0aa8570047..6d7ec18fb4e 100644 --- a/src/test/data/JsonSerializableAddressBookTest/typicalPersonsAddressBook.json +++ b/src/test/data/JsonSerializableAddressBookTest/typicalPersonsAddressBook.json @@ -41,7 +41,7 @@ "phone" : "9482224", "email" : "werner@example.com", "type": "lead", - "keyMilestone": "2022-12-01", + "keyMilestone": "01/12/2023", "address" : "michegan ave", "meetingTime" : null, "tags" : [] @@ -50,7 +50,7 @@ "phone" : "9482427", "email" : "lydia@example.com", "type": "lead", - "keyMilestone": "2022-12-01", + "keyMilestone": "01/12/2023", "address" : "little tokyo", "meetingTime" : null, "tags" : [] @@ -59,7 +59,7 @@ "phone" : "9482442", "email" : "anna@example.com", "type": "lead", - "keyMilestone": "2022-12-01", + "keyMilestone": "01/12/2023", "address" : "4th street", "meetingTime" : null, "tags" : [] diff --git a/src/test/java/seedu/address/logic/commands/CommandTestUtil.java b/src/test/java/seedu/address/logic/commands/CommandTestUtil.java index 6b98314f2ad..b8dd3821c3c 100644 --- a/src/test/java/seedu/address/logic/commands/CommandTestUtil.java +++ b/src/test/java/seedu/address/logic/commands/CommandTestUtil.java @@ -4,7 +4,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS; import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL; -import static seedu.address.logic.parser.CliSyntax.PREFIX_KEYMILESTONE; +import static seedu.address.logic.parser.CliSyntax.PREFIX_KEY_MILESTONE; import static seedu.address.logic.parser.CliSyntax.PREFIX_MEETING_TIME; import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; @@ -40,8 +40,8 @@ public class CommandTestUtil { public static final String VALID_MEETING_TIME_BOB = "16/12/2023 11:00"; public static final String VALID_TAG_HUSBAND = "husband"; - public static final String VALID_KEYMILESTONE_AMY = "2022-12-01"; - public static final String VALID_KEYMILESTONE_BOB = "2022-12-01"; + public static final String VALID_KEY_MILESTONE_AMY = "01/12/2023"; + public static final String VALID_KEY_MILESTONE_BOB = "01/12/2023"; public static final String VALID_TAG_FRIEND = "friend"; public static final String NAME_DESC_AMY = " " + PREFIX_NAME + VALID_NAME_AMY; @@ -52,7 +52,7 @@ public class CommandTestUtil { public static final String EMAIL_DESC_BOB = " " + PREFIX_EMAIL + VALID_EMAIL_BOB; public static final String ADDRESS_DESC_AMY = " " + PREFIX_ADDRESS + VALID_ADDRESS_AMY; public static final String ADDRESS_DESC_BOB = " " + PREFIX_ADDRESS + VALID_ADDRESS_BOB; - public static final String KEYMILESTONE_DESC_BOB = " " + PREFIX_KEYMILESTONE + VALID_KEYMILESTONE_BOB; + public static final String KEY_MILESTONE_DESC_BOB = " " + PREFIX_KEY_MILESTONE + VALID_KEY_MILESTONE_BOB; public static final String MEETING_TIME_DESC_AMY = " " + PREFIX_MEETING_TIME + VALID_MEETING_TIME_AMY; public static final String MEETING_TIME_DESC_BOB = " " + PREFIX_MEETING_TIME + VALID_MEETING_TIME_BOB; public static final String TAG_DESC_FRIEND = " " + PREFIX_TAG + VALID_TAG_FRIEND; diff --git a/src/test/java/seedu/address/logic/commands/EditCommandTest.java b/src/test/java/seedu/address/logic/commands/EditCommandTest.java index 0482ddd1da7..921c8426e39 100644 --- a/src/test/java/seedu/address/logic/commands/EditCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/EditCommandTest.java @@ -56,7 +56,7 @@ public void execute_someFieldsSpecifiedUnfilteredList_success() { PersonBuilder personInList = new PersonBuilder(lastPerson); Person editedPerson = personInList.withName(VALID_NAME_BOB).withPhone(VALID_PHONE_BOB) - .withTags(VALID_TAG_HUSBAND).withKeyMilestone("2022-12-01").buildLead(); + .withTags(VALID_TAG_HUSBAND).withKeyMilestone("01/12/2023").buildLead(); EditPersonDescriptor descriptor = new EditPersonDescriptorBuilder().withName(VALID_NAME_BOB) .withPhone(VALID_PHONE_BOB).withTags(VALID_TAG_HUSBAND).build(); diff --git a/src/test/java/seedu/address/logic/commands/EditLeadCommandTest.java b/src/test/java/seedu/address/logic/commands/EditLeadCommandTest.java index 45ad251437b..19911f73f63 100644 --- a/src/test/java/seedu/address/logic/commands/EditLeadCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/EditLeadCommandTest.java @@ -6,7 +6,7 @@ import static seedu.address.logic.commands.CommandTestUtil.DESC_BOB; import static seedu.address.logic.commands.CommandTestUtil.VALID_ADDRESS_AMY; import static seedu.address.logic.commands.CommandTestUtil.VALID_EMAIL_AMY; -import static seedu.address.logic.commands.CommandTestUtil.VALID_KEYMILESTONE_BOB; +import static seedu.address.logic.commands.CommandTestUtil.VALID_KEY_MILESTONE_BOB; import static seedu.address.logic.commands.CommandTestUtil.VALID_NAME_AMY; import static seedu.address.logic.commands.CommandTestUtil.VALID_NAME_BOB; import static seedu.address.logic.commands.CommandTestUtil.VALID_PHONE_AMY; @@ -60,10 +60,10 @@ public void execute_someFieldsSpecifiedUnfilteredList_success() { PersonBuilder personInList = new PersonBuilder(lastPerson); Lead editedPerson = personInList.withName(VALID_NAME_BOB).withPhone(VALID_PHONE_BOB) - .withTags(VALID_TAG_HUSBAND).withKeyMilestone(VALID_KEYMILESTONE_BOB).buildLead(); + .withTags(VALID_TAG_HUSBAND).withKeyMilestone(VALID_KEY_MILESTONE_BOB).buildLead(); EditLeadDescriptor descriptor = new EditLeadDescriptorBuilder().withName(VALID_NAME_BOB) - .withPhone(VALID_PHONE_BOB).withTags(VALID_TAG_HUSBAND).withKeyMilestone(VALID_KEYMILESTONE_BOB) + .withPhone(VALID_PHONE_BOB).withTags(VALID_TAG_HUSBAND).withKeyMilestone(VALID_KEY_MILESTONE_BOB) .build(); EditLeadCommand editCommand = new EditLeadCommand(indexLastPerson, descriptor); @@ -98,7 +98,7 @@ public void execute_filteredList_success() { Lead editedLead = new PersonBuilder(personInFilteredList).withName(VALID_NAME_BOB).buildLead(); EditLeadCommand editCommand = new EditLeadCommand(INDEX_FIRST_PERSON, new EditLeadDescriptorBuilder().withName(VALID_NAME_BOB) - .withKeyMilestone(VALID_KEYMILESTONE_BOB).build()); + .withKeyMilestone(VALID_KEY_MILESTONE_BOB).build()); String expectedMessage = String.format(EditCommand.MESSAGE_EDIT_LEAD_SUCCESS, Messages.format(editedLead)); diff --git a/src/test/java/seedu/address/logic/parser/AddLeadCommandParserTest.java b/src/test/java/seedu/address/logic/parser/AddLeadCommandParserTest.java index 70d5f99176f..b9973198a9d 100644 --- a/src/test/java/seedu/address/logic/parser/AddLeadCommandParserTest.java +++ b/src/test/java/seedu/address/logic/parser/AddLeadCommandParserTest.java @@ -10,7 +10,7 @@ import static seedu.address.logic.commands.CommandTestUtil.INVALID_NAME_DESC; import static seedu.address.logic.commands.CommandTestUtil.INVALID_PHONE_DESC; import static seedu.address.logic.commands.CommandTestUtil.INVALID_TAG_DESC; -import static seedu.address.logic.commands.CommandTestUtil.KEYMILESTONE_DESC_BOB; +import static seedu.address.logic.commands.CommandTestUtil.KEY_MILESTONE_DESC_BOB; import static seedu.address.logic.commands.CommandTestUtil.MEETING_TIME_DESC_AMY; import static seedu.address.logic.commands.CommandTestUtil.MEETING_TIME_DESC_BOB; import static seedu.address.logic.commands.CommandTestUtil.NAME_DESC_AMY; @@ -23,14 +23,14 @@ import static seedu.address.logic.commands.CommandTestUtil.TAG_DESC_HUSBAND; import static seedu.address.logic.commands.CommandTestUtil.VALID_ADDRESS_BOB; import static seedu.address.logic.commands.CommandTestUtil.VALID_EMAIL_BOB; -import static seedu.address.logic.commands.CommandTestUtil.VALID_KEYMILESTONE_BOB; +import static seedu.address.logic.commands.CommandTestUtil.VALID_KEY_MILESTONE_BOB; import static seedu.address.logic.commands.CommandTestUtil.VALID_NAME_BOB; import static seedu.address.logic.commands.CommandTestUtil.VALID_PHONE_BOB; import static seedu.address.logic.commands.CommandTestUtil.VALID_TAG_FRIEND; import static seedu.address.logic.commands.CommandTestUtil.VALID_TAG_HUSBAND; import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS; import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL; -import static seedu.address.logic.parser.CliSyntax.PREFIX_KEYMILESTONE; +import static seedu.address.logic.parser.CliSyntax.PREFIX_KEY_MILESTONE; import static seedu.address.logic.parser.CliSyntax.PREFIX_MEETING_TIME; import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; @@ -57,12 +57,12 @@ public class AddLeadCommandParserTest { @Test public void parse_allFieldsPresent_success() { Lead expectedLead = new PersonBuilder(BOB).withTags(VALID_TAG_FRIEND) - .withKeyMilestone(VALID_KEYMILESTONE_BOB).buildLead(); + .withKeyMilestone(VALID_KEY_MILESTONE_BOB).buildLead(); // whitespace only preamble assertParseSuccess(parser, PREAMBLE_WHITESPACE + NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB + MEETING_TIME_DESC_BOB + TAG_DESC_FRIEND - + KEYMILESTONE_DESC_BOB, new AddLeadCommand(expectedLead)); + + KEY_MILESTONE_DESC_BOB, new AddLeadCommand(expectedLead)); // multiple tags - all accepted @@ -70,14 +70,14 @@ public void parse_allFieldsPresent_success() { .buildLead(); assertParseSuccess(parser, NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB - + MEETING_TIME_DESC_BOB + KEYMILESTONE_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, + + MEETING_TIME_DESC_BOB + KEY_MILESTONE_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, new AddLeadCommand(expectedLeadMultipleTags)); } @Test public void parseLead_repeatedNonTagValue_failure() { //todo: need another test for clients in future String validExpectedPersonString = NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB - + ADDRESS_DESC_BOB + KEYMILESTONE_DESC_BOB + MEETING_TIME_DESC_BOB + TAG_DESC_FRIEND; + + ADDRESS_DESC_BOB + KEY_MILESTONE_DESC_BOB + MEETING_TIME_DESC_BOB + TAG_DESC_FRIEND; // multiple names assertParseFailure(parser, NAME_DESC_AMY + validExpectedPersonString, @@ -98,9 +98,9 @@ public void parseLead_repeatedNonTagValue_failure() { // multiple fields repeated assertParseFailure(parser, validExpectedPersonString + PHONE_DESC_AMY + EMAIL_DESC_AMY - + NAME_DESC_AMY + ADDRESS_DESC_AMY + KEYMILESTONE_DESC_BOB + MEETING_TIME_DESC_BOB + + NAME_DESC_AMY + ADDRESS_DESC_AMY + KEY_MILESTONE_DESC_BOB + MEETING_TIME_DESC_BOB + validExpectedPersonString, - Messages.getErrorMessageForDuplicatePrefixes(PREFIX_NAME, PREFIX_ADDRESS, PREFIX_KEYMILESTONE, + Messages.getErrorMessageForDuplicatePrefixes(PREFIX_NAME, PREFIX_ADDRESS, PREFIX_KEY_MILESTONE, PREFIX_MEETING_TIME, PREFIX_EMAIL, PREFIX_PHONE)); // invalid value followed by valid value @@ -143,15 +143,15 @@ public void parseLead_repeatedNonTagValue_failure() { @Test public void parse_optionalFieldsMissing_success() { // zero tags - Lead expectedLead = new PersonBuilder(AMY).withTags().withKeyMilestone(VALID_KEYMILESTONE_BOB).buildLead(); + Lead expectedLead = new PersonBuilder(AMY).withTags().withKeyMilestone(VALID_KEY_MILESTONE_BOB).buildLead(); assertParseSuccess(parser, NAME_DESC_AMY + PHONE_DESC_AMY + EMAIL_DESC_AMY - + ADDRESS_DESC_AMY + KEYMILESTONE_DESC_BOB + + ADDRESS_DESC_AMY + KEY_MILESTONE_DESC_BOB + MEETING_TIME_DESC_AMY, new AddLeadCommand(expectedLead)); // no meeting time Lead expectedLead2 = new PersonBuilder(BOB).withMeetingTime(null).buildLead(); assertParseSuccess(parser, NAME_DESC_BOB + PHONE_DESC_BOB - + EMAIL_DESC_BOB + ADDRESS_DESC_BOB + KEYMILESTONE_DESC_BOB + + EMAIL_DESC_BOB + ADDRESS_DESC_BOB + KEY_MILESTONE_DESC_BOB + TAG_DESC_FRIEND + TAG_DESC_HUSBAND, new AddLeadCommand(expectedLead2)); } @@ -185,37 +185,37 @@ public void parse_compulsoryFieldMissing_failure() { public void parse_invalidValue_failure() { // invalid name assertParseFailure(parser, INVALID_NAME_DESC + PHONE_DESC_BOB + EMAIL_DESC_BOB - + ADDRESS_DESC_BOB + KEYMILESTONE_DESC_BOB + MEETING_TIME_DESC_BOB + + ADDRESS_DESC_BOB + KEY_MILESTONE_DESC_BOB + MEETING_TIME_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Name.MESSAGE_CONSTRAINTS); // invalid phone assertParseFailure(parser, NAME_DESC_BOB + INVALID_PHONE_DESC + EMAIL_DESC_BOB - + ADDRESS_DESC_BOB + KEYMILESTONE_DESC_BOB + MEETING_TIME_DESC_BOB + + ADDRESS_DESC_BOB + KEY_MILESTONE_DESC_BOB + MEETING_TIME_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Phone.MESSAGE_CONSTRAINTS); // invalid email assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + INVALID_EMAIL_DESC - + ADDRESS_DESC_BOB + KEYMILESTONE_DESC_BOB + MEETING_TIME_DESC_BOB + + ADDRESS_DESC_BOB + KEY_MILESTONE_DESC_BOB + MEETING_TIME_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Email.MESSAGE_CONSTRAINTS); // invalid address assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB - + INVALID_ADDRESS_DESC + KEYMILESTONE_DESC_BOB + MEETING_TIME_DESC_BOB + + INVALID_ADDRESS_DESC + KEY_MILESTONE_DESC_BOB + MEETING_TIME_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Address.MESSAGE_CONSTRAINTS); // invalid tag assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB - + ADDRESS_DESC_BOB + KEYMILESTONE_DESC_BOB + MEETING_TIME_DESC_BOB + + ADDRESS_DESC_BOB + KEY_MILESTONE_DESC_BOB + MEETING_TIME_DESC_BOB + INVALID_TAG_DESC + VALID_TAG_FRIEND, Tag.MESSAGE_CONSTRAINTS); // two invalid values, only first invalid value reported assertParseFailure(parser, INVALID_NAME_DESC + PHONE_DESC_BOB + EMAIL_DESC_BOB - + INVALID_ADDRESS_DESC + KEYMILESTONE_DESC_BOB + MEETING_TIME_DESC_BOB, + + INVALID_ADDRESS_DESC + KEY_MILESTONE_DESC_BOB + MEETING_TIME_DESC_BOB, Name.MESSAGE_CONSTRAINTS); // non-empty preamble assertParseFailure(parser, PREAMBLE_NON_EMPTY + NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB - + ADDRESS_DESC_BOB + KEYMILESTONE_DESC_BOB + MEETING_TIME_DESC_BOB + TAG_DESC_HUSBAND + + ADDRESS_DESC_BOB + KEY_MILESTONE_DESC_BOB + MEETING_TIME_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddLeadCommand.MESSAGE_USAGE)); } diff --git a/src/test/java/seedu/address/logic/parser/AddressBookParserTest.java b/src/test/java/seedu/address/logic/parser/AddressBookParserTest.java index 906b023063c..ca36dc729dd 100644 --- a/src/test/java/seedu/address/logic/parser/AddressBookParserTest.java +++ b/src/test/java/seedu/address/logic/parser/AddressBookParserTest.java @@ -56,7 +56,7 @@ public void parseCommand_addClient() throws Exception { @Test public void parseCommand_addLead() throws Exception { - Lead lead = new PersonBuilder(ELLE).withKeyMilestone("2022-12-01").buildLead(); + Lead lead = new PersonBuilder(ELLE).withKeyMilestone("01/12/2023").buildLead(); AddLeadCommand command = (AddLeadCommand) parser.parseCommand(LeadUtil.getAddLeadCommand(lead)); assertEquals(new AddLeadCommand(lead), command); } diff --git a/src/test/java/seedu/address/model/person/KeyMilestoneTest.java b/src/test/java/seedu/address/model/person/KeyMilestoneTest.java index 5bb4b966eaf..d1856703f6f 100644 --- a/src/test/java/seedu/address/model/person/KeyMilestoneTest.java +++ b/src/test/java/seedu/address/model/person/KeyMilestoneTest.java @@ -10,21 +10,23 @@ class KeyMilestoneTest { @Test void isValidKeyMilestone() { - //todo: fix needed for local date time assertFalse(KeyMilestone.isValidKeyMilestone("01-01-2022")); - assertFalse(KeyMilestone.isValidKeyMilestone("01/01/2022")); assertFalse(KeyMilestone.isValidKeyMilestone("01.01.2022")); - //assertFalse(KeyMilestone.isValidKeyMilestone("2022-02-31")); - assertTrue(KeyMilestone.isValidKeyMilestone("2022-01-29")); - assertTrue(KeyMilestone.isValidKeyMilestone("2022-03-31")); + assertFalse(KeyMilestone.isValidKeyMilestone("2022-02-31")); + assertFalse(KeyMilestone.isValidKeyMilestone("2022-01-29")); + assertFalse(KeyMilestone.isValidKeyMilestone("2022-03-31")); + assertFalse(KeyMilestone.isValidKeyMilestone("31/02/2022")); + + assertTrue(KeyMilestone.isValidKeyMilestone("01/01/2022")); + assertTrue(KeyMilestone.isValidKeyMilestone("31/03/2022")); } @Test void equals() { - KeyMilestone keyMilestone = new KeyMilestone("2022-12-01"); + KeyMilestone keyMilestone = new KeyMilestone("01/12/2023"); // same values -> returns true - assertTrue(keyMilestone.equals(new KeyMilestone("2022-12-01"))); + assertTrue(keyMilestone.equals(new KeyMilestone("01/12/2023"))); // same object -> returns true assertTrue(keyMilestone.equals(keyMilestone)); @@ -36,12 +38,12 @@ void equals() { assertFalse(keyMilestone.equals(5.0f)); // different values -> returns false - assertFalse(keyMilestone.equals(new KeyMilestone("2022-01-01"))); + assertFalse(keyMilestone.equals(new KeyMilestone("01/01/2023"))); } @Test - void hashCode_equal() { - assertEquals(new KeyMilestone("2022-12-01").hashCode(), - new KeyMilestone("2022-12-01").hashCode()); + void hashCode_equals() { + assertEquals(new KeyMilestone("01/12/2023").hashCode(), + new KeyMilestone("01/12/2023").hashCode()); } } diff --git a/src/test/java/seedu/address/model/person/MeetingTimeTest.java b/src/test/java/seedu/address/model/person/MeetingTimeTest.java index 7a074cbd457..0e4598ce4aa 100644 --- a/src/test/java/seedu/address/model/person/MeetingTimeTest.java +++ b/src/test/java/seedu/address/model/person/MeetingTimeTest.java @@ -1,5 +1,6 @@ package seedu.address.model.person; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static seedu.address.testutil.Assert.assertThrows; @@ -58,4 +59,10 @@ public void equals() { // different values -> returns false assertFalse(meetingTime.equals(new MeetingTime("12/10/2025 10:20"))); } + + @Test + void hashCode_equals() { + assertEquals(new MeetingTime("12/10/2025 10:20").hashCode(), + new MeetingTime("12/10/2025 10:20").hashCode()); + } } diff --git a/src/test/java/seedu/address/testutil/LeadUtil.java b/src/test/java/seedu/address/testutil/LeadUtil.java index f0da1db508b..8a44dacf9b1 100644 --- a/src/test/java/seedu/address/testutil/LeadUtil.java +++ b/src/test/java/seedu/address/testutil/LeadUtil.java @@ -2,7 +2,7 @@ import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS; import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL; -import static seedu.address.logic.parser.CliSyntax.PREFIX_KEYMILESTONE; +import static seedu.address.logic.parser.CliSyntax.PREFIX_KEY_MILESTONE; import static seedu.address.logic.parser.CliSyntax.PREFIX_MEETING_TIME; import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; @@ -32,7 +32,7 @@ public static String getLeadDetails(Lead lead) { sb.append(PREFIX_PHONE + lead.getPhone().value + " "); sb.append(PREFIX_EMAIL + lead.getEmail().value + " "); sb.append(PREFIX_ADDRESS + lead.getAddress().value + " "); - sb.append(PREFIX_KEYMILESTONE + lead.getKeyMilestone().value + " "); + sb.append(PREFIX_KEY_MILESTONE + lead.getKeyMilestone().value + " "); lead.getMeetingTime().ifPresent(meetingTime -> sb.append(PREFIX_MEETING_TIME + meetingTime.toString() + " ")); diff --git a/src/test/java/seedu/address/testutil/PersonBuilder.java b/src/test/java/seedu/address/testutil/PersonBuilder.java index e92018f665a..ddd34779e66 100644 --- a/src/test/java/seedu/address/testutil/PersonBuilder.java +++ b/src/test/java/seedu/address/testutil/PersonBuilder.java @@ -25,7 +25,7 @@ public class PersonBuilder { public static final String DEFAULT_PHONE = "85355255"; public static final String DEFAULT_EMAIL = "amy@gmail.com"; public static final String DEFAULT_ADDRESS = "123, Jurong West Ave 6, #08-111"; - public static final String DEFAULT_KEYMILESTONE = "2022-12-01"; + public static final String DEFAULT_KEY_MILESTONE = "01/12/2023"; public static final String DEFAULT_MEETING_TIME = "10/10/2023 14:30"; private Name name; @@ -45,7 +45,7 @@ public PersonBuilder() { email = new Email(DEFAULT_EMAIL); address = new Address(DEFAULT_ADDRESS); meetingTime = Optional.empty(); - keyMilestone = new KeyMilestone(DEFAULT_KEYMILESTONE); + keyMilestone = new KeyMilestone(DEFAULT_KEY_MILESTONE); tags = new HashSet<>(); } diff --git a/src/test/java/seedu/address/testutil/TypicalLeads.java b/src/test/java/seedu/address/testutil/TypicalLeads.java index 74dd0f92b23..2bc3f1f76bd 100644 --- a/src/test/java/seedu/address/testutil/TypicalLeads.java +++ b/src/test/java/seedu/address/testutil/TypicalLeads.java @@ -4,8 +4,8 @@ import static seedu.address.logic.commands.CommandTestUtil.VALID_ADDRESS_BOB; import static seedu.address.logic.commands.CommandTestUtil.VALID_EMAIL_AMY; import static seedu.address.logic.commands.CommandTestUtil.VALID_EMAIL_BOB; -import static seedu.address.logic.commands.CommandTestUtil.VALID_KEYMILESTONE_AMY; -import static seedu.address.logic.commands.CommandTestUtil.VALID_KEYMILESTONE_BOB; +import static seedu.address.logic.commands.CommandTestUtil.VALID_KEY_MILESTONE_AMY; +import static seedu.address.logic.commands.CommandTestUtil.VALID_KEY_MILESTONE_BOB; import static seedu.address.logic.commands.CommandTestUtil.VALID_MEETING_TIME_AMY; import static seedu.address.logic.commands.CommandTestUtil.VALID_MEETING_TIME_BOB; import static seedu.address.logic.commands.CommandTestUtil.VALID_NAME_AMY; @@ -31,58 +31,58 @@ public class TypicalLeads { .withAddress("123, Jurong West Ave 6, #08-111") .withEmail("alice@example.com") .withPhone("94351253") - .withKeyMilestone("2022-12-01") + .withKeyMilestone("01/12/2023") .withMeetingTime("24/10/2023 12:30") .withTags("friends") .buildLead(); public static final Lead BENSON = new PersonBuilder().withName("Benson Meier") .withAddress("311, Clementi Ave 2, #02-25") .withEmail("johnd@example.com").withPhone("98765432") - .withKeyMilestone("2022-12-01") + .withKeyMilestone("01/12/2023") .withTags("owesMoney", "friends") .withMeetingTime("24/10/2023 12:30") .buildLead(); public static final Lead CARL = new PersonBuilder().withName("Carl Kurz").withPhone("95352563") .withEmail("heinz@example.com") .withAddress("wall street") - .withKeyMilestone("2022-12-01") + .withKeyMilestone("01/12/2023") .withMeetingTime("24/10/2023 12:30") .buildLead(); public static final Lead DANIEL = new PersonBuilder().withName("Daniel Meier").withPhone("87652533") .withEmail("cornelia@example.com") .withAddress("10th street") .withTags("friends") - .withKeyMilestone("2022-12-01") + .withKeyMilestone("01/12/2023") .withMeetingTime("24/10/2023 12:30") .buildLead(); public static final Lead ELLE = new PersonBuilder().withName("Elle Meyer").withPhone("9482224") .withEmail("werner@example.com") .withAddress("michegan ave") - .withKeyMilestone("2022-12-01") + .withKeyMilestone("01/12/2023") .withMeetingTime("24/10/2023 12:30") .buildLead(); public static final Lead FIONA = new PersonBuilder().withName("Fiona Kunz").withPhone("9482427") .withEmail("lydia@example.com") .withAddress("little tokyo") - .withKeyMilestone("2022-12-01") + .withKeyMilestone("01/12/2023") .withMeetingTime("24/10/2023 12:30") .buildLead(); public static final Lead GEORGE = new PersonBuilder().withName("George Best").withPhone("9482442") .withEmail("anna@example.com") .withAddress("4th street") - .withKeyMilestone("2022-12-01") + .withKeyMilestone("01/12/2023") .withMeetingTime("24/10/2023 12:30") .buildLead(); // Manually added public static final Lead HOON = new PersonBuilder().withName("Hoon Meier").withPhone("8482424") .withEmail("stefan@example.com").withAddress("little india") - .withKeyMilestone("2022-12-01") + .withKeyMilestone("01/12/2023") .withMeetingTime("24/10/2023 12:30") .withTags(VALID_TAG_FRIEND, VALID_TAG_HUSBAND).buildLead(); public static final Lead IDA = new PersonBuilder().withName("Ida Mueller").withPhone("8482131") .withEmail("hans@example.com").withAddress("chicago ave") - .withKeyMilestone("2022-12-01") + .withKeyMilestone("01/12/2023") .withMeetingTime("24/10/2023 12:30") .buildLead(); @@ -90,12 +90,12 @@ public class TypicalLeads { public static final Lead AMY = new PersonBuilder().withName(VALID_NAME_AMY).withPhone(VALID_PHONE_AMY) .withEmail(VALID_EMAIL_AMY).withAddress(VALID_ADDRESS_AMY).withTags(VALID_TAG_FRIEND) .withMeetingTime(VALID_MEETING_TIME_AMY) - .withKeyMilestone(VALID_KEYMILESTONE_AMY).buildLead(); + .withKeyMilestone(VALID_KEY_MILESTONE_AMY).buildLead(); public static final Lead BOB = new PersonBuilder().withName(VALID_NAME_BOB).withPhone(VALID_PHONE_BOB) .withEmail(VALID_EMAIL_BOB) .withAddress(VALID_ADDRESS_BOB) .withTags(VALID_TAG_HUSBAND, VALID_TAG_FRIEND) - .withKeyMilestone(VALID_KEYMILESTONE_BOB) + .withKeyMilestone(VALID_KEY_MILESTONE_BOB) .withMeetingTime(VALID_MEETING_TIME_BOB) .buildLead(); diff --git a/src/test/java/seedu/address/testutil/TypicalPersons.java b/src/test/java/seedu/address/testutil/TypicalPersons.java index 54fb62b9d11..87861a64f82 100644 --- a/src/test/java/seedu/address/testutil/TypicalPersons.java +++ b/src/test/java/seedu/address/testutil/TypicalPersons.java @@ -4,7 +4,7 @@ import static seedu.address.logic.commands.CommandTestUtil.VALID_ADDRESS_BOB; import static seedu.address.logic.commands.CommandTestUtil.VALID_EMAIL_AMY; import static seedu.address.logic.commands.CommandTestUtil.VALID_EMAIL_BOB; -import static seedu.address.logic.commands.CommandTestUtil.VALID_KEYMILESTONE_BOB; +import static seedu.address.logic.commands.CommandTestUtil.VALID_KEY_MILESTONE_BOB; import static seedu.address.logic.commands.CommandTestUtil.VALID_MEETING_TIME_AMY; import static seedu.address.logic.commands.CommandTestUtil.VALID_MEETING_TIME_BOB; import static seedu.address.logic.commands.CommandTestUtil.VALID_NAME_AMY; @@ -46,11 +46,11 @@ public class TypicalPersons { public static final Client DANIEL = new PersonBuilder().withName("Daniel Meier").withPhone("87652533") .withEmail("cornelia@example.com").withAddress("10th street").withTags("friends").buildClient(); public static final Lead ELLE = new PersonBuilder().withName("Elle Meyer").withPhone("9482224") - .withEmail("werner@example.com").withAddress("michegan ave").withKeyMilestone("2022-12-01").buildLead(); + .withEmail("werner@example.com").withAddress("michegan ave").withKeyMilestone("01/12/2023").buildLead(); public static final Lead FIONA = new PersonBuilder().withName("Fiona Kunz").withPhone("9482427") - .withEmail("lydia@example.com").withAddress("little tokyo").withKeyMilestone("2022-12-01").buildLead(); + .withEmail("lydia@example.com").withAddress("little tokyo").withKeyMilestone("01/12/2023").buildLead(); public static final Lead GEORGE = new PersonBuilder().withName("George Best").withPhone("9482442") - .withEmail("anna@example.com").withAddress("4th street").withKeyMilestone("2022-12-01").buildLead(); + .withEmail("anna@example.com").withAddress("4th street").withKeyMilestone("01/12/2023").buildLead(); // Manually added public static final Client HOON = new PersonBuilder().withName("Hoon Meier").withPhone("8482424") @@ -64,7 +64,7 @@ public class TypicalPersons { .withMeetingTime(VALID_MEETING_TIME_AMY).buildClient(); public static final Lead BOB = new PersonBuilder().withName(VALID_NAME_BOB).withPhone(VALID_PHONE_BOB) .withEmail(VALID_EMAIL_BOB).withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HUSBAND, VALID_TAG_FRIEND) - .withKeyMilestone(VALID_KEYMILESTONE_BOB) + .withKeyMilestone(VALID_KEY_MILESTONE_BOB) .withMeetingTime(VALID_MEETING_TIME_BOB) .buildLead();