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 group command #100

Merged
merged 6 commits into from
Mar 28, 2024
Merged

Add group command #100

merged 6 commits into from
Mar 28, 2024

Conversation

Rikko1204
Copy link

No description provided.

Copy link

codecov bot commented Mar 26, 2024

Codecov Report

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

Project coverage is 76.86%. Comparing base (344512f) to head (42fa870).

❗ Current head 42fa870 differs from pull request most recent head bafa832. Consider uploading reports for the commit bafa832 to get more accurate results

Files Patch % Lines
...seedu/address/logic/parser/GroupCommandParser.java 50.00% 1 Missing and 3 partials ⚠️
...ava/seedu/address/logic/commands/GroupCommand.java 92.10% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #100      +/-   ##
============================================
+ Coverage     76.29%   76.86%   +0.56%     
+ Complexity      545      535      -10     
============================================
  Files            84       82       -2     
  Lines          1772     1716      -56     
  Branches        187      176      -11     
============================================
- Hits           1352     1319      -33     
+ Misses          360      340      -20     
+ Partials         60       57       -3     

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

@@ -48,101 +47,116 @@ public class GroupCommand extends Command {
+ PREFIX_GROUP + "Class T15 "
+ PREFIX_TAG + "TA";

private final NusId toGroup;
private final Set<NusId> toGroup;
Copy link

Choose a reason for hiding this comment

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

Good use of Set<NusId> here

* If {@code nusIds} contain only one element which is an empty string, it will be parsed into a
* {@code Set<NusId>} containing zero nusId.
*/
private Optional<Set<NusId>> parseNusIdsForGroup(Collection<String> nusIds) throws ParseException {
Copy link

Choose a reason for hiding this comment

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

I don't think there is a need to wrap the set of NUSID in an optional, when you are going to get the set later on and using it to filter the person list.

Copy link

Choose a reason for hiding this comment

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

I think a set is sufficient enough

nusIds.add(person.getNusId());
}

GroupCommand.GroupPersonDescriptor descriptor = new GroupPersonDescriptorBuilder(groupedPersons).build();
Copy link

Choose a reason for hiding this comment

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

I think you can import the nested class into the test class instead of using the dot operator


String userInput = " id/" + nusId + GROUP_DESC_HUSBAND + TAG_DESC_AMY;
Copy link

Choose a reason for hiding this comment

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

We didn't catch this earlier; but we should use the prefixes made in logic.parser.CliSyntax instead of adding it as a String itself

String defaultNusId = "E1234567";
NusId nusid = new NusId((defaultNusId));
NusId nusId = new NusId((defaultNusId));
Copy link

Choose a reason for hiding this comment

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

Why is there double bracket here??

}

@Test
public void execute_invalidPersonIndexFilteredList_failure() {
public void execute_partialInvalidPersonsNusIdFilteredList_failure() {

Choose a reason for hiding this comment

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

nit: might be nice to explain what this testcase does since "partial invalid" is not immediately clear what the test does

@hjuntan hjuntan added this to the v1.3 milestone Mar 28, 2024
@hjuntan hjuntan linked an issue Mar 28, 2024 that may be closed by this pull request
@hjuntan
Copy link

hjuntan commented Mar 28, 2024

Closes #92

@hjuntan hjuntan merged commit 3941689 into master Mar 28, 2024
6 checks passed
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.

Group multiple ID to same group
4 participants