Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement feature: Assign tasks to specific persons #58

Merged
merged 12 commits into from
Mar 20, 2024

Conversation

ziyi22
Copy link

@ziyi22 ziyi22 commented Mar 20, 2024

Added functionality to assign tasks to specific persons in EffiTrack. Modified Task class to include a reference to the Person responsible for the task. Updated UniqueTaskList and AssignTaskCommand to handle the assignment of tasks to persons. Also added validation checks to ensure that a person can only have one task assigned at a time. Implemented necessary changes to ensure data consistency and integrity within the application.

@ziyi22 ziyi22 added this to the v1.2 milestone Mar 20, 2024
Copy link

codecov bot commented Mar 20, 2024

Codecov Report

Attention: Patch coverage is 61.83575% with 79 lines in your changes are missing coverage. Please review.

Project coverage is 73.59%. Comparing base (40e43c3) to head (20bff25).

Files Patch % Lines
...eedu/address/logic/commands/AssignTaskCommand.java 26.92% 16 Missing and 3 partials ⚠️
.../java/seedu/address/model/task/UniqueTaskList.java 60.00% 8 Missing and 6 partials ⚠️
...c/main/java/seedu/address/model/task/Deadline.java 37.50% 10 Missing ⚠️
...in/java/seedu/address/storage/JsonAdaptedTask.java 62.96% 5 Missing and 5 partials ⚠️
src/main/java/seedu/address/model/task/Task.java 80.00% 2 Missing and 3 partials ⚠️
.../address/logic/parser/AssignTaskCommandParser.java 72.72% 1 Missing and 2 partials ⚠️
...ava/seedu/address/logic/parser/ParserTaskUtil.java 72.72% 3 Missing ⚠️
...rc/main/java/seedu/address/model/ModelManager.java 62.50% 3 Missing ⚠️
...u/address/storage/JsonSerializableAddressBook.java 70.00% 2 Missing and 1 partial ⚠️
src/main/java/seedu/address/logic/Messages.java 0.00% 2 Missing ⚠️
... and 5 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #58      +/-   ##
============================================
- Coverage     75.54%   73.59%   -1.96%     
- Complexity      445      494      +49     
============================================
  Files            75       84       +9     
  Lines          1427     1632     +205     
  Branches        137      161      +24     
============================================
+ Hits           1078     1201     +123     
- Misses          314      373      +59     
- Partials         35       58      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@howen02 howen02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ziyi22 ziyi22 linked an issue Mar 20, 2024 that may be closed by this pull request
@ziyi22 ziyi22 merged commit 31cd0de into AY2324S2-CS2103T-T14-1:master Mar 20, 2024
3 of 5 checks passed
@@ -92,6 +112,45 @@ public void setPerson(Person target, Person editedPerson) {
*/
public void removePerson(Person key) {
persons.remove(key);
tasks.remove(key.getTask());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line would throw an NullPointerException if the person do not have any task.

Suggested change
tasks.remove(key.getTask());
Task task = key.getTask();
if (task != null) {
tasks.remove(key.getTask());
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

As a HR Manager, I can assign tasks to employees
3 participants