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

Update add command to include block and room #63

Merged
merged 18 commits into from
Oct 12, 2020

Conversation

schoolex
Copy link

@schoolex schoolex commented Oct 6, 2020

No description provided.

@schoolex schoolex added priority.High Must do type.Task Not a story, bug, or an epic. labels Oct 6, 2020
@schoolex schoolex added this to the v1.2 milestone Oct 6, 2020
@schoolex schoolex marked this pull request as draft October 6, 2020 15:49
@codecov-io
Copy link

codecov-io commented Oct 8, 2020

Codecov Report

Merging #63 into master will increase coverage by 0.40%.
The diff coverage is 74.66%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #63      +/-   ##
============================================
+ Coverage     69.45%   69.85%   +0.40%     
- Complexity      431      441      +10     
============================================
  Files            77       79       +2     
  Lines          1401     1463      +62     
  Branches        146      151       +5     
============================================
+ Hits            973     1022      +49     
- Misses          387      397      +10     
- Partials         41       44       +3     
Impacted Files Coverage Δ Complexity Δ
.../java/seedu/address/logic/commands/AddCommand.java 100.00% <ø> (ø) 8.00 <0.00> (ø)
.../java/seedu/address/model/util/SampleDataUtil.java 20.00% <0.00%> (ø) 1.00 <0.00> (ø)
src/main/java/seedu/address/ui/PersonCard.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
.../seedu/address/logic/parser/EditCommandParser.java 87.87% <33.33%> (-5.67%) 13.00 <0.00> (ø)
...in/java/seedu/address/logic/parser/ParserUtil.java 91.07% <60.00%> (-6.76%) 20.00 <2.00> (+2.00) ⬇️
...rc/main/java/seedu/address/model/person/Block.java 70.00% <70.00%> (ø) 3.00 <3.00> (?)
src/main/java/seedu/address/model/person/Room.java 70.00% <70.00%> (ø) 3.00 <3.00> (?)
...java/seedu/address/logic/commands/EditCommand.java 95.55% <100.00%> (+0.55%) 12.00 <0.00> (ø)
...a/seedu/address/logic/parser/AddCommandParser.java 100.00% <100.00%> (ø) 5.00 <0.00> (ø)
...ain/java/seedu/address/logic/parser/CliSyntax.java 88.88% <100.00%> (+1.38%) 1.00 <0.00> (ø)
... and 4 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 6b1a35a...236a0dc. Read the comment docs.

@schoolex schoolex marked this pull request as ready for review October 8, 2020 08:38
@athuyaoo athuyaoo self-requested a review October 9, 2020 08:47
public Person(Name name, Phone phone, Email email, Address address, Set<Tag> tags) {
requireAllNonNull(name, phone, email, address, tags);
public Person(Name name, Phone phone, Email email, Address address, Set<Tag> tags, Block block, Room room) {
requireAllNonNull(name, phone, email, address, tags, room);

Choose a reason for hiding this comment

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

How come block doesn't need to be non null?

@schoolex schoolex linked an issue Oct 11, 2020 that may be closed by this pull request
Copy link

@athuyaoo athuyaoo 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! Only minor changes needed.

+ MATRICULATION_NUMBER_DESC_BOB,
String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddCommand.MESSAGE_USAGE));

// invalid matriculation number
assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB
+ GENDER_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND + INVALID_MATRICULATION_NUMBER_DESC,
MatriculationNumber.MESSAGE_CONSTRAINTS);
+ BLOCKROOM_DESC_BOB + GENDER_DESC_BOB + TAG_DESC_HUSBAND

Choose a reason for hiding this comment

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

Perhaps reducing the space by 4 would help conform to coding standards better.


// Manually added - Person's details found in {@code CommandTestUtil}
public static final Person AMY = new PersonBuilder().withName(VALID_NAME_AMY).withPhone(VALID_PHONE_AMY)
.withEmail(VALID_EMAIL_AMY).withAddress(VALID_ADDRESS_AMY).withTags(VALID_TAG_FRIEND)
.withGender(VALID_GENDER_AMY)
.withGender(VALID_GENDER_AMY).withBlock("A").withRoom("420")

Choose a reason for hiding this comment

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

Perhaps having VALID_BLOCK and VALID_ROOM will be better for conforming with standards

@@ -40,6 +41,7 @@
public static final String VALID_GENDER_BOB = "M";
public static final String VALID_TAG_HUSBAND = "husband";
public static final String VALID_TAG_FRIEND = "friend";
public static final String VALID_BLOCKROOM = "A420";

Choose a reason for hiding this comment

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

perhaps you can split this up to VALID_BLOCK and VALID_ROOM, so that you can reuse them? (especially in TypicalPersons.java)

You can make VALID_BLOCKROOM with the 2 as well.

Copy link
Author

@schoolex schoolex Oct 12, 2020

Choose a reason for hiding this comment

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

Will update this

Copy link

@athuyaoo athuyaoo left a comment

Choose a reason for hiding this comment

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

Sorry I overlooked a few changes! I think this should be the last.

Comment on lines 128 to 129
* Sets the {@code MatriculationNumber} of the {@code Person} that we are building.
* Sets the {@code gender} of the {@code Person} that we are building.

Choose a reason for hiding this comment

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

I think got small typo here. Matriculation number and gender?

Comment on lines 93 to 94
+ BLOCKROOM_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND
+ MATRICULATION_NUMBER_DESC_BOB + GENDER_DESC_BOB,

Choose a reason for hiding this comment

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

assertParseSuccess(parser, NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB
        + BLOCKROOM_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND
        + MATRICULATION_NUMBER_DESC_BOB + GENDER_DESC_BOB,

Should the indentation be 8 spaces here? https://se-education.org/guides/conventions/java/intermediate.html#layout

Comment on lines 99 to 100
+ BLOCKROOM_DESC_BOB + GENDER_DESC_BOB + TAG_DESC_FRIEND
+ MATRICULATION_NUMBER_DESC_AMY + MATRICULATION_NUMBER_DESC_BOB,

Choose a reason for hiding this comment

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

assertParseSuccess(parser, NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB
        + BLOCKROOM_DESC_BOB + GENDER_DESC_BOB + TAG_DESC_FRIEND
        + MATRICULATION_NUMBER_DESC_AMY + MATRICULATION_NUMBER_DESC_BOB,

Should the indentation be 8 spaces here? https://se-education.org/guides/conventions/java/intermediate.html#layout

Comment on lines 11 to 12


Choose a reason for hiding this comment

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

I think it's better to remove this space?

@@ -57,6 +62,15 @@ public Address getAddress() {
return address;
}


Choose a reason for hiding this comment

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

Same here, additional line can be removed.

@athuyaoo athuyaoo requested review from athuyaoo and removed request for athuyaoo October 12, 2020 04:43
@athuyaoo athuyaoo merged commit 4083f49 into AY2021S1-CS2103T-T11-2:master Oct 12, 2020
@schoolex schoolex linked an issue Oct 12, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority.High Must do type.Task Not a story, bug, or an epic.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add block and room number As a Hall admin managing residents, i can create residents records
3 participants