Bug 382 - Incorrect spending carry over when membership upgrades
Summary: Incorrect spending carry over when membership upgrades
Status: RESOLVED FIXED
Alias: None
Product: online shop management system
Classification: Unclassified
Component: Membership system (show other bugs)
Version: 1.0.0
Hardware: PC Windows
: High major
Assignee: shinglam7-c
URL:
Depends on:
Blocks:
 
Reported: 2020-11-01 15:31 HKT by shinglam7-c
Modified: 2020-11-01 21:12 HKT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description shinglam7-c 2020-11-01 15:31:15 HKT
The accumulated spending will get cleared when the membership upgrades.
For example, when the customer spend 1050 and upgrades to silver membership the accumulated spending will 0 instead of 50(expected output).
Steps to reproduce:
1.Create a new user instance
2.use add spending method to add 1050
3.use membership.getAccumulatedSpending() method
50 should be the expected output but 0 is observed
Comment 2 shinglam7-c 2020-11-01 21:12:18 HKT
This issue is resolved by adding a new constructor Membership(String name, double discountRate, double upgradeThreshold,Membership previousMembership) so the previous spending will be carried over.