diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 7c48d7e36f4..86e96c4996a 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -87,9 +87,7 @@ Details specifically on organization and recruiter level are specified in the ne #### Adding an organization contact: `add --org` -_{Work in progress...}_ - -Format: `add --org --name NAME [--id ID] [--phone NUMBER] [--email EMAIL] [--url URL] [--addr ADDRESS] [--stat STATUS] [--pos POSITION] [--tag TAG]... ` +Format: `add --org --name NAME [--id ID] [--phone NUMBER] [--email EMAIL] [--url URL] [--address ADDRESS] [--tag TAG]... ` Acceptable Parameters: @@ -123,9 +121,7 @@ Examples: #### Adding a recruiter contact: `add --rec` -_{Work in progress...}_ - -Format: `add --rec --name NAME [-id ID] [--oid ORG_ID] [--phone NUMBER] [--email EMAIL] [--url URL] [--addr ADDRESS] [--tag TAG]...` +Format: `add --rec --name NAME [-id ID] [--oid ORG_ID] [--phone NUMBER] [--email EMAIL] [--url URL] [--address ADDRESS] [--tag TAG]...` Acceptable Parameters: @@ -236,9 +232,10 @@ Jobby data are saved automatically as a JSON file `[JAR file location]/data/jobb If your changes to the data file makes its format invalid, Jobby will discard all data and start with an empty data file at the next run. Hence, it is recommended to take a backup of the file before editing it. + #### Applying to an Organization: `apply` -Format: `apply INDEX/ID --title TITLE [--desc DESCRIPTION] [--by DEADLINE: DD-MM-YYYY] [--stage APPLICATION STAGE: resume | online assessment | interview] [--stat STATUS: pending | offered | accepted | turned down]` +Format: `apply INDEX/ID --title TITLE [--description DESCRIPTION] [--by DEADLINE: DD-MM-YYYY] [--stage APPLICATION STAGE: resume | online assessment | interview] [--status STATUS: pending | offered | accepted | turned down]` Acceptable Parameters: * `TITLE` can accept any value. @@ -258,9 +255,9 @@ Examples: * `apply id_12345_1 --title Unit Tester --by 12-12-2023` -* `apply id_12345_1 --title Unit Tester --desc Unit testing for Google --by 12-12-2023 --stage resume` +* `apply id_12345_1 --title Unit Tester --description Unit testing for Google --by 12-12-2023 --stage resume` -* `apply id_12345_1 --title Junior Engineer --desc Junir role --by 12-12-2023 --stage resume --stat pending` +* `apply id_12345_1 --title Junior Engineer --description Junior role --by 12-12-2023 --stage resume --status pending` ### Deleting a job application @@ -276,7 +273,7 @@ Examples: ### Updating/Editing a job application Updates the job applications with the input fields. -Format: `edit --application INDEX [--title TITLE] [--desc DESCRIPTION] [--by DEADLINE] [--stat STATUS] [--stage STAGE]` +Format: `edit --application INDEX [--title TITLE] [--description DESCRIPTION] [--by DEADLINE] [--status STATUS] [--stage STAGE]` * `INDEX` refers to the index number shown on the list and must be a positive integer. * At least one of the optional fields must be specified. @@ -284,8 +281,8 @@ Format: `edit --application INDEX [--title TITLE] [--desc DESCRIPTION] [--by DEA * `STAGE` is one of `resume`, `online assessment`, `interview` Examples: -* `edit --application 1 --title SWE --desc Pay: $100 per hour` -* `edit --application 1 --stat rejected` +* `edit --application 1 --title SWE --description Pay: $100 per hour` +* `edit --application 1 --status rejected` * `edit --application 1 --stage interview` ### Sorting contacts/job applications: `sort` @@ -353,15 +350,15 @@ Examples: Action | Format, Examples ----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - **Add Organization** | `add --org --name [--id ID] [--phone NUMBER] [--email EMAIL] [--url URL] [--addr ADDRESS] [--tag TAG]...`
e.g., `add --org --name NUS --phone 0123456789 --email example@nus.edu.sg --url https://www.nus.edu.sg/` - **Add Recruiter** | `add --rec --name [--id ID] [--oid ORG_ID] [--phone NUMBER] [--email EMAIL] [--url URL] [--addr ADDRESS] [--tag TAG]...`
e.g., `add --rec --name John Doe --oid paypal-sg` + **Add Organization** | `add --org --name [--id ID] [--phone NUMBER] [--email EMAIL] [--url URL] [--address ADDRESS] [--tag TAG]...`
e.g., `add --org --name NUS --phone 0123456789 --email example@nus.edu.sg --url https://www.nus.edu.sg/` + **Add Recruiter** | `add --rec --name [--id ID] [--oid ORG_ID] [--phone NUMBER] [--email EMAIL] [--url URL] [--address ADDRESS] [--tag TAG]...`
e.g., `add --rec --name John Doe --oid paypal-sg` **Clear** | `clear` - **Delete** | `delete INDEX [--recursive]` or
`delete --id ID [--recursive]`
e.g., `delete 3`, `delete --id 55tg` + **Delete** | `delete INDEX/ID [--recursive]`
e.g., `delete 3`, `delete id-55tg` **Edit** | `edit INDEX ...` or
`edit ID ...` or
`edit --application INDEX ...` **Find** | `find KEYWORD [MORE_KEYWORDS]`
e.g., `find James Jake` - **Apply** | `apply INDEX [--title TITLE] [--desc DESCRIPTION] [--by DEADLINE] [--stage STAGE] [--stat STATUS]` or
`apply ID [--title TITLE] [--desc DESCRIPTION] [--by DEADLINE] [--stage STAGE] [--stat STATUS]` - **List** | `list [--FLAG_TO_FILTER]` - **Sort** | `sort [--FLAG_TO_SORT]` + **Apply** | `apply INDEX/ID --title TITLE [--description DESCRIPTION] [--by DEADLINE] [--stage STAGE] [--status STATUS]` + **List** | `list [--org/--rec]` + **Sort** | `sort --FLAG_TO_SORT` **Help** | `help` diff --git a/src/main/java/seedu/address/logic/commands/AddCommand.java b/src/main/java/seedu/address/logic/commands/AddCommand.java index eb05488ac8c..b0fac438c3a 100644 --- a/src/main/java/seedu/address/logic/commands/AddCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddCommand.java @@ -9,9 +9,7 @@ import static seedu.address.logic.parser.CliSyntax.FLAG_ORGANIZATION; import static seedu.address.logic.parser.CliSyntax.FLAG_ORGANIZATION_ID; import static seedu.address.logic.parser.CliSyntax.FLAG_PHONE; -import static seedu.address.logic.parser.CliSyntax.FLAG_POSITION; import static seedu.address.logic.parser.CliSyntax.FLAG_RECRUITER; -import static seedu.address.logic.parser.CliSyntax.FLAG_STATUS; import static seedu.address.logic.parser.CliSyntax.FLAG_TAG; import static seedu.address.logic.parser.CliSyntax.FLAG_URL; @@ -53,13 +51,10 @@ public class AddCommand extends Command { AutocompleteDataSet.onceForEachOf( FLAG_NAME, FLAG_ID, FLAG_PHONE, FLAG_EMAIL, FLAG_ADDRESS, FLAG_URL, - FLAG_STATUS, FLAG_POSITION, FLAG_ORGANIZATION_ID ), AutocompleteDataSet.anyNumberOf(FLAG_TAG) ).addConstraints(List.of( - AutocompleteConstraint.where(FLAG_ORGANIZATION) - .isPrerequisiteFor(FLAG_STATUS, FLAG_POSITION), AutocompleteConstraint.where(FLAG_RECRUITER) .isPrerequisiteFor(FLAG_ORGANIZATION_ID) )) @@ -88,8 +83,6 @@ public class AddCommand extends Command { + "[" + FLAG_EMAIL + " EMAIL] " + "[" + FLAG_URL + " URL] " + "[" + FLAG_ADDRESS + " ADDRESS] " - + "[" + FLAG_STATUS + " STATUS] " - + "[" + FLAG_POSITION + " POSITION] " + "[" + FLAG_TAG + " TAG]...\n" + "Example: " + COMMAND_WORD + " " + FLAG_ORGANIZATION + " " @@ -99,8 +92,6 @@ public class AddCommand extends Command { + FLAG_EMAIL + " jobsInc@example.com " + FLAG_URL + " www.jobsinc.com " + FLAG_ADDRESS + " 311, Clementi Ave 2, #02-25 " - + FLAG_STATUS + " applied " - + FLAG_POSITION + " Junior Software Engineer " + FLAG_TAG + " softwareEngineering " + FLAG_TAG + " competitive "; @@ -149,7 +140,12 @@ public class AddCommand extends Command { /** * Creates an AddCommand to add a {@code Contact} to the address book with the given parameters. + * + *

+ * TODO: This class should be made abstract. + *

*/ + @Deprecated public AddCommand(Name name, Id id, Phone phone, Email email, Url url, Address address, Set tags) { requireAllNonNull(name, id, tags); this.name = name; diff --git a/src/main/java/seedu/address/logic/commands/AddOrganizationCommand.java b/src/main/java/seedu/address/logic/commands/AddOrganizationCommand.java index d6967578846..c86f3cda8a5 100644 --- a/src/main/java/seedu/address/logic/commands/AddOrganizationCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddOrganizationCommand.java @@ -22,8 +22,6 @@ */ public class AddOrganizationCommand extends AddCommand { - protected final Status status; - protected final Position position; protected final Set rids; /** @@ -42,8 +40,6 @@ public AddOrganizationCommand( Set rids ) { super(name, id, phone, email, url, address, tags); - this.status = status; - this.position = position; this.rids = rids; } @@ -54,7 +50,7 @@ public CommandResult execute(Model model) throws CommandException { @Override protected Organization createContact() { - return new Organization(name, id, phone, email, url, address, tags, status, position, rids); + return new Organization(name, id, phone, email, url, address, tags, null, null, rids); } @Override @@ -76,8 +72,6 @@ public boolean equals(Object other) { && Objects.equals(address, otherAddCommand.address) && Objects.equals(url, otherAddCommand.url) && tags.equals(otherAddCommand.tags) - && Objects.equals(status, otherAddCommand.status) - && Objects.equals(position, otherAddCommand.position) && Objects.equals(rids, otherAddCommand.rids); } @@ -91,8 +85,6 @@ protected ToStringBuilder toStringBuilder() { .add("url", url) .add("address", address) .add("tags", tags) - .add("status", status) - .add("position", position) .add("rids", rids); } } diff --git a/src/main/java/seedu/address/logic/commands/EditCommand.java b/src/main/java/seedu/address/logic/commands/EditCommand.java index 7cc45b064da..87a8501e70a 100644 --- a/src/main/java/seedu/address/logic/commands/EditCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditCommand.java @@ -10,7 +10,6 @@ import static seedu.address.logic.parser.CliSyntax.FLAG_NAME; import static seedu.address.logic.parser.CliSyntax.FLAG_ORGANIZATION_ID; import static seedu.address.logic.parser.CliSyntax.FLAG_PHONE; -import static seedu.address.logic.parser.CliSyntax.FLAG_POSITION; import static seedu.address.logic.parser.CliSyntax.FLAG_STAGE; import static seedu.address.logic.parser.CliSyntax.FLAG_STATUS; import static seedu.address.logic.parser.CliSyntax.FLAG_TAG; @@ -128,8 +127,6 @@ public class EditCommand extends Command { + "[" + FLAG_EMAIL + " EMAIL] " + "[" + FLAG_URL + " URL] " + "[" + FLAG_ADDRESS + " ADDRESS] " - + "[" + FLAG_STATUS + " STATUS] " - + "[" + FLAG_POSITION + " POSITION] " + "[" + FLAG_TAG + " TAG]...\n" + "Example: " + COMMAND_WORD + " 1 "; diff --git a/src/main/java/seedu/address/logic/parser/AddCommandParser.java b/src/main/java/seedu/address/logic/parser/AddCommandParser.java index 37c9f3aeaa2..d1f06ba7b88 100644 --- a/src/main/java/seedu/address/logic/parser/AddCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/AddCommandParser.java @@ -8,9 +8,7 @@ import static seedu.address.logic.parser.CliSyntax.FLAG_ORGANIZATION; import static seedu.address.logic.parser.CliSyntax.FLAG_ORGANIZATION_ID; import static seedu.address.logic.parser.CliSyntax.FLAG_PHONE; -import static seedu.address.logic.parser.CliSyntax.FLAG_POSITION; import static seedu.address.logic.parser.CliSyntax.FLAG_RECRUITER; -import static seedu.address.logic.parser.CliSyntax.FLAG_STATUS; import static seedu.address.logic.parser.CliSyntax.FLAG_TAG; import static seedu.address.logic.parser.CliSyntax.FLAG_URL; @@ -26,8 +24,6 @@ import seedu.address.model.contact.Id; import seedu.address.model.contact.Name; import seedu.address.model.contact.Phone; -import seedu.address.model.contact.Position; -import seedu.address.model.contact.Status; import seedu.address.model.contact.Url; import seedu.address.model.tag.Tag; @@ -55,29 +51,15 @@ public AddCommand parse(String args) throws ParseException { argMultimap.verifyNoDuplicateFlagsFor(FLAG_NAME, FLAG_ID, FLAG_PHONE, FLAG_EMAIL, FLAG_URL, FLAG_ADDRESS); + argMultimap.verifyAtMostOneOfFlagsUsedOutOf(FLAG_ORGANIZATION, FLAG_RECRUITER); + if (argMultimap.hasFlag(FLAG_ORGANIZATION)) { return parseAsOrganization(argMultimap); } else if (argMultimap.hasFlag(FLAG_RECRUITER)) { return parseAsRecruiter(argMultimap); + } else { + throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddCommand.MESSAGE_USAGE)); } - - // Deprecated contact format. Will be removed in future versions. - Name name = ParserUtil.parseName(argMultimap.getValue(FLAG_NAME).get()); - Optional idString = argMultimap.getValue(FLAG_ID); - Id id = idString.isPresent() - ? ParserUtil.parseId(idString.get()) - : new Id(); - Phone phone = ParserUtil.parseOptionally( - argMultimap.getValue(FLAG_PHONE), ParserUtil::parsePhone); - Email email = ParserUtil.parseOptionally( - argMultimap.getValue(FLAG_EMAIL), ParserUtil::parseEmail); - Address address = ParserUtil.parseOptionally( - argMultimap.getValue(FLAG_ADDRESS), ParserUtil::parseAddress); - Url url = ParserUtil.parseOptionally( - argMultimap.getValue(FLAG_URL), ParserUtil::parseUrl); - Set tagList = ParserUtil.parseTags(argMultimap.getAllValues(FLAG_TAG)); - - return new AddCommand(name, id, phone, email, url, address, tagList); } private AddRecruiterCommand parseAsRecruiter(ArgumentMultimap argMultimap) throws ParseException { @@ -105,7 +87,6 @@ private AddRecruiterCommand parseAsRecruiter(ArgumentMultimap argMultimap) throw } private AddOrganizationCommand parseAsOrganization(ArgumentMultimap argMultimap) throws ParseException { - argMultimap.verifyNoDuplicateFlagsFor(FLAG_POSITION, FLAG_STATUS); Name name = ParserUtil.parseName(argMultimap.getValue(FLAG_NAME).get()); Optional idString = argMultimap.getValue(FLAG_ID); @@ -121,13 +102,9 @@ private AddOrganizationCommand parseAsOrganization(ArgumentMultimap argMultimap) argMultimap.getValue(FLAG_ADDRESS), ParserUtil::parseAddress); Url url = ParserUtil.parseOptionally( argMultimap.getValue(FLAG_URL), ParserUtil::parseUrl); - Position position = ParserUtil.parseOptionally( - argMultimap.getValue(FLAG_POSITION), ParserUtil::parsePosition); - Status status = ParserUtil.parseOptionally( - argMultimap.getValue(FLAG_STATUS), ParserUtil::parseStatus); Set tagList = ParserUtil.parseTags(argMultimap.getAllValues(FLAG_TAG)); Set ridList = Set.of(); // TODO: This should be dynamically determined from oid in Recruiter. - return new AddOrganizationCommand(name, id, phone, email, url, address, tagList, status, position, ridList); + return new AddOrganizationCommand(name, id, phone, email, url, address, tagList, null, null, ridList); } } diff --git a/src/main/java/seedu/address/logic/parser/CliSyntax.java b/src/main/java/seedu/address/logic/parser/CliSyntax.java index 6a00789a1f9..8e0147b4743 100644 --- a/src/main/java/seedu/address/logic/parser/CliSyntax.java +++ b/src/main/java/seedu/address/logic/parser/CliSyntax.java @@ -6,24 +6,25 @@ public class CliSyntax { /* Flag definitions */ + public static final Flag FLAG_ID = new Flag("id"); + public static final Flag FLAG_ORGANIZATION = new Flag("org"); + public static final Flag FLAG_RECRUITER = new Flag("rec"); + public static final Flag FLAG_APPLICATION = new Flag("application"); + public static final Flag FLAG_NAME = new Flag("name"); public static final Flag FLAG_PHONE = new Flag("phone"); public static final Flag FLAG_EMAIL = new Flag("email"); - public static final Flag FLAG_ADDRESS = new Flag("addr"); + public static final Flag FLAG_ADDRESS = new Flag("address"); public static final Flag FLAG_TAG = new Flag("tag"); - public static final Flag FLAG_ORGANIZATION = new Flag("org"); - public static final Flag FLAG_RECRUITER = new Flag("rec"); public static final Flag FLAG_URL = new Flag("url"); - public static final Flag FLAG_STATUS = new Flag("stat"); - public static final Flag FLAG_POSITION = new Flag("pos"); - public static final Flag FLAG_ID = new Flag("id"); + public static final Flag FLAG_STATUS = new Flag("status"); public static final Flag FLAG_RECURSIVE = new Flag("recursive"); public static final Flag FLAG_ORGANIZATION_ID = new Flag("oid"); public static final Flag FLAG_RECRUITER_ID = new Flag("rid"); public static final Flag FLAG_TITLE = new Flag("title"); public static final Flag FLAG_DEADLINE = new Flag("by"); public static final Flag FLAG_STAGE = new Flag("stage"); - public static final Flag FLAG_DESCRIPTION = new Flag("desc"); + public static final Flag FLAG_DESCRIPTION = new Flag("description"); public static final Flag FLAG_NOT_APPLIED = new Flag("toapply"); public static final Flag FLAG_NONE = new Flag("none"); public static final Flag FLAG_ASCENDING = new Flag("ascending"); @@ -31,7 +32,6 @@ public class CliSyntax { public static final Flag FLAG_STALE = new Flag("stale"); public static final Flag FLAG_EARLIEST = new Flag("earliest"); public static final Flag FLAG_LATEST = new Flag("latest"); - public static final Flag FLAG_APPLICATION = new Flag("application"); } diff --git a/src/main/java/seedu/address/logic/parser/EditCommandParser.java b/src/main/java/seedu/address/logic/parser/EditCommandParser.java index e4c896004aa..ffb498b180f 100644 --- a/src/main/java/seedu/address/logic/parser/EditCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/EditCommandParser.java @@ -11,7 +11,6 @@ import static seedu.address.logic.parser.CliSyntax.FLAG_NAME; import static seedu.address.logic.parser.CliSyntax.FLAG_ORGANIZATION_ID; import static seedu.address.logic.parser.CliSyntax.FLAG_PHONE; -import static seedu.address.logic.parser.CliSyntax.FLAG_POSITION; import static seedu.address.logic.parser.CliSyntax.FLAG_STAGE; import static seedu.address.logic.parser.CliSyntax.FLAG_STATUS; import static seedu.address.logic.parser.CliSyntax.FLAG_TAG; @@ -82,7 +81,7 @@ public EditCommand parse(String args) throws ParseException { argMultimap.verifyNoDuplicateFlagsFor(FLAG_NAME, FLAG_PHONE, FLAG_EMAIL, - FLAG_ADDRESS, FLAG_URL, FLAG_ID, FLAG_STATUS, FLAG_POSITION, FLAG_ORGANIZATION_ID); + FLAG_ADDRESS, FLAG_URL, FLAG_ID, FLAG_ORGANIZATION_ID); EditContactDescriptor editContactDescriptor = new EditContactDescriptor(); @@ -105,12 +104,6 @@ public EditCommand parse(String args) throws ParseException { if (argMultimap.getValue(FLAG_ID).isPresent()) { editContactDescriptor.setId(ParserUtil.parseId(argMultimap.getValue(FLAG_ID).get())); } - if (argMultimap.getValue(FLAG_STATUS).isPresent()) { - editContactDescriptor.setStatus(ParserUtil.parseStatus(argMultimap.getValue(FLAG_STATUS).get())); - } - if (argMultimap.getValue(FLAG_POSITION).isPresent()) { - editContactDescriptor.setPosition(ParserUtil.parsePosition(argMultimap.getValue(FLAG_POSITION).get())); - } if (argMultimap.getValue(FLAG_ORGANIZATION_ID).isPresent()) { editContactDescriptor.setOid(ParserUtil.parseId(argMultimap.getValue(FLAG_ORGANIZATION_ID).get())); } diff --git a/src/main/java/seedu/address/model/contact/Contact.java b/src/main/java/seedu/address/model/contact/Contact.java index bf8cb4d2b88..3607bc33388 100644 --- a/src/main/java/seedu/address/model/contact/Contact.java +++ b/src/main/java/seedu/address/model/contact/Contact.java @@ -37,7 +37,12 @@ public class Contact { * Name and id fields must be non-null. * Tags must be non-null but can be empty as well. * The other fields can be null. + * + *

+ * TODO: This should be changed to an abstract class. Do not use directly externally. + *

*/ + @Deprecated public Contact(Name name, Id id, Phone phone, Email email, Url url, Address address, Set tags, Contact parent) { requireAllNonNull(name, id, tags); diff --git a/src/main/java/seedu/address/model/contact/Organization.java b/src/main/java/seedu/address/model/contact/Organization.java index c29a8a94029..161c6c8b9b4 100644 --- a/src/main/java/seedu/address/model/contact/Organization.java +++ b/src/main/java/seedu/address/model/contact/Organization.java @@ -20,8 +20,6 @@ public class Organization extends Contact { // TODO: Override the getChildren method - private final Optional status; - private final Optional position; private final Set rids = new HashSet<>(); @@ -53,8 +51,6 @@ public Organization( Set rids, List jobApplications ) { super(name, id, phone, email, url, address, tags, null); - this.status = Optional.ofNullable(status); - this.position = Optional.ofNullable(position); this.jobApplications.addAll(jobApplications); // Todo: Likely to deprecate rids completely // this.rids.addAll(rids); @@ -65,12 +61,14 @@ public Type getType() { return Type.ORGANIZATION; } + @Deprecated public Optional getStatus() { - return status; + return Optional.empty(); // TODO: Remove entirely } + @Deprecated public Optional getPosition() { - return position; + return Optional.empty(); // TODO: Remove entirely } /** @@ -132,23 +130,19 @@ && getPhone().equals(otherContact.getPhone()) && getEmail().equals(otherContact.getEmail()) && getAddress().equals(otherContact.getAddress()) && getUrl().equals(otherContact.getUrl()) - && getTags().equals(otherContact.getTags()) - && status.equals(otherContact.status) - && position.equals(otherContact.position); + && getTags().equals(otherContact.getTags()); } @Override public int hashCode() { return Objects.hash( - getId(), getType(), getName(), getPhone(), getEmail(), getAddress(), getTags(), status, position + getId(), getType(), getName(), getPhone(), getEmail(), getAddress(), getTags() ); } @Override public ToStringBuilder toStringBuilder() { - return super.toStringBuilder() - .add("status", status) - .add("position", position); + return super.toStringBuilder(); } } diff --git a/src/main/java/seedu/address/model/contact/Position.java b/src/main/java/seedu/address/model/contact/Position.java index 574fdb68abc..967ac2eed81 100644 --- a/src/main/java/seedu/address/model/contact/Position.java +++ b/src/main/java/seedu/address/model/contact/Position.java @@ -24,6 +24,7 @@ public class Position { * * @param position A valid position. */ + @Deprecated public Position(String position) { requireNonNull(position); checkArgument(isValidPosition(position), MESSAGE_CONSTRAINTS); @@ -33,6 +34,7 @@ public Position(String position) { /** * Constructs an empty {@code Position}. */ + @Deprecated public Position() { jobPosition = ""; } diff --git a/src/test/java/seedu/address/logic/LogicManagerTest.java b/src/test/java/seedu/address/logic/LogicManagerTest.java index bce1acf8ec6..abbea740f65 100644 --- a/src/test/java/seedu/address/logic/LogicManagerTest.java +++ b/src/test/java/seedu/address/logic/LogicManagerTest.java @@ -8,9 +8,15 @@ import static seedu.address.logic.commands.CommandTestUtil.ID_DESC_AMY; import static seedu.address.logic.commands.CommandTestUtil.NAME_DESC_AMY; import static seedu.address.logic.commands.CommandTestUtil.PHONE_DESC_AMY; +import static seedu.address.logic.commands.CommandTestUtil.REC_DESC; import static seedu.address.logic.commands.CommandTestUtil.URL_DESC_AMY; +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_ID_AMY; +import static seedu.address.logic.commands.CommandTestUtil.VALID_NAME_AMY; +import static seedu.address.logic.commands.CommandTestUtil.VALID_PHONE_AMY; +import static seedu.address.logic.commands.CommandTestUtil.VALID_URL_AMY; import static seedu.address.testutil.Assert.assertThrows; -import static seedu.address.testutil.TypicalContacts.AMY; import java.io.IOException; import java.nio.file.AccessDeniedException; @@ -31,11 +37,11 @@ import seedu.address.model.ModelManager; import seedu.address.model.ReadOnlyAddressBook; import seedu.address.model.UserPrefs; -import seedu.address.model.contact.Contact; +import seedu.address.model.contact.Recruiter; import seedu.address.storage.JsonAddressBookStorage; import seedu.address.storage.JsonUserPrefsStorage; import seedu.address.storage.StorageManager; -import seedu.address.testutil.ContactBuilder; +import seedu.address.testutil.RecruiterBuilder; public class LogicManagerTest { private static final IOException DUMMY_IO_EXCEPTION = new IOException("dummy IO exception"); @@ -185,9 +191,18 @@ public void saveAddressBook(ReadOnlyAddressBook addressBook, Path filePath) logic = new LogicManager(model, storage); // Triggers the saveAddressBook method by executing an add command - String addCommand = AddCommand.COMMAND_WORD + NAME_DESC_AMY + ID_DESC_AMY + PHONE_DESC_AMY + String addCommand = AddCommand.COMMAND_WORD + REC_DESC + NAME_DESC_AMY + ID_DESC_AMY + PHONE_DESC_AMY + EMAIL_DESC_AMY + ADDRESS_DESC_AMY + URL_DESC_AMY; - Contact expectedContact = new ContactBuilder(AMY).withTags().build(); + Recruiter expectedContact = new RecruiterBuilder() + .withName(VALID_NAME_AMY) + .withId(VALID_ID_AMY) + .withPhone(VALID_PHONE_AMY) + .withEmail(VALID_EMAIL_AMY) + .withAddress(VALID_ADDRESS_AMY) + .withUrl(VALID_URL_AMY) + .withOrganization(null) + .withTags() + .build(); ModelManager expectedModel = new ModelManager(); expectedModel.addContact(expectedContact); assertCommandFailure(addCommand, CommandException.class, expectedMessage, expectedModel); diff --git a/src/test/java/seedu/address/logic/commands/AddOrganizationCommandTest.java b/src/test/java/seedu/address/logic/commands/AddOrganizationCommandTest.java index 29ac8230f7c..6ed6539a62b 100644 --- a/src/test/java/seedu/address/logic/commands/AddOrganizationCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/AddOrganizationCommandTest.java @@ -173,8 +173,6 @@ public void toStringMethod() { + ", url=" + NUS.getUrl().orElse(null) + ", address=" + NUS.getAddress().orElse(null) + ", tags=" + NUS.getTags() - + ", status=" + NUS.getStatus().orElse(null) - + ", position=" + NUS.getPosition().orElse(null) + ", rids=" + NUS.getRecruiterIds() + "}"; assertEquals(expected, addCommand.toString()); } diff --git a/src/test/java/seedu/address/logic/commands/CommandTestUtil.java b/src/test/java/seedu/address/logic/commands/CommandTestUtil.java index 7aca20ff4c1..9c919310925 100644 --- a/src/test/java/seedu/address/logic/commands/CommandTestUtil.java +++ b/src/test/java/seedu/address/logic/commands/CommandTestUtil.java @@ -6,7 +6,9 @@ import static seedu.address.logic.parser.CliSyntax.FLAG_EMAIL; import static seedu.address.logic.parser.CliSyntax.FLAG_ID; import static seedu.address.logic.parser.CliSyntax.FLAG_NAME; +import static seedu.address.logic.parser.CliSyntax.FLAG_ORGANIZATION; import static seedu.address.logic.parser.CliSyntax.FLAG_PHONE; +import static seedu.address.logic.parser.CliSyntax.FLAG_RECRUITER; import static seedu.address.logic.parser.CliSyntax.FLAG_TAG; import static seedu.address.logic.parser.CliSyntax.FLAG_URL; import static seedu.address.testutil.Assert.assertThrows; @@ -46,6 +48,9 @@ public class CommandTestUtil { public static final String VALID_POSITION_BOB = "Junior Developer"; public static final String VALID_OID_AMY = "amy_corp-inc"; + public static final String ORG_DESC = " " + FLAG_ORGANIZATION; + public static final String REC_DESC = " " + FLAG_RECRUITER; + public static final String NAME_DESC_AMY = " " + FLAG_NAME + " " + VALID_NAME_AMY; public static final String NAME_DESC_BOB = " " + FLAG_NAME + " " + VALID_NAME_BOB; public static final String ID_DESC_AMY = " " + FLAG_ID + " " + VALID_ID_AMY; diff --git a/src/test/java/seedu/address/logic/parser/AddCommandParserTest.java b/src/test/java/seedu/address/logic/parser/AddCommandParserTest.java index 7fb4be394a1..fab94ee38f9 100644 --- a/src/test/java/seedu/address/logic/parser/AddCommandParserTest.java +++ b/src/test/java/seedu/address/logic/parser/AddCommandParserTest.java @@ -19,77 +19,33 @@ import static seedu.address.logic.commands.CommandTestUtil.PHONE_DESC_AMY; import static seedu.address.logic.commands.CommandTestUtil.PHONE_DESC_BOB; import static seedu.address.logic.commands.CommandTestUtil.PREAMBLE_NON_EMPTY; -import static seedu.address.logic.commands.CommandTestUtil.PREAMBLE_WHITESPACE; +import static seedu.address.logic.commands.CommandTestUtil.REC_DESC; import static seedu.address.logic.commands.CommandTestUtil.TAG_DESC_FRIEND; import static seedu.address.logic.commands.CommandTestUtil.TAG_DESC_HUSBAND; -import static seedu.address.logic.commands.CommandTestUtil.URL_DESC_BOB; import static seedu.address.logic.commands.CommandTestUtil.VALID_NAME_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.FLAG_ADDRESS; import static seedu.address.logic.parser.CliSyntax.FLAG_EMAIL; import static seedu.address.logic.parser.CliSyntax.FLAG_ID; import static seedu.address.logic.parser.CliSyntax.FLAG_NAME; import static seedu.address.logic.parser.CliSyntax.FLAG_PHONE; import static seedu.address.logic.parser.CommandParserTestUtil.assertParseFailure; -import static seedu.address.logic.parser.CommandParserTestUtil.assertParseSuccess; -import static seedu.address.testutil.TypicalContacts.AMY; -import static seedu.address.testutil.TypicalContacts.BOB; import org.junit.jupiter.api.Test; import seedu.address.logic.Messages; import seedu.address.logic.commands.AddCommand; import seedu.address.model.contact.Address; -import seedu.address.model.contact.Contact; import seedu.address.model.contact.Email; import seedu.address.model.contact.Id; import seedu.address.model.contact.Name; import seedu.address.model.contact.Phone; import seedu.address.model.contact.Url; import seedu.address.model.tag.Tag; -import seedu.address.testutil.ContactBuilder; public class AddCommandParserTest { private AddCommandParser parser = new AddCommandParser(); - @Test - public void parse_allFieldsPresent_success() { - Contact expectedContact = new ContactBuilder(BOB).withTags(VALID_TAG_FRIEND).build(); - AddCommand addExpectedCommand = new AddCommand( - expectedContact.getName(), - expectedContact.getId(), - expectedContact.getPhone().orElse(null), - expectedContact.getEmail().orElse(null), - expectedContact.getUrl().orElse(null), - expectedContact.getAddress().orElse(null), - expectedContact.getTags() - ); - - // whitespace only preamble - assertParseSuccess(parser, - PREAMBLE_WHITESPACE + NAME_DESC_BOB + ID_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB - + ADDRESS_DESC_BOB + URL_DESC_BOB + TAG_DESC_FRIEND, addExpectedCommand); - - - // multiple tags - all accepted - Contact expectedContactMultipleTags = new ContactBuilder(BOB).withTags(VALID_TAG_FRIEND, VALID_TAG_HUSBAND) - .build(); - AddCommand addExpectedMultipleTagsCommand = new AddCommand( - expectedContactMultipleTags.getName(), - expectedContactMultipleTags.getId(), - expectedContactMultipleTags.getPhone().orElse(null), - expectedContactMultipleTags.getEmail().orElse(null), - expectedContactMultipleTags.getUrl().orElse(null), - expectedContactMultipleTags.getAddress().orElse(null), - expectedContactMultipleTags.getTags() - ); - assertParseSuccess(parser, - NAME_DESC_BOB + ID_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB - + URL_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, - addExpectedMultipleTagsCommand); - } - @Test public void parse_repeatedNonTagValue_failure() { String validExpectedContactString = NAME_DESC_BOB + ID_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB @@ -162,28 +118,6 @@ public void parse_repeatedNonTagValue_failure() { Messages.getErrorMessageForDuplicateFlags(FLAG_ADDRESS)); } - @Test - public void parse_optionalFieldsMissing_success() { - // zero tags, no phone, email, url and address - Contact expectedContact = new ContactBuilder(AMY) - .withPhone(null).withEmail(null) - .withUrl(null).withAddress(null) - .withTags().build(); - AddCommand addExpectedCommand = new AddCommand( - expectedContact.getName(), - expectedContact.getId(), - expectedContact.getPhone().orElse(null), - expectedContact.getEmail().orElse(null), - expectedContact.getUrl().orElse(null), - expectedContact.getAddress().orElse(null), - expectedContact.getTags() - ); - assertParseSuccess( - parser, - NAME_DESC_AMY + ID_DESC_AMY, - addExpectedCommand - ); - } @Test public void parse_compulsoryFieldMissing_failure() { @@ -196,40 +130,40 @@ public void parse_compulsoryFieldMissing_failure() { @Test public void parse_invalidValue_failure() { // invalid name - assertParseFailure(parser, INVALID_NAME_DESC + ID_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB - + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Name.MESSAGE_CONSTRAINTS); + assertParseFailure(parser, REC_DESC + INVALID_NAME_DESC + ID_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + + ADDRESS_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Name.MESSAGE_CONSTRAINTS); // invalid id - assertParseFailure(parser, NAME_DESC_BOB + INVALID_ID_DESC + PHONE_DESC_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB - + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Id.MESSAGE_CONSTRAINTS); + assertParseFailure(parser, REC_DESC + NAME_DESC_BOB + INVALID_ID_DESC + PHONE_DESC_BOB + EMAIL_DESC_BOB + + ADDRESS_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Id.MESSAGE_CONSTRAINTS); // invalid phone - assertParseFailure(parser, NAME_DESC_BOB + ID_DESC_BOB + INVALID_PHONE_DESC + EMAIL_DESC_BOB + ADDRESS_DESC_BOB - + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Phone.MESSAGE_CONSTRAINTS); + assertParseFailure(parser, REC_DESC + NAME_DESC_BOB + ID_DESC_BOB + INVALID_PHONE_DESC + EMAIL_DESC_BOB + + ADDRESS_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Phone.MESSAGE_CONSTRAINTS); // invalid email - assertParseFailure(parser, NAME_DESC_BOB + ID_DESC_BOB + PHONE_DESC_BOB + INVALID_EMAIL_DESC + ADDRESS_DESC_BOB - + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Email.MESSAGE_CONSTRAINTS); + assertParseFailure(parser, REC_DESC + NAME_DESC_BOB + ID_DESC_BOB + PHONE_DESC_BOB + INVALID_EMAIL_DESC + + ADDRESS_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Email.MESSAGE_CONSTRAINTS); // invalid address - assertParseFailure(parser, NAME_DESC_BOB + ID_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + INVALID_ADDRESS_DESC - + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Address.MESSAGE_CONSTRAINTS); + assertParseFailure(parser, REC_DESC + NAME_DESC_BOB + ID_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + + INVALID_ADDRESS_DESC + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, Address.MESSAGE_CONSTRAINTS); // invalid tag - assertParseFailure(parser, NAME_DESC_BOB + ID_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB - + INVALID_TAG_DESC + VALID_TAG_FRIEND, Tag.MESSAGE_CONSTRAINTS); + assertParseFailure(parser, REC_DESC + NAME_DESC_BOB + ID_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + + ADDRESS_DESC_BOB + INVALID_TAG_DESC + VALID_TAG_FRIEND, Tag.MESSAGE_CONSTRAINTS); // invalid url - assertParseFailure(parser, NAME_DESC_BOB + ID_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB - + INVALID_URL_DESC, Url.MESSAGE_CONSTRAINTS); + assertParseFailure(parser, REC_DESC + NAME_DESC_BOB + ID_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + + ADDRESS_DESC_BOB + INVALID_URL_DESC, Url.MESSAGE_CONSTRAINTS); // two invalid values, only first invalid value reported - assertParseFailure(parser, INVALID_NAME_DESC + ID_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB - + INVALID_ADDRESS_DESC, Name.MESSAGE_CONSTRAINTS); + assertParseFailure(parser, REC_DESC + INVALID_NAME_DESC + ID_DESC_BOB + PHONE_DESC_BOB + + EMAIL_DESC_BOB + INVALID_ADDRESS_DESC, Name.MESSAGE_CONSTRAINTS); // non-empty preamble - assertParseFailure(parser, PREAMBLE_NON_EMPTY + NAME_DESC_BOB + ID_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB - + ADDRESS_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, + assertParseFailure(parser, PREAMBLE_NON_EMPTY + REC_DESC + NAME_DESC_BOB + ID_DESC_BOB + PHONE_DESC_BOB + + EMAIL_DESC_BOB + ADDRESS_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND, String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddCommand.MESSAGE_USAGE)); } } diff --git a/src/test/java/seedu/address/logic/parser/AppParserTest.java b/src/test/java/seedu/address/logic/parser/AppParserTest.java index 4b542add799..3341c0f1cdd 100644 --- a/src/test/java/seedu/address/logic/parser/AppParserTest.java +++ b/src/test/java/seedu/address/logic/parser/AppParserTest.java @@ -9,11 +9,12 @@ import java.util.Arrays; import java.util.List; +import java.util.Set; import java.util.stream.Collectors; import org.junit.jupiter.api.Test; -import seedu.address.logic.commands.AddCommand; +import seedu.address.logic.commands.AddOrganizationCommand; import seedu.address.logic.commands.ApplyCommand; import seedu.address.logic.commands.ClearCommand; import seedu.address.logic.commands.DeleteCommand; @@ -35,17 +36,20 @@ public class AppParserTest { private final AppParser parser = new AppParser(); @Test - public void parseCommand_add() throws Exception { + public void parseCommand_addOrganization() throws Exception { Contact contact = new ContactBuilder().build(); - AddCommand parsedAddCommand = (AddCommand) parser.parseCommand(ContactUtil.getAddCommand(contact)); - AddCommand addCommand = new AddCommand( + var parsedAddCommand = (AddOrganizationCommand) parser.parseCommand(ContactUtil.getAddOrgCommand(contact)); + AddOrganizationCommand addCommand = new AddOrganizationCommand( contact.getName(), contact.getId(), contact.getPhone().orElse(null), contact.getEmail().orElse(null), contact.getUrl().orElse(null), contact.getAddress().orElse(null), - contact.getTags() + contact.getTags(), + null, + null, + Set.of() ); assertEquals(addCommand, parsedAddCommand); } @@ -121,7 +125,6 @@ public void parseCompletionGenerator_knownSubsequence_canGenerateCorrectSuggesti String userInput = "add --org -o"; assertEquals( List.of( - "add --org --pos", "add --org --phone" ), parser.parseCompletionGenerator(userInput) diff --git a/src/test/java/seedu/address/logic/parser/ApplyCommandParserTest.java b/src/test/java/seedu/address/logic/parser/ApplyCommandParserTest.java index 9d827ba1460..45d0677a1a2 100644 --- a/src/test/java/seedu/address/logic/parser/ApplyCommandParserTest.java +++ b/src/test/java/seedu/address/logic/parser/ApplyCommandParserTest.java @@ -11,10 +11,10 @@ class ApplyCommandParserTest { private static final String VALID_ARGS_1 = "1 --title SWE"; private static final String VALID_ARGS_2 = "1 --title SWE --by 11-10-2022"; - private static final String VALID_ARGS_3 = "1 --title SWE --desc Pay: $100"; + private static final String VALID_ARGS_3 = "1 --title SWE --description Pay: $100"; private static final String VALID_ARGS_4 = "1 --title SWE --stage interview"; - private static final String VALID_ARGS_5 = "1 --title SWE --stat pending"; - private static final String VALID_ARGS_6 = "TEST_ID --title SWE --stat pending"; + private static final String VALID_ARGS_5 = "1 --title SWE --status pending"; + private static final String VALID_ARGS_6 = "TEST_ID --title SWE --status pending"; private static final String INVALID_ARGS_1 = "1"; private static final String INVALID_ARGS_2 = "TEST_ID"; private static final String INVALID_ARGS_3 = "--title SWE"; diff --git a/src/test/java/seedu/address/logic/parser/EditCommandParserTest.java b/src/test/java/seedu/address/logic/parser/EditCommandParserTest.java index 7ae706e0cfa..82ec78e44f5 100644 --- a/src/test/java/seedu/address/logic/parser/EditCommandParserTest.java +++ b/src/test/java/seedu/address/logic/parser/EditCommandParserTest.java @@ -125,7 +125,7 @@ public void parse_invalidValue_failure() { // Job Application // invalid status - assertParseFailure(parser, "--application 1 --stat resume", JobStatus.MESSAGE_CONSTRAINTS); + assertParseFailure(parser, "--application 1 --status resume", JobStatus.MESSAGE_CONSTRAINTS); // invalid stage assertParseFailure(parser, "--application 1 --stage resum", ApplicationStage.MESSAGE_CONSTRAINTS); @@ -149,8 +149,8 @@ public void parse_allFieldsSpecified_success() { // Job Application - String userApplicationInput = "--application 1 --title SWE --desc Pay: $100 --by 12-12-2022 --stat pending " - + "--stage " + "resume"; + String userApplicationInput = "--application 1 --title SWE --description Pay: $100 --by 12-12-2022 " + + "--status pending --stage resume"; EditApplicationDescriptor applicationDescriptor = new EditApplicationDescriptor(); applicationDescriptor.setApplicationStage(ApplicationStage.RESUME); applicationDescriptor.setJobDescription(new JobDescription("Pay: $100")); diff --git a/src/test/java/seedu/address/model/contact/OrganizationTest.java b/src/test/java/seedu/address/model/contact/OrganizationTest.java index 6aa95adde7e..57e3c3db3e6 100644 --- a/src/test/java/seedu/address/model/contact/OrganizationTest.java +++ b/src/test/java/seedu/address/model/contact/OrganizationTest.java @@ -106,14 +106,6 @@ public void equals() { // different tags -> returns false editedNus = new OrganizationBuilder(NUS).withTags(VALID_TAG_HUSBAND).build(); assertFalse(NUS.equals(editedNus)); - - // different status -> returns false - editedNus = new OrganizationBuilder(NUS).withStatus(VALID_STATUS_BOB).build(); - assertFalse(NUS.equals(editedNus)); - - // different position -> returns false - editedNus = new OrganizationBuilder(NUS).withPosition(VALID_POSITION_BOB).build(); - assertFalse(NUS.equals(editedNus)); } @Test @@ -126,9 +118,7 @@ public void toStringMethod() { + ", email=" + NUS.getEmail() + ", url=" + NUS.getUrl() + ", address=" + NUS.getAddress() - + ", tags=" + NUS.getTags() - + ", status=" + NUS.getStatus() - + ", position=" + NUS.getPosition() + "}"; + + ", tags=" + NUS.getTags() + "}"; assertEquals(expected, NUS.toString()); } } diff --git a/src/test/java/seedu/address/testutil/ContactUtil.java b/src/test/java/seedu/address/testutil/ContactUtil.java index 8acf7f8ba09..9df47f4b49a 100644 --- a/src/test/java/seedu/address/testutil/ContactUtil.java +++ b/src/test/java/seedu/address/testutil/ContactUtil.java @@ -4,6 +4,7 @@ import static seedu.address.logic.parser.CliSyntax.FLAG_EMAIL; import static seedu.address.logic.parser.CliSyntax.FLAG_ID; import static seedu.address.logic.parser.CliSyntax.FLAG_NAME; +import static seedu.address.logic.parser.CliSyntax.FLAG_ORGANIZATION; import static seedu.address.logic.parser.CliSyntax.FLAG_PHONE; import static seedu.address.logic.parser.CliSyntax.FLAG_TAG; import static seedu.address.logic.parser.CliSyntax.FLAG_URL; @@ -21,10 +22,10 @@ public class ContactUtil { /** - * Returns an add command string for adding the {@code contact}. + * Returns an add organization command string for adding the {@code contact}. */ - public static String getAddCommand(Contact contact) { - return AddCommand.COMMAND_WORD + " " + getContactDetails(contact); + public static String getAddOrgCommand(Contact contact) { + return AddCommand.COMMAND_WORD + " " + FLAG_ORGANIZATION + " " + getContactDetails(contact); } /** diff --git a/src/test/java/seedu/address/testutil/OrganizationBuilder.java b/src/test/java/seedu/address/testutil/OrganizationBuilder.java index be292f7ed9a..3eaf452cfec 100644 --- a/src/test/java/seedu/address/testutil/OrganizationBuilder.java +++ b/src/test/java/seedu/address/testutil/OrganizationBuilder.java @@ -6,19 +6,13 @@ import seedu.address.model.contact.Contact; import seedu.address.model.contact.Id; import seedu.address.model.contact.Organization; -import seedu.address.model.contact.Position; -import seedu.address.model.contact.Status; import seedu.address.model.util.SampleDataUtil; /** * A utility class to help with building Organization objects. */ public class OrganizationBuilder extends ContactBuilder { - public static final String DEFAULT_STATUS = "Applied"; - public static final String DEFAULT_POSITION = "Manager"; - private Position position; private Set rids; - private Status status; /** @@ -26,8 +20,6 @@ public class OrganizationBuilder extends ContactBuilder { */ public OrganizationBuilder() { super(); - position = new Position(DEFAULT_POSITION); - status = new Status(DEFAULT_STATUS); rids = new HashSet<>(); } @@ -36,8 +28,6 @@ public OrganizationBuilder() { */ public OrganizationBuilder(Organization organizationToCopy) { super(organizationToCopy); - position = organizationToCopy.getPosition().orElse(null); - status = organizationToCopy.getStatus().orElse(null); rids = organizationToCopy.getRecruiterIds(); } @@ -88,16 +78,18 @@ public OrganizationBuilder withRids(String ... rids) { /** * Sets the {@code Status} of the {@code Contact} that we are building. */ + @Deprecated public OrganizationBuilder withStatus(String status) { - this.status = status == null ? null : new Status(status); + // TODO: Remove entirely return this; } /** * Sets the {@code Position} of the {@code Contact} that we are building. */ + @Deprecated public OrganizationBuilder withPosition(String position) { - this.position = position == null ? null : new Position(position); + // TODO: Remove entirely return this; } @@ -112,8 +104,8 @@ public Organization build() { contact.getUrl().orElse(null), contact.getAddress().orElse(null), contact.getTags(), - status, - position, + null, + null, rids ); }