Skip to content

Commit

Permalink
Merge pull request #225 from Fureimi/master
Browse files Browse the repository at this point in the history
change class diagram of EditCommand
  • Loading branch information
Fureimi committed Apr 15, 2024
2 parents 3e3d461 + 6a6453f commit 0c4fe17
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 40 deletions.
Binary file modified docs/Diagrams/Images/Itemlist/EditCommand_ClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 23 additions & 40 deletions docs/Diagrams/PUML files/Itemlist/EditCommand_ClassDiagram.puml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@startuml
!include ../Style.puml

class EditCommand {
- itemName : String
- newItemName : String
Expand All @@ -9,15 +8,7 @@ class EditCommand {
- newCategory : String
- newBuyPrice : float
- newSellPrice : float

+ EditCommand(itemName: String, newItemName: String, newQuantity: int, newUnitOfMeasurement: String, newCategory: String, newBuyPrice: float, newSellPrice: float)
+ getItemName() : String
+ getNewItemName() : String
+ getNewQuantity() : int
+ getNewUnitOfMeasurement() : String
+ getNewCategory() : String
+ getNewBuyPrice() : float
+ getNewSellPrice() : float
+ EditCommand(...)
+ execute() : void
}

Expand All @@ -28,45 +19,37 @@ class Item {
- category : String
- buyPrice : float
- sellPrice : float
- isOOS : boolean

+ setItemName(newName: String)
+ setQuantity(newQuantity: int)
+ setUnitOfMeasurement(newUnit: String)
+ setCategory(newCategory: String)
+ setBuyPrice(newPrice: float)
+ setSellPrice(newPrice: float)
+ getItemName() : String
+ getQuantity() : int
+ getUnitOfMeasurement() : String
+ getCategory() : String
+ getBuyPrice() : float
+ getSellPrice() : float
+ markOOS()
+ unmarkOOS()
}

class Itemlist {
- items : ArrayList<Item>
+ getItems() : List<Item>
+ getItem(index: int) : Item'
}

+ getItems() : ArrayList<Item>
+ getItem(index: int) : Item
+ overwriteFile(items : ArrayList<Item>)
class Promotion {
- itemName : String
+ setItemName(newItemName: String) : void
}

class TextUi {
+ replyToUser(message: String)
+ showEditMessage(oldValue: String, attribute: String, newValue: String)
class Promotionlist {
+ itemIsOnPromo(itemName: String) : boolean
+ getPromotion(itemName: String) : Promotion
+ getAllPromotion() : List<Promotion>
}

class Storage {
+ overwriteFile(items : ArrayList<Item>)
+ overwriteFile(items: List<Item>) : void
}

class PromotionStorage {
+ overwritePromotionFile(promotions: List<Promotion>) : void
}

EditCommand -- "0..*" Item
EditCommand -- "1" Itemlist
EditCommand -- "1" TextUi
EditCommand -- "1" Storage
hide circle
skinparam classAttributeIconSize 0
EditCommand -> Item
EditCommand --> Itemlist
EditCommand --> Promotion : uses >
EditCommand --> Promotionlist
Storage <-- EditCommand
PromotionStorage <-- EditCommand

@enduml

0 comments on commit 0c4fe17

Please sign in to comment.