Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into bug-fix-2
  • Loading branch information
dabzpengu committed Apr 14, 2024
2 parents ab484dd + c3a3cb3 commit 118d185
Show file tree
Hide file tree
Showing 15 changed files with 174 additions and 56 deletions.
2 changes: 1 addition & 1 deletion docs/AboutUs.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You can reach us at the email `seer[at]comp.nus.edu.sg`

[[homepage](https://github.com/ZHANGTIANYAO1)]
[[github](https://github.com/ZHANGTIANYAO1)]
[[portfolio](team/zhangtianyao.md)]
[[portfolio](team/zhangtianyao1.md)]

* Role: Project Advisor

Expand Down
126 changes: 89 additions & 37 deletions docs/UserGuide.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/diagrams/ModelClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Class Phone
Class Salary
Class Tag
Class ProgammingLanguage
Class JobDifficulty
Class Priority

Class I #FFFFFF
}
Expand All @@ -50,6 +52,8 @@ Person *--> Info
Person *--> CompanyName
Person *--> Salary
Person *--> InterviewTime
Person *--> JobDifficulty
Person *--> Priority
Person *--> "*" Tag
Person *-right-> "*" ProgammingLanguage

Expand Down
Binary file modified docs/images/ModelClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: page
title: CCBOT
---

[![CI Status](https://github.com/se-edu/addressbook-level3/workflows/Java%20CI/badge.svg)](https://github.com/se-edu/addressbook-level3/actions)
[![CI Status](https://github.com/se-edu/addressbook-level3/workflows/Java%20CI/badge.svg)](https://github.com/se-edu/addressbook-level3/actions)
[![codecov](https://codecov.io/gh/AY2324S2-CS2103T-T08-3/tp/graph/badge.svg?token=0RG4SRDBHW)](https://codecov.io/gh/AY2324S2-CS2103T-T08-3/tp)


Expand Down
40 changes: 40 additions & 0 deletions docs/team/zhangtianyao1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
layout: page
title: Zhang Tianyao's Project Portfolio Page
---

### Project: CCBOT

CCBOT is a desktop application for managing your job application details.** While it has a GUI, most of the user interactions happen using a CLI (Command Line Interface).

Given below are my contributions to the project.

* **New Feature**: Added the ability to sort person list.
* What it does: allows the user to sort the person list by name, company name, job difficulty, priority, salary, and interview date.
* Justification: This feature improves the product significantly because a user can easily find the person he/she wants to check.
* Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands.

* **New Feature**: Added the job difficulty model.
* What it does: allows the program auto calculate the job difficulty based on the job description.
* Justification: This feature improves the product significantly because a user can easily identify the job difficulty.
* Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands.

* **Project management**:
* Managed releases `v1.2` - `v1.4` (4 releases) on GitHub

* **Enhancements to existing features**:
* Add salary range to the person card (Pull requests [\#20]())
* Fix add command examples (Pull requests [\#35]())
* Add job difficulty comparator (Pull requests [\#69]())
* Add priority to person card (Pull requests [\#39]())

* **Documentation**:
* User Guide:
* Added documentation for the features `sort` and `job difficulty` [\#93]() [\#86]()
* Added documentation for the constraints of the `add`, `edit` and `add resume` command [\#169]()
* Developer Guide:
* Added implementation details of the `sort` feature.
* Added implementation details of the `job difficulty` feature.[\#54]()
* Update UML diagrams. [\#37]()
* Add UML diagrams for `sort` command. [\#43]()

6 changes: 5 additions & 1 deletion src/main/java/seedu/address/logic/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ public static String getErrorMessageForDuplicatePrefixes(Prefix... duplicatePref
*/
public static String format(Person person) {
final StringBuilder builder = new StringBuilder();
builder.append(person.getName())
builder.append("Company name: ")
.append(person.getCompanyName())
.append("; Name: ")
.append(person.getName())
.append("; Phone: ")
.append(person.getPhone())
.append("; Email: ")
Expand All @@ -49,6 +52,7 @@ public static String format(Person person) {
.append("; Salary: ")
.append(person.getSalary())
.append("$")
.append("; Info: ")
.append(person.getInfo())
.append("; Tags: ");
person.getTags().forEach(builder::append);
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/seedu/address/logic/commands/FilterCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ public abstract class FilterCommand extends Command {
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Filters the contact by various categories and "
+ "displays them as a list with index numbers.\n"
+ "Parameters:\n"
+ "- " + COMMAND_WORD + PREFIX_TAG + "TAG [MORE TAG]...\n"
+ "- " + COMMAND_WORD + PREFIX_SALARY + "SALARY_RANGE [MORE SALARY_RANGE]...\n"
+ "- " + COMMAND_WORD + PREFIX_INTERVIEWTIME + "INTERVIEW_TIME_RANGE [MORE INTERVIEW_TIME_RANGE]...\n"
+ "- " + COMMAND_WORD + PREFIX_PROGRAMMING_LANGUAGE
+ "- " + PREFIX_TAG + "TAG [MORE TAG]...\n"
+ "- " + PREFIX_SALARY + "SALARY_RANGE [MORE SALARY_RANGE]...\n"
+ "- " + PREFIX_INTERVIEWTIME + "INTERVIEW_TIME_RANGE [MORE INTERVIEW_TIME_RANGE]...\n"
+ "- " + PREFIX_PROGRAMMING_LANGUAGE
+ "PROGRAMMING_LANGUAGE [MORE PROGRAMMING_LANGUAGE]...\n"
+ "Example: " + COMMAND_WORD + " s/2000 5000-7000";
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ public class FilterInterviewTimeCommand extends FilterCommand {
+ "- from/INTERVIEW_TIME-INTERVIEW_TIME\n"
+ "Example:\n"
+ "- " + COMMAND_WORD + "before/020220241100 after/020220251100 from/030420240800-020520241100";
public static final String WRONG_INTERVIEW_TIME_RANGE_MESSAGE = "INTERVIEW_TIME_RANGE should be in the form of:\n"
+ "before/INTERVIEW_TIME\nor\n"
+ "after/INTERVIEW_TIME\nor\n"
+ "from/INTERVIEW_TIME-INTERVIEW_TIME\n"
+ "where INTERVIEW_TIME is in the form: " + InterviewTime.INTERVIEW_TIME_FORMAT
public static final String WRONG_INTERVIEW_TIME_RANGE_MESSAGE = "For INTERVIEW_TIME_RANGE starting with from/ :\n"
+ " Format: from/INTERVIEW_TIME-INTERVIEW_TIME\n"
+ " where:\n"
+ " 1) There are no white spaces before and after '-'\n"
+ " 2) The first INTERVIEW_TIME provided should be chronologically before or equal to the second "
+ "INTERVIEW_TIME\n"
+ " 3) INTERVIEW_TIME is in the form: " + InterviewTime.INTERVIEW_TIME_FORMAT
+ "\n Example: from/" + InterviewTime.EXAMPLE_INTERVIEW_TIME_FORMAT_1 + "-"
+ InterviewTime.EXAMPLE_INTERVIEW_TIME_FORMAT_2;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public CommandResult execute(Model model) {

@Override
public boolean equals(Object other) {
assert 1 == 1;
if (other == this) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ private static List<List<InterviewTime>> handleFromInterviewTime(ArgumentMultima
for (String interviewTime : range) {
rangeTimes.add(ParserUtil.parseInterviewTime(interviewTime));
}
if (rangeTimes.get(1).isBefore(rangeTimes.get(0))) {
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT,
FilterInterviewTimeCommand.WRONG_INTERVIEW_TIME_RANGE_MESSAGE));
}
interviewTimes.add(rangeTimes);
}
}
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/seedu/address/model/person/InterviewTime.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,15 @@ public boolean isWithinInterviewTimeRange(List<InterviewTime> range) {
} else if (before == null) {
return this.dateTime.isAfter(after);
} else {
return this.dateTime.isBefore(before) && this.dateTime.isAfter(after);
return (this.dateTime.isBefore(before) || this.dateTime.isEqual(before))
&& (this.dateTime.isAfter(after) || this.dateTime.isEqual(after));
}
}

public boolean isBefore(InterviewTime date) {
return this.dateTime.isBefore(date.getDateTime());
}

@Override
public String toString() {
DateTimeFormatter beautify = DateTimeFormatter.ofPattern("MMMM dd, yyyy hh:mm a", Locale.ENGLISH);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/person/Salary.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Represents a Person's salary in the address book.
*/
public class Salary {
public static final String MESSAGE_CONSTRAINTS = "Salaries should only contain numbers, with range [0, 4294967295] "
public static final String MESSAGE_CONSTRAINTS = "Salaries should only contain numbers, with range [0, 2147483647] "
+ "or two pure digital numbers with '-' in between. "
+ "There's no space on either side of '-'."
+ "Both digital numbers should be within the range [0, 2147483647]";
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/seedu/address/model/util/SampleDataUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,27 @@ public static Person[] getSamplePersons() {
+ "@example.com"),
new Address("Blk 30 Geylang Street 29, #06-40"),
new InterviewTime("121220221400"), new Salary("0"), new Info("Friend of boss"),
getTagSet("friends"), getProgrammingLanguageSet("Java"), 2),
getTagSet("friends"), getProgrammingLanguageSet("Java"), 0),
new Person(new CompanyName("Google"), new Name("Bernice Yu"), new Phone("99272758"),
new Email("[email protected]"), new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"),
new InterviewTime("121220221400"), new Salary("0"), new Info("Friend of boss"),
getTagSet("colleagues", "friends"), getProgrammingLanguageSet("Java"), 2),
getTagSet("colleagues", "friends"), getProgrammingLanguageSet("Java"), 1),
new Person(new CompanyName("Google"), new Name("Charlotte Oliveiro"), new Phone("93210283"),
new Email("[email protected]"), new Address("Blk 11 Ang Mo Kio Street 74, #11-04"),
new InterviewTime("121220221400"), new Salary("0"), new Info("Friend of boss"),
getTagSet("neighbours"), getProgrammingLanguageSet("Java"), 2),
new Person(new CompanyName("Google"), new Name("David Li"), new Phone("91031282"),
new Email("[email protected]"), new Address("Blk 436 Serangoon Gardens Street 26, #16-43"),
new InterviewTime("121220221400"), new Salary("0"), new Info("Friend of boss"),
getTagSet("family"), getProgrammingLanguageSet("Java"), 2),
getTagSet("family"), getProgrammingLanguageSet("Java"), 3),
new Person(new CompanyName("Google"), new Name("Irfan Ibrahim"), new Phone("92492021"),
new Email("[email protected]"), new Address("Blk 47 Tampines Street 20, #17-35"),
new InterviewTime("121220221400"), new Salary("0"), new Info("Friend of boss"),
getTagSet("classmates"), getProgrammingLanguageSet("Java"), 2),
getTagSet("classmates"), getProgrammingLanguageSet("Java"), 4),
new Person(new CompanyName("Amazon"), new Name("Roy Balakrishnan"), new Phone("92624417"),
new Email("[email protected]"), new Address("Blk 45 Aljunied Street 85, #11-31"),
new InterviewTime("121220221400"), new Salary("0"), new Info("Friend of boss"),
getTagSet("colleagues"), getProgrammingLanguageSet("Java"), 2),
getTagSet("colleagues"), getProgrammingLanguageSet("Java"), 0),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public void testIsWithinInterviewTimeRange() {
InterviewTime dateTimeAfterRange = new InterviewTime("121120271400");
InterviewTime dateTimeBeforeRange = new InterviewTime("121120201400");
InterviewTime dateTimeInRange = new InterviewTime("121120231400");
InterviewTime dateTimeEqualAfterDate = new InterviewTime("011120231400");
InterviewTime dateTimeEqualBeforeDate = new InterviewTime("121220240300");

// Interview time ranges
List<InterviewTime> wrongSize = Arrays.asList(null, null, null);
Expand Down Expand Up @@ -62,6 +64,10 @@ public void testIsWithinInterviewTimeRange() {
assertTrue(dateTimeAfterRange.isWithinInterviewTimeRange(validAfter));
assertTrue(dateTimeBeforeRange.isWithinInterviewTimeRange(validBefore));
assertTrue(dateTimeInRange.isWithinInterviewTimeRange(validRange));
assertTrue(dateTimeEqualAfterDate.isWithinInterviewTimeRange(validRange));
assertTrue(dateTimeEqualBeforeDate.isWithinInterviewTimeRange(validRange));



}
@Test
Expand Down

0 comments on commit 118d185

Please sign in to comment.