-
Notifications
You must be signed in to change notification settings - Fork 1
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
Need some clarifications about renting and calculating points #21
Comments
For the first question, I think for every account, we gotta have an list where we track what items that the account itself |
I'm having lunch right now, I'll check back and reply later. |
Oh I misunderstood "at a time" sr. For that, we currently have a list for currentRentals, and the size of that list must be <= 2 for guest account. I thought it was "not to rent 2 items literally at 1 specific time". |
@vhpx What do you think? |
For most of the requirements, I think a simple As for account promotions, let's have public void levelUp(Account account) {
if (account.role == "VIP") return;
int resolvedTransactions = transactionManager.getTransactions(account, true);
if (account.role == "REGULAR" && resolvedTransactions >= 5) {
account.setRole("VIP");
return;
}
if (account.role == "GUEST" && resolvedTransactions >= 3) {
account.setRole("REGULAR");
return;
} for the public ArrayList<Transaction> getTransactions(Account account);
public ArrayList<Transaction> getTransactions(Account account, boolean resolved); |
About the VIP account with the points system. Add the |
@vhpx How would accounts pay for their rentals? Should we add another attribute which will be deducted when renting and increase when returning? |
That could work. Design it the way it make sense to you and I'll take a look. |
In the requirements, guest account can only rent maximum 2 items AT A TIME. So how can we convert AT A TIME into code? When we call the function rent(Item), each transaction is separate.
When VIP has >= 100 reward points -> rent 1 item for free means that all accounts has to pay for their rentals. My question is how would they pay for their rentals?
Only VIP accumulate reward points, so do we need to add another attribute
point
? Then how much point each account will receive or be deducted when making rentals?@vhpx
The text was updated successfully, but these errors were encountered: