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

Enhance Sales Functionality #105

Merged

Conversation

hakujitsu
Copy link

@hakujitsu hakujitsu commented Oct 14, 2020

Closes #102, closes #103, closes #104

In this PR, I have done the following:

  • Implement Date field for Sales
  • Add test for AddCommand, ListCommand and DeleteCommand
  • Fix the wrong message shown for ListCommand

In addition, I have also changed the implementation of AddCommand and DeleteCommand. Previously, they added the sale directly to the contact. However, it now creates a deep copy of the person, which is edited and placed into the list. This preserves the immutability of the Person object.

The previous implementation meant editing the UniqueSaleList
belonging to the specified person, which does not preserve the
immutability.

This new implementation clones the person and adds the sale to the
new person, thereby preserving immutability.
@codecov-io
Copy link

codecov-io commented Oct 14, 2020

Codecov Report

Merging #105 into master will increase coverage by 2.44%.
The diff coverage is 76.35%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #105      +/-   ##
============================================
+ Coverage     71.31%   73.75%   +2.44%     
- Complexity      837      877      +40     
============================================
  Files           132      132              
  Lines          2698     2774      +76     
  Branches        335      345      +10     
============================================
+ Hits           1924     2046     +122     
+ Misses          658      615      -43     
+ Partials        116      113       -3     
Impacted Files Coverage Δ Complexity Δ
...n/java/seedu/address/commons/core/GuiSettings.java 69.23% <ø> (ø) 5.00 <0.00> (ø)
...ava/seedu/address/logic/commands/ClearCommand.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...seedu/address/logic/commands/sale/ListCommand.java 90.47% <ø> (+71.42%) 7.00 <0.00> (+4.00)
.../seedu/address/logic/parser/AddressBookParser.java 74.46% <0.00%> (-1.62%) 18.00 <0.00> (ø)
...a/seedu/address/model/person/UniquePersonList.java 67.59% <0.00%> (-0.98%) 30.00 <0.00> (+1.00) ⬇️
.../java/seedu/address/storage/JsonAdaptedPerson.java 100.00% <ø> (ø) 13.00 <0.00> (ø)
src/main/java/seedu/address/ui/ChatBox.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
src/main/java/seedu/address/ui/CommandBox.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
src/main/java/seedu/address/ui/DialogBox.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
src/main/java/seedu/address/ui/MainWindow.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
... and 31 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 ba265f2...d141412. Read the comment docs.

Copy link

@jmleong666 jmleong666 left a comment

Choose a reason for hiding this comment

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

LGTM!

@jmleong666 jmleong666 merged commit 7f54cfd into AY2021S1-CS2103T-T11-1:master Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants