-
Notifications
You must be signed in to change notification settings - Fork 4
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
Enhance Sales Functionality #105
Conversation
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 Report
@@ 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
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Closes #102, closes #103, closes #104
In this PR, I have done the following:
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.