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 Postal Code #55

Merged

Conversation

KhoonSun47
Copy link

  • Add PostalCode, PostalCodeTest: to support add postal code functionalities

  • Update AddCommand: update add command to add postal code

  • Take note that current PR is only able to add postal code and view postal code, BUT cannot edit postal code.
    Editing of the postal code will need to be done during the next iterations.
  • Take note that adding of postal code to Person is just temporary (this PR is also a chance for me to test the refactoring of AB3 Codes). This functionality will be edited when we add the buyer and seller.
  • Add two new packages: 'Houses' under main and 'Houses' under test.

  • Update test cases and json files to have postal codes.

KhoonSun47 and others added 7 commits March 6, 2024 17:06
* 'master' of https://github.com/KhoonSun47/tp:
  Update EstateEase Developer Guide
  Add UC for home-seller requirement filtering
  Add UC for viewing home-buyer and home-seller requirements
  Add use case id
  Update numbering in use cases
  Omit the UI details in use cases
  Add new informations to the developer guide
  Remove traces of AB3
  Add new use cases to the developer guide
* 'master' of https://github.com/KhoonSun47/tp:
  Add use cases for US5, US13, US18
  Rearrange the sequence of use cases
  Update user story table
- Add PostalCode, PostalCodeTest: to support add postal code functionalities

- Update AddCommand: update add command to add postal code

* Take note that current commit is only able to add postal code, but cannot edit postal code.
Editing postal code will be done at the next iterations.
* Take note that adding of postal code to Person is the first version, since we will be adding
buyer and seller, and then attached the postal code to them instead.

- Add two new packages: 'Houses' under main and 'Houses' under test

- Update test cases and json files to have postal codes
@KhoonSun47 KhoonSun47 added the enhancement New feature or request label Mar 12, 2024
@KhoonSun47 KhoonSun47 added this to the v1.2 milestone Mar 12, 2024
@KhoonSun47 KhoonSun47 self-assigned this Mar 12, 2024
LogicManagerTest, CommandTestUtil, AddCommandParserTest, ParserUtilTest,
PersonTest, JsonAdaptedPersonTest, PersonBuilder, PersonUtil, TypicalPersons.java:
Fix stylecheck issues
Copy link

codecov bot commented Mar 12, 2024

Codecov Report

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

Project coverage is 75.79%. Comparing base (8eeb067) to head (81313f1).
Report is 1 commits behind head on master.

Files Patch % Lines
...ain/java/seedu/address/model/house/PostalCode.java 92.85% 1 Missing ⚠️
...c/main/java/seedu/address/model/person/Person.java 83.33% 1 Missing ⚠️
src/main/java/seedu/address/ui/PersonCard.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #55      +/-   ##
============================================
+ Coverage     75.26%   75.79%   +0.53%     
- Complexity      419      431      +12     
============================================
  Files            71       72       +1     
  Lines          1338     1376      +38     
  Branches        126      131       +5     
============================================
+ Hits           1007     1043      +36     
- Misses          301      303       +2     
  Partials         30       30              

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

@KhoonSun47 KhoonSun47 changed the title Branch Add Postal Code Add Postal Code Mar 13, 2024
Copy link

@limcaaarl limcaaarl left a comment

Choose a reason for hiding this comment

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

Other than the 1 comment I mentioned below, the rest looks good to me 👍👍

@@ -101,7 +101,8 @@ private static Person createEditedPerson(Person personToEdit, EditPersonDescript
Address updatedAddress = editPersonDescriptor.getAddress().orElse(personToEdit.getAddress());
Set<Tag> updatedTags = editPersonDescriptor.getTags().orElse(personToEdit.getTags());

return new Person(updatedName, updatedPhone, updatedEmail, updatedAddress, updatedTags);
return new Person(updatedName, updatedPhone, updatedEmail, updatedAddress,
personToEdit.getPostalCode(), updatedTags);

Choose a reason for hiding this comment

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

personToEdit.getPostalCode() this would return the original postal code instead of the new value.

But isn't this edit command? 😅😅 I don't think you have to touch this.

Copy link
Author

Choose a reason for hiding this comment

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

Yeap, I set it to be like this because I have not officially change the edit function yet for postal code. I think if I did not make any changes to the edit, the test cases for the edit will not pass, and hence the build will not go through at the GitHub. The current edit implementation is just temporary, I will edit this when I doing the next iteration. But yes, thanks for noticing and bringing it up :)

Update ParserUtil.java: Change one of the method to return correct result

Update ParserUtilTest.java: Add one missing test case
@@ -56,7 +56,7 @@ public class EditCommand extends Command {
private final EditPersonDescriptor editPersonDescriptor;

/**
* @param index of the person in the filtered person list to edit
* @param index of the person in the filtered person list to edit
Copy link
Collaborator

@felixchanyy felixchanyy Mar 15, 2024

Choose a reason for hiding this comment

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

Should the extra space be removed?

Copy link
Collaborator

@felixchanyy felixchanyy 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 syntax issue (additional space).

@felixchanyy felixchanyy merged commit 373f139 into AY2324S2-CS2103-F09-1:master Mar 15, 2024
5 checks passed
@@ -11,5 +11,6 @@ public class CliSyntax {
public static final Prefix PREFIX_EMAIL = new Prefix("e/");
public static final Prefix PREFIX_ADDRESS = new Prefix("a/");
public static final Prefix PREFIX_TAG = new Prefix("t/");
public static final Prefix PREFIX_POSTALCODE = new Prefix("postal/");
Copy link
Collaborator

@felixchanyy felixchanyy Mar 16, 2024

Choose a reason for hiding this comment

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

Perhaps using 'pc/' instead of 'postal/' would allow users to type faster?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants