Skip to content
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

Resolve UML diagram for removeTransaction method #137

Merged
merged 2 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 30 additions & 18 deletions docs/uml/removeTransactionDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,34 @@ autonumber
actor User
participant "TransactionManager" as TM
participant "UserInterface" as UI
participant "AccountManager" as AM

participant ":AccountManager" as AM
participant ":Account" as AC
participant "EmptyArgumentException" as EAE
participant "InvalidIndexException" as IIE
User -> TM: removeTransaction [delete index]
TM -> UI: validateInput(input) // Implicit interaction to check for empty input
activate UI
deactivate UI
TM -> TM: parseData(data)
TM -> AM: getAccountByAccountNumber(accountNumber)
activate AM
AM --> TM: account
deactivate AM
TM -> TM: getTransaction(id)
TM --> TM: removeTransaction(id)
TM -> account: setBalance(newBalance)
TM -> UI: printDeleteMessage(itemRemoved, newBalance)
activate UI
UI --> User: Display delete confirmation message
deactivate UI
@enduml

alt input.trim().length() >= DELETE_BEGIN_INDEX
TM -> TM: parseData(data)
TM -> AM: getAccountByAccountNumber(accountNumber)
activate AM
AM --> TM: :Account
deactivate AM

TM -> TM: getTransaction(id)
TM -> TM: removeTransaction(id)

TM -> AC: setBalance(newBalance)

alt id >= LOWER_BOUND and id < size
TM -> UI: printDeleteMessage(itemRemoved, newBalance)
activate UI
UI --> TM: Display delete confirmation message
deactivate UI
TM --> User: Confirmation message
else
TM -> IIE: throw InvalidIndexException
end
else
TM -> EAE: throw EmptyArgumentException
end
@enduml
Binary file modified docs/uml/uml-images/removeTransactionDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading