-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsequenceDiagram.puml
More file actions
54 lines (47 loc) · 1.36 KB
/
Copy pathsequenceDiagram.puml
File metadata and controls
54 lines (47 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
@startuml sequenceDiagram
actor Member
participant "DigitalLibrary" as DL
participant "m : Member" as M
participant "b : Book" as B
participant "newTxn : Transaction" as T
Member -> DL: Choose "Borrow Book" (Choice 3)
activate DL
DL -> M: borrowBook(books)
activate M
M -> M: check balance > 0
alt balance > 0
M --> DL: Print block message (clear fines)
else balance == 0
M -> M: check active borrows count
alt active borrows >= 3
M --> DL: Print borrow limit reached
else active borrows < 3
M --> Member: Prompt for ISBN
Member -> M: Input ISBN
M -> M: Find book in books list
activate B
M -> B: getISBN()
B --> M: ISBN
M -> B: isAvailable()
B --> M: isAvailable (true)
alt Book is available
M -> M: Generate unique Transaction ID
create T
M -> T: new Transaction(transactionId, member, book)
M -> T: borrowBook()
activate T
T -> B: borrowed()
B --> T
deactivate B
T --> M
deactivate T
M -> DL: Add transaction to transactions list
M --> Member: Print success and due date
else Book unavailable
M --> Member: Print unavailable message
end
end
end
deactivate M
deactivate DL
@enduml