1simjustin / pe

0 stars 0 forks source link

Buy command does not add item to list #5

Open 1simjustin opened 2 months ago

1simjustin commented 2 months ago

image.png

Logically, buying a new item from a supplier would add it to the stock of items. However, the application does not allow for this and instead requires users to key in a new command followed by a buy command which would greatly inconvenience users.

soc-se-bot commented 2 months ago

Team's Response

To buy a new item and add it to the inventory in a single "buy" command would require the "buy" command to have additional parameters for sell price and expiry date.

But here is the main issue: The user might not know whether the buy command is buying a new item, or adding to an existing item.

Suppose the user thinks he doesn't have any Milk in the inventory and wants to buy some Milk, and enters the command buy n/Milk q/20 buy_price/3 sell_price/5 e/30-04-2024. But if Milk already exists in the inventory, then the sell price and expiry date entered by the user would be redundant. If the user were to view the item list, he would be left wondering why the sell price and expiry date do not correspond to what he just entered.

The command can be modified such that the sell price and expiry date are only compulsory for buying a new item. However, if the user tries to buy an item that he does not have but thinks he has, he would enter the command without the sell price and expiry date, which would end up throwing an error, forcing the user to type out the full command again.

All these factors would significantly increase the complexity of the "buy" command, yet would not be much faster to type than 2 separate commands. Based on the separation of concerns principle, we decided to have 2 separate commands for this use case, so that each command would have its own clearly defined purpose.

We have identified this potential issue early on and have addressed it in the FAQ section of our user guide.

Screenshot 2024-04-20 203559.png

Items for the Tester to Verify

:question: Issue response

Team chose [response.NotInScope]

Reason for disagreement: [replace this with your explanation]


## :question: Issue severity Team chose [`severity.Low`] Originally [`severity.Medium`] - [ ] I disagree **Reason for disagreement:** [replace this with your explanation]