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

Branch-Add-Json #76

Merged
merged 3 commits into from
Mar 28, 2024

Conversation

KhoonSun47
Copy link

Use Case 8: Add Data and Load Data from Json

  • Able to add buyer and seller data into Json, and load these data from Json
  • Able to load the preset data (if AddressBook.json is missing)
  • Able to display these data in alphabetical order (this will only be arranged when you load data from AddressBook.json, not when you add data to AddressBook.json)
  • Able to see houses data for seller

Changes made:

  • Messages.java: Edit comment
  • AddBuyerCommand.java, AddSellerCommand.java: Edit comment
  • AddBuyerCommandParser: Update Person person to Buyer buyer
  • House.java, Landed.java, Non-landed.java: Update toString()
  • SampleDataUtil.java: Update sample datas to work with new JsonSerializableAddressBook
  • JsonAdaptedHouse.java: Update to check for invalid field
  • JsonSerializableAddressBook: Update methods to add buyer, toModelType will arrange data
    in alphabetical order
  • PersonCard.java: Update method to display houses, buyer and seller
  • duplicatePersonAddressBook, invalidPersonAddressBook, typicalPersonAddressBook:
  • Update json to include buyer
  • JsonAdaptedBuyerTest: Add test cases to test JsonAdaptedBuyer
  • JsonAdaptedHouseTest: Update test cases to test for invalid field
  • JsonSerializableAddressBookTest: Add test case to test for alphabetical order in list
  • TypicalPerson: Add buyers to test new test cases that involves buyers

* master:
  Update PUML
  Update UML diagram
  Update puml diagram
  Update puml for class diagram
  Add Class Level, UnitNumber, and link PostalCode and Street to Seller
  Add classes Buyer, Seller, PostalCode and Street. Buyer and Seller extend Person.
Add functionality to load data and add data to the addressbook

Messages.java: Edit comment

AddBuyerCommand.java, AddSellerCommand.java: Edit comment

AddBuyerCommandParser: Update Person person to Buyer buyer

House.java, Landed.java, Non-landed.java: Update toString()

SampleDataUtil.java: Update sample datas to work with new JsonSerializableAddressBook

JsonAdaptedHouse.java: Update to check for invalid field

JsonSerializableAddressBook: Update methods to add buyer, toModelType will arrange data
in alphabetical order

PersonCard.java: Update method to display houses, buyer and seller

duplicatePersonAddressBook, invalidPersonAddressBook, typicalPersonAddressBook:
Update json to include buyer

JsonAdaptedBuyerTest: Add test cases to test JsonAdaptedBuyer

JsonAdaptedHouseTest: Update test cases to test for invalid field

JsonSerializableAddressBookTest: Add test case to test for alphabetical order in list

TypicalPerson: Add buyers to test new test cases that involves buyers
@KhoonSun47 KhoonSun47 added the US8 label Mar 27, 2024
@KhoonSun47 KhoonSun47 added this to the v1.3 milestone Mar 27, 2024
@KhoonSun47 KhoonSun47 self-assigned this Mar 27, 2024
Copy link

codecov bot commented Mar 27, 2024

Codecov Report

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

Project coverage is 72.43%. Comparing base (4ad1c1c) to head (fdc068f).
Report is 23 commits behind head on master.

Files Patch % Lines
.../java/seedu/address/model/util/SampleDataUtil.java 0.00% 19 Missing ⚠️
src/main/java/seedu/address/ui/PersonCard.java 0.00% 17 Missing ⚠️
...main/java/seedu/address/model/house/NonLanded.java 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #76      +/-   ##
============================================
+ Coverage     70.51%   72.43%   +1.92%     
- Complexity      482      501      +19     
============================================
  Files            87       86       -1     
  Lines          1662     1698      +36     
  Branches        160      173      +13     
============================================
+ Hits           1172     1230      +58     
+ Misses          443      422      -21     
+ Partials         47       46       -1     

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

.withPhone("82937163").withEmail("ali@gmail.com").withHousingType("HDB").withTags("friends").build();
public static final Person BEN = new BuyerBuilder().withName(VALID_NAME_BEN).withPhone(VALID_PHONE_BOB)
public static final Buyer BEN = new BuyerBuilder().withName(VALID_NAME_BEN).withPhone(VALID_PHONE_BOB)

Choose a reason for hiding this comment

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

Not really an issue, but you can consider following your previous variables names. (eg; BEN_BUYER)

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 will take note of this

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yep I agree

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.

Looks good to me!

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

@felixchanyy felixchanyy merged commit 0658640 into AY2324S2-CS2103-F09-1:master Mar 28, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants