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

Modify delete using student number #56

Conversation

ChangruHenryQian
Copy link

Closes #55

@ChangruHenryQian ChangruHenryQian added this to the v1.2 milestone Oct 13, 2023
@ChangruHenryQian ChangruHenryQian requested a review from a team October 13, 2023 07:16
Copy link

@LWZ19 LWZ19 left a comment

Choose a reason for hiding this comment

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

LGTM. Just some issues with code style and formatting, and making the code pass CI. 😊
One small suggestion for future iterations could be to include both delete by index or student number, but both cannot be supplied at once.

@@ -14,7 +14,9 @@ public class Messages {

public static final String MESSAGE_UNKNOWN_COMMAND = "Unknown command";
public static final String MESSAGE_INVALID_COMMAND_FORMAT = "Invalid command format! \n%1$s";
public static final String MESSAGE_INVALID_PERSON_DISPLAYED_INDEX = "The person index provided is invalid";
public static final String MESSAGE_INVALID_PERSON_DISPLAYED_INDEX = "The peron index provided is invalid";
Copy link

Choose a reason for hiding this comment

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

Small spelling mistake here for 'person'

Comment on lines 20 to 22
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Deletes a person. "
+ "Parameters: "
+ PREFIX_STUDENTNUMBER + "STUDENT NUMBER"
Copy link

Choose a reason for hiding this comment

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

Newline could be added for better readability. 😊

Suggested change
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Deletes a person. "
+ "Parameters: "
+ PREFIX_STUDENTNUMBER + "STUDENT NUMBER"
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Deletes a person.\n"
+ "Parameters: "
+ PREFIX_STUDENTNUMBER + "STUDENT NUMBER\n"

throw new CommandException(Messages.MESSAGE_INVALID_STUDENT_NUMBER);
}

if (!model.hasPerson(new Person(targetStudentNumber))) {

Choose a reason for hiding this comment

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

Is it possible to check if model has person using Student number without creating a Person object?

@codecov
Copy link

codecov bot commented Oct 14, 2023

Codecov Report

Merging #56 (a1c3acd) into master (ada8dc3) will increase coverage by 0.05%.
The diff coverage is 94.11%.

@@             Coverage Diff              @@
##             master      #56      +/-   ##
============================================
+ Coverage     77.28%   77.34%   +0.05%     
+ Complexity      492      491       -1     
============================================
  Files            78       78              
  Lines          1585     1598      +13     
  Branches        158      153       -5     
============================================
+ Hits           1225     1236      +11     
- Misses          313      314       +1     
- Partials         47       48       +1     
Files Coverage Δ
src/main/java/seedu/address/logic/Messages.java 88.88% <ø> (ø)
...va/seedu/address/logic/commands/DeleteCommand.java 100.00% <100.00%> (ø)
...a/seedu/address/logic/parser/AddCommandParser.java 100.00% <100.00%> (ø)
...a/seedu/address/logic/parser/ArgumentMultimap.java 100.00% <100.00%> (ø)
src/main/java/seedu/address/model/AddressBook.java 84.37% <100.00%> (+1.04%) ⬆️
src/main/java/seedu/address/model/Model.java 100.00% <ø> (ø)
...rc/main/java/seedu/address/model/ModelManager.java 100.00% <100.00%> (ø)
...c/main/java/seedu/address/model/person/Person.java 97.67% <100.00%> (+0.17%) ⬆️
...a/seedu/address/model/person/UniquePersonList.java 87.75% <100.00%> (+0.79%) ⬆️
...eedu/address/logic/parser/DeleteCommandParser.java 87.50% <85.71%> (-12.50%) ⬇️
... and 1 more

@Cikguseven Cikguseven merged commit ca88cee into AY2324S1-CS2103T-T11-1:master Oct 14, 2023
5 checks passed
@Cikguseven
Copy link

LGTM!

@ChangruHenryQian ChangruHenryQian added the type.Story A user story label Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority.High Must do type.Story A user story
Projects
None yet
Development

Successfully merging this pull request may close these issues.

As a TA, I want to be able to delete students from the class
3 participants