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

Add reassign command #107

Merged
merged 9 commits into from
Oct 27, 2020
Merged

Conversation

tnsyn
Copy link

@tnsyn tnsyn commented Oct 26, 2020

The reassign command acts as an 'assignment edit'. Calling reassign edits the Worker, Shift and Role of an Assignment.

  • Create ReassignCommand class
  • Create ReassignCommandParser class
  • Add proper handling of AssignmentNotFoundException

Testing will be added in separate PR

Resolves #92

@tnsyn tnsyn added this to the v1.3 milestone Oct 26, 2020
Copy link

@wakululuu wakululuu left a comment

Choose a reason for hiding this comment

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

Looks good other than a suggestion that I think can be implemented.

@@ -14,6 +14,7 @@
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.Model;
import seedu.address.model.assignment.Assignment;
//import seedu.address.model.assignment.exceptions.AssignmentNotFoundException;

Choose a reason for hiding this comment

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

Maybe this can be removed if it's not needed.

Copy link
Author

Choose a reason for hiding this comment

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

Good catch, will delete!

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Reassigns a worker to a new shift in the "
+ "McScheduler by the index numbers used in the last worker and shift listings. "
+ "\nParameters: "
+ PREFIX_WORKER + "WORKER_INDEX (must be a positive integer) "

Choose a reason for hiding this comment

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

Would it be possible to allow the editing of the worker as well?

Copy link
Author

Choose a reason for hiding this comment

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

Good point, will make the change!

@codecov-io
Copy link

Codecov Report

Merging #107 into master will increase coverage by 6.63%.
The diff coverage is 6.32%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #107      +/-   ##
============================================
+ Coverage     59.26%   65.89%   +6.63%     
- Complexity      580      651      +71     
============================================
  Files           119      119              
  Lines          2251     2290      +39     
  Branches        264      276      +12     
============================================
+ Hits           1334     1509     +175     
+ Misses          846      703     -143     
- Partials         71       78       +7     
Impacted Files Coverage Δ Complexity Δ
.../seedu/address/logic/commands/ReassignCommand.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
.../seedu/address/logic/commands/UnassignCommand.java 96.29% <ø> (+96.29%) 9.00 <0.00> (+9.00)
.../seedu/address/logic/parser/AddressBookParser.java 61.53% <0.00%> (-2.47%) 12.00 <0.00> (ø)
...du/address/logic/parser/ReassignCommandParser.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...ain/java/seedu/address/logic/parser/CliSyntax.java 93.75% <100.00%> (+2.08%) 1.00 <0.00> (ø)
src/main/java/seedu/address/model/tag/Role.java 62.50% <100.00%> (+12.50%) 6.00 <0.00> (+1.00)
...eedu/address/model/worker/ShiftRoleAssignment.java
...eedu/address/model/shift/WorkerRoleAssignment.java
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update be06ac6...755db38. Read the comment docs.

Copy link

@wakululuu wakululuu left a comment

Choose a reason for hiding this comment

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

LGTM!

@wakululuu wakululuu merged commit abe8704 into AY2021S1-CS2103-F10-4:master Oct 27, 2020
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.

Add reassign command
3 participants