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 Budget class for Buyer class #79

Merged

Conversation

felixchanyy
Copy link
Collaborator

Addition of the Budget class is necessary to represent the budget attribute for Buyer objects.

Implemented the Budget class to encapsulate the budget information for buyers, allowing for better organization and management of budget-related data.

Using a separate class for budget ensures separation of concerns and follows the single responsibility principle, improving code readability and maintainability.

This commit also includes necessary adjustments to integrate the Budget class with the Buyer class.

Addition of the Budget class is necessary to represent the budget
attribute for Buyer objects.

Implemented the Budget class to encapsulate the budget information
for buyers, allowing for better organization and management of
budget-related data.

Using a separate class for budget ensures separation of concerns and
follows the single responsibility principle, improving code
readability and maintainability.

This commit also includes necessary adjustments to integrate the
Budget class with the Buyer class.
@felixchanyy felixchanyy added the enhancement New feature or request label Mar 28, 2024
@felixchanyy felixchanyy added this to the v1.3 milestone Mar 28, 2024
@felixchanyy felixchanyy self-assigned this Mar 28, 2024
Copy link

codecov bot commented Mar 28, 2024

Codecov Report

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

Project coverage is 72.54%. Comparing base (fdc068f) to head (feaef10).
Report is 1 commits behind head on master.

Files Patch % Lines
...c/main/java/seedu/address/model/person/Budget.java 57.14% 3 Missing and 3 partials ⚠️
src/main/java/seedu/address/ui/PersonCard.java 0.00% 3 Missing ⚠️
...in/java/seedu/address/logic/parser/ParserUtil.java 60.00% 1 Missing and 1 partial ⚠️
...du/address/logic/parser/AddBuyerCommandParser.java 75.00% 0 Missing and 1 partial ⚠️
...rc/main/java/seedu/address/model/person/Buyer.java 95.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #79      +/-   ##
============================================
+ Coverage     72.43%   72.54%   +0.10%     
- Complexity      501      515      +14     
============================================
  Files            86       87       +1     
  Lines          1698     1748      +50     
  Branches        173      178       +5     
============================================
+ Hits           1230     1268      +38     
- Misses          422      430       +8     
- Partials         46       50       +4     

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

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

@KhoonSun47 KhoonSun47 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 comments to take note of.

@@ -16,4 +16,5 @@ public class CliSyntax {
public static final Prefix PREFIX_UNITNUMBER = new Prefix("unitNo/");
public static final Prefix PREFIX_BLOCK = new Prefix("blk/");
public static final Prefix PREFIX_POSTALCODE = new Prefix("postal/");
public static final Prefix PREFIX_BUDGET = new Prefix("b/");

Choose a reason for hiding this comment

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

Do you think it is better to explicitly name the prefix as budget/ ?

Not really a big issue, just a personal preference.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should be fine I feel, like name is also "n/". We can discuss during meeting.

* Returns true if a given string is a valid budget amount.
*/
public static boolean isValidBudget(String test) {
return test.matches(VALIDATION_REGEX) && Double.parseDouble(test) >= 0;

Choose a reason for hiding this comment

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

Can a budget be $0? And is there a minimum and maximum a budget can be?

Things to consider, depends on our team requirement (need to ask them).

@felixchanyy felixchanyy merged commit dcb3bc9 into AY2324S2-CS2103-F09-1:master Mar 29, 2024
5 checks passed
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