-
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 all 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,3 @@ | ||
Manifest-Version: 1.0 | ||
Main-Class: seedu.duke.StockMaster | ||
|
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 |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
@startuml | ||
!include Style.puml | ||
|
||
package "" as f { | ||
Class TextUi #LightBlue | ||
Class Parser #Magenta | ||
Class Main #SkyBlue | ||
Class Storage #Green | ||
Class Command #Grey | ||
Class Cashier #Orange | ||
Class PromotionList #Gold | ||
Class Itemlist #Tan | ||
} | ||
|
||
Class User #IndianRed | ||
file "Storage" as File #DarkOliveGreen { | ||
} | ||
file "TransactionLogs" as File2 #DarkOliveGreen { | ||
} | ||
file "PromotionStorage"" as File3 #DarkOliveGreen { | ||
} | ||
|
||
User -d-> TextUi | ||
TextUi --> Parser | ||
TextUi <--> Main | ||
TextUi <--> Storage | ||
Main --> Storage | ||
Main -l-> Parser | ||
Main --> Command | ||
Parser --> Command | ||
Command --> Cashier | ||
Command --> Itemlist | ||
Command --> PromotionList | ||
Itemlist <--> PromotionList | ||
Itemlist <--> Cashier | ||
|
||
Storage <-d-> File | ||
Storage <-r-> File2 | ||
Storage <-d-> File3 | ||
|
||
@enduml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@startuml | ||
!include ../Style.puml | ||
|
||
participant ":BestsellerCommand" as BestsellerCommand | ||
participant ":Cashier" as Cashier | ||
participant ":TextUi" as TextUi | ||
|
||
BestsellerCommand -> Cashier: getBestseller() | ||
activate Cashier | ||
Cashier -> Cashier: Retrieve bestseller | ||
Cashier --> BestsellerCommand: itemName | ||
deactivate Cashier | ||
BestsellerCommand -> TextUi: replyToUser("The current best-selling item is {itemName}") | ||
|
||
@enduml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
@startuml | ||
!include ../Style.puml | ||
|
||
class BestsellerCommand #LightGreen { | ||
+ execute() | ||
} | ||
class TotalProfitCommand #LightGreen { | ||
command: CommandType | ||
+ TotalProfitCommand(command) | ||
+ execute() | ||
} | ||
class ListCommand #LightGreen { | ||
- transactionList: ArrayList<Transaction> | ||
+ execute() | ||
} | ||
class SellCommand #LightGreen { | ||
+execute() | ||
} | ||
|
||
class TextUi #Tan { | ||
+replyToUser(text: String) | ||
} | ||
|
||
class Cashier #MistyRose { | ||
- transactions: ArrayList<Transaction> | ||
+ addItem(transaction: Transaction): void | ||
+ getTransactions(): ArrayList<Transaction> | ||
+ getTransactions(item: Item): ArrayList<Transaction> | ||
+ getTransaction(index: int): Transaction | ||
+ getTotalRevenue(): float | ||
+ getTotalProfit(): float | ||
+ getBestseller(): Item | ||
} | ||
|
||
class Transaction #LightSkyBlue { | ||
- dateTime: String | ||
- totalPrice: float | ||
- profit: float | ||
- item: String | ||
- quantity: int | ||
- buyPrice: float | ||
- sellPrice: float | ||
|
||
+ Transaction(String, int, float, float) | ||
+ Transaction(String, int, float, float, String) | ||
} | ||
|
||
class Item #LightBlue { | ||
+ isMark: boolean | ||
+ isOOS: boolean | ||
- itemName: String | ||
- quantity: int | ||
- unitOfMeasurement: String | ||
- category: String | ||
- buyPrice: float | ||
- sellPrice: float | ||
+Item(String, int, String, String, float, float) | ||
} | ||
|
||
BestsellerCommand -d->"uses" Cashier | ||
TotalProfitCommand-d->"uses" Cashier | ||
SellCommand-d->"uses" Cashier | ||
ListCommand-d->"uses" Cashier | ||
Cashier -r->TextUi | ||
Cashier --> Transaction : has 1..* | ||
Transaction --> Item : has 1 | ||
|
||
@enduml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
@startuml | ||
!include ../Style.puml | ||
participant ":Command" as Command | ||
participant ":TextUi" as TextUi | ||
participant ":Cashier" as Cashier | ||
|
||
-> Command: execute() | ||
activate Command | ||
Command -> Cashier: addItem(transaction) | ||
activate Cashier | ||
Cashier -> Cashier: transactions.add(transaction) | ||
return | ||
Command -> TextUi: showSellMessage() | ||
activate TextUi | ||
return | ||
alt if itemName is not given | ||
Command -> Cashier: getAllTransactions() | ||
activate Cashier | ||
return transactions | ||
Command -> TextUi : showTransactionsList(); | ||
activate TextUi | ||
return | ||
else if itemName is given | ||
Command -> Cashier: getTransactions(itemName) | ||
activate Cashier | ||
Cashier -> Cashier: Filter transactions | ||
return transactions | ||
Command -> TextUi: showTransactionsList() | ||
activate TextUi | ||
return | ||
end | ||
|
||
Command -> Cashier: getTransaction(index) | ||
activate Cashier | ||
Cashier -> Cashier: transactions.get(index) | ||
return transaction | ||
Command -> TextUi: showTransactionsList() | ||
activate TextUi | ||
return | ||
|
||
alt Revenue | ||
ref over Command, Cashier: getTotalRevenue | ||
else Profit | ||
ref over Command, Cashier: getTotalProfit | ||
end | ||
|
||
ref over Command, Cashier: getBestseller | ||
|
||
return | ||
@enduml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@startuml | ||
!include ../Style.puml | ||
|
||
participant ":TotalProfitCommand" as TotalProfitCommand | ||
participant ":Cashier" as Cashier | ||
participant ":TextUi" as TextUi | ||
|
||
|
||
mainframe sd | ||
alt get total revenue | ||
TotalProfitCommand -> Cashier: getTotalRevenue() | ||
activate Cashier | ||
Cashier -> Cashier: Calculate total revenue | ||
Cashier --> TotalProfitCommand: totalRevenue | ||
deactivate Cashier | ||
TotalProfitCommand -> TextUi: replyToUser("You have earned {totalRevenue} in revenue so far.") | ||
else get total profit | ||
TotalProfitCommand -> Cashier: getTotalProfit() | ||
activate Cashier | ||
Cashier -> Cashier: Calculate total profit | ||
Cashier --> TotalProfitCommand: totalProfit | ||
deactivate Cashier | ||
TotalProfitCommand -> TextUi: replyToUser("You have earned {totalProfit} in profits so far.") | ||
end | ||
|
||
@enduml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@startuml | ||
!include ../Style.puml | ||
|
||
actor User | ||
participant ":Parser" as Parser | ||
participant ":AddCommand" as AddCommand | ||
participant ":Itemlist" as Itemlist | ||
participant ":EditCommand" as EditCommand | ||
|
||
User -> Parser: add command | ||
activate Parser | ||
|
||
Parser -> AddCommand: prepareAdd(userInput) | ||
activate AddCommand | ||
activate Itemlist | ||
alt Item exists | ||
AddCommand -> EditCommand: edit Item | ||
activate EditCommand | ||
EditCommand -> Itemlist: editQuantity(index, newQuantity) | ||
deactivate EditCommand | ||
Itemlist --> AddCommand | ||
AddCommand -> User: Output success message | ||
else Item does not exist | ||
AddCommand -> Itemlist: addItem(item) | ||
Itemlist --> AddCommand | ||
|
||
AddCommand -> User: Output success message | ||
deactivate AddCommand | ||
end | ||
deactivate Itemlist | ||
deactivate Parser | ||
@enduml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
@startuml | ||
!include ../Style.puml | ||
class EditCommand { | ||
- itemName : String | ||
- newItemName : String | ||
- newQuantity : int | ||
- newUnitOfMeasurement : String | ||
- newCategory : String | ||
- newBuyPrice : float | ||
- newSellPrice : float | ||
+ EditCommand(...) | ||
+ execute() : void | ||
} | ||
|
||
class Item { | ||
- itemName : String | ||
- quantity : int | ||
- unitOfMeasurement : String | ||
- category : String | ||
- buyPrice : float | ||
- sellPrice : float | ||
} | ||
|
||
class Itemlist { | ||
+ getItems() : List<Item> | ||
+ getItem(index: int) : Item' | ||
} | ||
|
||
class Promotion { | ||
- itemName : String | ||
+ setItemName(newItemName: String) : void | ||
} | ||
|
||
class Promotionlist { | ||
+ itemIsOnPromo(itemName: String) : boolean | ||
+ getPromotion(itemName: String) : Promotion | ||
+ getAllPromotion() : List<Promotion> | ||
} | ||
|
||
class Storage { | ||
+ overwriteFile(items: List<Item>) : void | ||
} | ||
|
||
class PromotionStorage { | ||
+ overwritePromotionFile(promotions: List<Promotion>) : void | ||
} | ||
|
||
EditCommand -> Item | ||
EditCommand --> Itemlist | ||
EditCommand --> Promotion : uses > | ||
EditCommand --> Promotionlist | ||
Storage <-- EditCommand | ||
PromotionStorage <-- EditCommand | ||
|
||
@enduml |
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