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 role-related commands and checks for valid roles #102

Merged

Conversation

wakululuu
Copy link

Resolves #81

@wakululuu wakululuu added this to the v1.3 milestone Oct 26, 2020
@codecov-io
Copy link

codecov-io commented Oct 26, 2020

Codecov Report

Merging #102 into master will decrease coverage by 3.01%.
The diff coverage is 36.90%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #102      +/-   ##
============================================
- Coverage     68.03%   65.02%   -3.02%     
- Complexity      651      666      +15     
============================================
  Files           117      125       +8     
  Lines          2212     2410     +198     
  Branches        258      283      +25     
============================================
+ Hits           1505     1567      +62     
- Misses          629      754     +125     
- Partials         78       89      +11     
Impacted Files Coverage Δ Complexity Δ
...main/java/seedu/address/commons/core/Messages.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...va/seedu/address/logic/commands/AssignCommand.java 92.30% <ø> (-0.38%) 14.00 <0.00> (ø)
...a/seedu/address/logic/commands/RoleAddCommand.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...eedu/address/logic/commands/RoleDeleteCommand.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
.../seedu/address/logic/commands/RoleListCommand.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...du/address/logic/commands/WorkerDeleteCommand.java 81.81% <ø> (ø) 8.00 <0.00> (ø)
...edu/address/logic/parser/RoleAddCommandParser.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
.../address/logic/parser/RoleDeleteCommandParser.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...du/address/logic/parser/ShiftAddCommandParser.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...u/address/logic/parser/ShiftEditCommandParser.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
... and 34 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 0a44896...e87c000. Read the comment docs.

@wakululuu wakululuu marked this pull request as draft October 27, 2020 06:54
@wakululuu wakululuu marked this pull request as ready for review October 27, 2020 09:08
*/
void deleteAssignment(Assignment target);
void deleteAssignment(Assignment target) throws AssignmentNotFoundException;
Copy link

Choose a reason for hiding this comment

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

Small comment but I think we don't have to throw this, since AssignmentNotFoundException is a runtime exception? Also a bit inconsistent with other methods like deleteWorker/deleteShift which do not throw WorkerNotFoundException/ShiftNotFoundException respectively

Copy link
Author

@wakululuu wakululuu Oct 27, 2020

Choose a reason for hiding this comment

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

It seems that it is a practice to make RuntimeExceptions checked exceptions if the client is able to recover from them (https://docs.oracle.com/javase/tutorial/essential/exceptions/runtime.html). But I do agree it is inconsistent with the other methods so I have changed the implementation of UnassignCommand#execute() itself.

*/
public void remove(Assignment toRemove) {
public void remove(Assignment toRemove) throws AssignmentNotFoundException {
Copy link

Choose a reason for hiding this comment

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

Same small issue!

Copy link

@tnsyn tnsyn left a comment

Choose a reason for hiding this comment

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

LGTM

@tnsyn tnsyn merged commit 960ad0c 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 role-related commands and checks
3 participants