Skip to content

Commit

Permalink
Merge branch 'master' into update-jobapp-display
Browse files Browse the repository at this point in the history
  • Loading branch information
McNaBry authored Nov 2, 2023
2 parents 14a5b9c + adcaff2 commit 25b0cb6
Show file tree
Hide file tree
Showing 20 changed files with 119 additions and 228 deletions.
33 changes: 15 additions & 18 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.
</div>


#### 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.
Expand All @@ -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
Expand All @@ -276,16 +273,16 @@ 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.
* `STATUS` is one of `pending`, `offered`, `accepted`, `turned down`
* `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`
Expand Down Expand Up @@ -353,15 +350,15 @@ Examples:

Action | Format, Examples
----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
**Add Organization** | `add --org --name <NAME> [--id ID] [--phone NUMBER] [--email EMAIL] [--url URL] [--addr ADDRESS] [--tag TAG]...`<br> e.g., `add --org --name NUS --phone 0123456789 --email [email protected] --url https://www.nus.edu.sg/`
**Add Recruiter** | `add --rec --name <NAME> [--id ID] [--oid ORG_ID] [--phone NUMBER] [--email EMAIL] [--url URL] [--addr ADDRESS] [--tag TAG]...`<br> e.g., `add --rec --name John Doe --oid paypal-sg`
**Add Organization** | `add --org --name <NAME> [--id ID] [--phone NUMBER] [--email EMAIL] [--url URL] [--address ADDRESS] [--tag TAG]...`<br> e.g., `add --org --name NUS --phone 0123456789 --email [email protected] --url https://www.nus.edu.sg/`
**Add Recruiter** | `add --rec --name <NAME> [--id ID] [--oid ORG_ID] [--phone NUMBER] [--email EMAIL] [--url URL] [--address ADDRESS] [--tag TAG]...`<br> e.g., `add --rec --name John Doe --oid paypal-sg`
**Clear** | `clear`
**Delete** | `delete INDEX [--recursive]` or <br> `delete --id ID [--recursive]` <br> e.g., `delete 3`, `delete --id 55tg`
**Delete** | `delete INDEX/ID [--recursive]` <br> e.g., `delete 3`, `delete id-55tg`
**Edit** | `edit INDEX ...` or <br>`edit ID ...` or <br>`edit --application INDEX ...`
**Find** | `find KEYWORD [MORE_KEYWORDS]`<br> e.g., `find James Jake`
**Apply** | `apply INDEX [--title TITLE] [--desc DESCRIPTION] [--by DEADLINE] [--stage STAGE] [--stat STATUS]` or <br>`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`


14 changes: 5 additions & 9 deletions src/main/java/seedu/address/logic/commands/AddCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
))
Expand Down Expand Up @@ -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 + " "
Expand All @@ -99,8 +92,6 @@ public class AddCommand extends Command {
+ FLAG_EMAIL + " [email protected] "
+ 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 ";

Expand Down Expand Up @@ -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.
*
* <p>
* TODO: This class should be made abstract.
* </p>
*/
@Deprecated
public AddCommand(Name name, Id id, Phone phone, Email email, Url url, Address address, Set<Tag> tags) {
requireAllNonNull(name, id, tags);
this.name = name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
*/
public class AddOrganizationCommand extends AddCommand {

protected final Status status;
protected final Position position;
protected final Set<Id> rids;

/**
Expand All @@ -42,8 +40,6 @@ public AddOrganizationCommand(
Set<Id> rids
) {
super(name, id, phone, email, url, address, tags);
this.status = status;
this.position = position;
this.rids = rids;
}

Expand All @@ -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
Expand All @@ -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);
}

Expand All @@ -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);
}
}
3 changes: 0 additions & 3 deletions src/main/java/seedu/address/logic/commands/EditCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 ";

Expand Down
33 changes: 5 additions & 28 deletions src/main/java/seedu/address/logic/parser/AddCommandParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down Expand Up @@ -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<String> 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<Tag> tagList = ParserUtil.parseTags(argMultimap.getAllValues(FLAG_TAG));

return new AddCommand(name, id, phone, email, url, address, tagList);
}

private AddRecruiterCommand parseAsRecruiter(ArgumentMultimap argMultimap) throws ParseException {
Expand Down Expand Up @@ -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<String> idString = argMultimap.getValue(FLAG_ID);
Expand All @@ -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<Tag> tagList = ParserUtil.parseTags(argMultimap.getAllValues(FLAG_TAG));
Set<Id> 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);
}
}
16 changes: 8 additions & 8 deletions src/main/java/seedu/address/logic/parser/CliSyntax.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@
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");
public static final Flag FLAG_DESCENDING = new Flag("descending");
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");


}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand All @@ -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()));
}
Expand Down
Loading

0 comments on commit 25b0cb6

Please sign in to comment.