-
Notifications
You must be signed in to change notification settings - Fork 231
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
[CS2113-T15-4] StockMaster #45
base: master
Are you sure you want to change the base?
Changes from 250 commits
ce0ede8
07216af
9e03c6b
8093c63
9518a4b
d08e86d
5416497
3d963be
20cc9fa
d303915
bf960ce
5d000ad
b3a4a6a
313478c
f1d26f8
dae7003
ef053ea
49f6f99
800525e
f8901d7
4ba4675
0fd810e
bb74c23
192bf2e
12580e3
f6a53fc
2c72d23
dae6d6c
fa4f274
5b93e25
d87bae3
240f826
3054dce
90c4ff0
689e9fc
4eae720
1cadb5d
4dc3173
b57fb20
a50ef35
fcb74d1
13f80f8
6dd7581
d482ce3
ef479de
1d3b63a
e6a99b4
17f4dcf
81731e6
a88dc19
9e3f46c
57028b6
128bfb4
440965a
84085f2
eec36ca
a8ba256
422efa0
3ce8683
aa4cb96
f2404f0
f80ad98
357a176
c7c7d12
7002ddf
6fd86ed
b9d0400
fd3b464
a3b2d3a
df37d94
f2431ad
3c9742e
8a21b1e
acd9322
1a4eb83
4a7e061
2fe0186
a1789ae
a8ce114
be4c6ed
aab03a2
887dec5
1c67281
0b09ad7
cd6da3d
dee8d14
abd5eff
8133bdc
992e7ce
319278d
1f5b883
71195f9
09dcebd
32732ad
3d94eb5
daa5553
877bf0e
278b03a
42e2882
7db31fc
174e677
2e01714
d28f7ac
0ecfa0b
6bb8f0f
a373a25
194439a
ec68de6
90df63e
b782534
e17ec71
53f1e36
6ea4129
ce958b2
bf287a1
974ac07
f01c1a8
e95f304
3218d45
ac1893d
b664cab
5c4d8e9
33b84ca
3c1953a
f89d170
b9d65e9
38cd86f
17b4fd7
a957bbc
cdd9ea4
78d5d10
0085989
6914fba
2aba5da
2d10131
e28e748
d552f59
10697b7
105e955
9f0a697
eb59ebf
de98256
06d9a7e
cefeb07
3222737
41b8dcd
f83d093
76f73c5
9785e99
10c6d35
a2b40c4
19b9da6
d90f014
7ecf8b3
fc27959
88017f9
220d4a1
67f28a4
236bbc7
5504d2e
b15c2a4
11d9815
ad56d09
2d875a5
bc1ac64
c5b924c
70030f3
e5f4965
b7ab323
4ee8040
88036a8
a03a871
1683023
adebf26
a288034
a279e5b
b2f8aea
451e6dd
f49ab34
f039efd
c6125b1
6014ac3
c3a2da8
4fcfc49
66aef4f
428d41e
2de0bc2
8952566
6be78c0
b919e8c
d139b55
03a32a6
0af0b65
2a0436e
47f0306
1dcd0f8
b26ff83
327dc0d
be27e77
c54ae2c
0840840
5cb1e27
2b82ec2
bdef6c8
d73f1f3
59b5622
4718547
ae37ea6
2d72115
9d4caee
3e3d461
5844478
37f8f94
6a6453f
67c97c6
94ae2dd
26bd145
f36ca68
0c4fe17
2512105
032a5fc
81cbe8b
e34c4c8
842a9b3
0daa502
314d23f
11a052a
2674260
9fc25e7
cfd1a86
0f4ce44
9730867
515990a
f44550e
75adf1f
1da147b
416cc83
5ed4e86
3d1b5b1
506e453
a68914e
b346489
598dc37
b32453c
163d19e
5e301f4
0f7fb46
6b8d3d5
4e82f9f
53c817f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apple have a 50.0% discount | ||
Period: 2 APR 2024 to 4 APR 2024 | ||
Time: 1200 to 1500 | ||
apple iphone have a 10.0% discount | ||
Period: 1 APR 2024 to 4 FEB 2025 | ||
Time: 1300 to 1600 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
1. | [ ] | apple | Qty: 50 pieces | Cat: fruits | BuyPrice: $4.0 | SellPrice: $5.0 | ||
2. | [ ] | apple iphone | Qty: 10 pieces | Cat: electronics | BuyPrice: $100.0 | SellPrice: $500.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Date: 2024-04-03 20:24:38 | ||
Transaction ID: 1 | ||
Item Name: apple | ||
Quantity: 1 | ||
Unit Price: 2.5 | ||
Total Price: 2.5 | ||
Profit: -1.5 | ||
|
||
Date: 2024-04-03 20:24:46 | ||
Transaction ID: 2 | ||
Item Name: apple iphone | ||
Quantity: 1 | ||
Unit Price: 250.0 | ||
Total Price: 250.0 | ||
Profit: 150.0 | ||
|
||
Date: 2024-04-04 03:59:13 | ||
Transaction ID: 1 | ||
Item Name: apple | ||
Quantity: 10 | ||
Unit Price: 2.5 | ||
Total Price: 25.0 | ||
Profit: -15.0 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,4 +43,5 @@ checkstyle { | |
|
||
run{ | ||
standardInput = System.in | ||
} | ||
enableAssertions = true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# About us | ||
|
||
Display | Name | Github Profile | Portfolio | ||
--------|:----:|:--------------:|:---------: | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Doe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Don Joe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Ron John | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Don Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
Display | Name | Github Profile | Portfolio | ||
--------|:--------:|:----------------------------------------:|:---------: | ||
![](https://via.placeholder.com/100.png?text=Photo) | Low Tjun Lym | [Github](https://github.com/LowTL) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Fu Xueer | [Github](https://github.com/fxe025) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Heng Shu Hong | [Github](https://github.com/HengShuHong) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Joel Lim | [Github](https://github.com/joellimjr) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Min Guanlin | [Github](https://github.com/Fureimi) | [Portfolio](docs/team/johndoe.md) |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The document looks neat! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do consider adding in more visuals (sequence diagrams, class diagrams, etc.) for explanatory purposes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe the diagram is a bit small |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,34 +4,137 @@ | |
|
||
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} | ||
|
||
## Design & implementation | ||
## Design | ||
|
||
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} | ||
|
||
### Command | ||
The Command class is an abstract class which is extended to execute the various commands | ||
used in the product. | ||
|
||
{Describe the design of the product. Use UML diagrams and short code snippets where applicable.} | ||
### Exception | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you could elaborate more on how your exception works |
||
|
||
### Itemlist | ||
Itemlist class is an object which contains items to be added to the stock inventory list. Able to add items, remove functions, edit items inside | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like you meant to say |
||
the list. | ||
|
||
The `AddCommand` class extends the `Command` class, allowing users to add items to the `Itemlist` | ||
|
||
![AddCommand_SequenceDiagram](./Diagrams/AddCommand_Sequence_Diagram.png) | ||
|
||
### Item | ||
Item class is an object which represents an item in the stock inventory list. Stores data about the item such as item price, | ||
quantity of item, and others. | ||
### Parser | ||
Parser class processes user inputs and sieves out relevant details before calling the relevant methods. | ||
It contains command formats that must be adhered to for the methods to be called. | ||
### Storage | ||
Storage class contains methods to write description of items to the file `./StockMasterData.txt`, | ||
and retrieve information from the file when program restarts. | ||
### UI | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think your UI and Exception class is missing a description |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can add some description regarding your implementation for the functionalities |
||
<<<<<<< HEAD | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please delete the unnecessary lines :) ! |
||
### Cashier | ||
Cashier class extends Itemlist class | ||
![CashierCommands_SequenceDiagram](./Diagrams/CashierCommands_SequenceDiagram.png) | ||
|
||
======= | ||
## Implementation | ||
|
||
This section describes some noteworthy details on how certain features are implemented | ||
|
||
### [Proposed] Promotion feature | ||
|
||
The promotion mechanism is facilitated by `StockMaster`. It enables the user to design and create discount offers for his/her | ||
own business given a certain period and time. Additionally, it implements the following operations: | ||
* `promotion` | ||
* `del_promotion` | ||
* `list_promotions` | ||
|
||
|
||
The PromotionCommand will execute the appropriate command and prints messages to the user through the `TextUi`. | ||
|
||
**Add new promotion:** | ||
|
||
<img src="./Diagrams/AddPromotion.png" alt="Alt Text" width="250" height="250"> | ||
|
||
Example: | ||
|
||
``` | ||
promotion apple discount/50 period /from 1 Jan 2024 /to 31 Dec 2024 time from/ 0000 /to 2359 | ||
``` | ||
This command will add a new promotion by calling `addPromotion(promotion)` method in `Promotionlist.java`. The | ||
`addPromotion(promotion)` then calls `isItemExist(apple)` in `Itemlist.java` to check if the item exists in the inventory. | ||
|
||
Next, it subsequently calls multiple of its own methods, `isValidMonth(1, Jan, 2024)` and `isValidMonth(31, Dec, 2024)` | ||
to check if the date is valid. `isValidTime(0000, 2359)` is called to check if the time is valid | ||
|
||
Lastly `isOnPromo(apple)` is called to check if there is already an existing promotion on `apple`. If there is an existing | ||
promotion, the user will be unable to create another promotion for `apple`. | ||
|
||
**Delete promotion:** | ||
|
||
<img src="./Diagrams/DeletePromo.png" alt="Alt Text" width="300" height="200"> | ||
|
||
The promotion will be deleted by calling `deletePromotion(index)` method in `Promotionlist.java`. | ||
|
||
Example: `del_promo apple` | ||
|
||
**List promotion:** | ||
|
||
<img src="./Diagrams/ListPromotion.png" alt="Alt Text" width="300" height="150"> | ||
|
||
All of the `Promotions` will be shown to the user through the `TextUi`. | ||
|
||
Example: `list_promotions` | ||
>>>>>>> 066333f49202f21788226cf5159f4e6c67f2dbde | ||
|
||
## Product scope | ||
StockMaster allows users to use the following commands: | ||
* add: add an item, quantity, category, buy price and sell price | ||
* del: delete an item | ||
* edit: edit the quantity of an item | ||
* sell: sell a certain quantity of an item at a stated price | ||
* find: find a specific item using a keyword | ||
* list: list all items in the inventory | ||
* help: list all commands | ||
* exit: exit StockMaster | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hopefully, you can explain what the contents of each methods are and how the methods communicate with each related methods. This DG is to teach an interested developer how to contribute to the codebase. |
||
### Target user profile | ||
|
||
{Describe the target user profile} | ||
Small Business Owners who: | ||
* has a need to manage a significant number of inventory products | ||
* able to track revenue/loss of the business | ||
* prefer desktop apps over other types | ||
* can type fast | ||
* prefers typing to mouse interactions | ||
* is reasonably comfortable using CLI apps | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Target users are clearly defined. Good job! |
||
|
||
### Value proposition | ||
|
||
{Describe the value proposition: what problem does it solve?} | ||
Help small business owners organise and better manage their inventory faster than | ||
a typical mouse/GUI driven app | ||
|
||
|
||
## User Stories | ||
|
||
|Version| As a ... | I want to ... | So that I can ...| | ||
|--------|----------|---------------|------------------| | ||
|v1.0|new user|see usage instructions|refer to them when I forget how to use the application| | ||
|v2.0|user|find a to-do item by name|locate a to-do without having to go through the entire list| | ||
| Version | As a ... | I want to ... | So that I can ... | | ||
|---------|----------|-----------------------------|-------------------------------------------------------------| | ||
| v1.0 | new user | see usage instructions | refer to them when I forget how to use the application | | ||
| v1.0 | user | add new items | | | ||
| v1.0 | user | make changes to added items | change details about items such as quantity or price | | ||
| v1.0 | user | search for specific items | | | ||
| v2.0 | user | find a to-do item by name | locate a to-do without having to go through the entire list | | ||
|
||
## Non-Functional Requirements | ||
|
||
{Give non-functional requirements} | ||
|
||
## Glossary | ||
|
||
* *glossary item* - Definition | ||
* *CLI* - Command Line Interface, where the user types commands rather than clicking options. | ||
* *Item* - Item to be sold at the shop, with key information such as quantity, buying/selling price, description etc. | ||
|
||
## Instructions for manual testing | ||
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should add the return arrows to your sequence diagram There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good job in use red to diftinquish the parts. |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The sequence diagram is clear and easy to understand, good job! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good and clear format! |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am a bit confuse what does "BESTSELLER", "TOTAL_PROFIT", "TOTAL_REVENUE" means? |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe you could add both the activation bar and return arrows There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could try adding the activation bar and return arrows as well |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No problem for this diagram |
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.
I think you can add more visuals to aid in explaining your design and implementation