-
Notifications
You must be signed in to change notification settings - Fork 0
/
mastery-task1-remove-book-SD.puml
48 lines (38 loc) · 1.36 KB
/
mastery-task1-remove-book-SD.puml
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
@startuml
<style>
title{
FontSize 24
}
sequenceDiagram {
LineColor red
alt{
LineColor red
}
}
</style>
skinparam actorBorderColor red
skinparam participantBorderColor red
title RemoveBookFromCatalog
actor Client #F6FF97
participant "Load Balancer/ECS" as LB #F6FF97
participant RemoveBookFromCatalogActivity #F6FF97
participant CatalogDao #F6FF97
database DynamoDB #F6FF97
Client -> LB : HTTP Request
LB -> RemoveBookFromCatalogActivity : execute(RemoveBookFromCatalogRequest)
RemoveBookFromCatalogActivity -> CatalogDao : removeBookFromCatalog(bookId)
CatalogDao -> DynamoDB : query for latest version of book
alt if bookId is not found OR is inactive
CatalogDao --> RemoveBookFromCatalogActivity : throw BookNotFoundException
RemoveBookFromCatalogActivity --> LB : transform to KindlePublishingClientException
LB --> Client : 400 response
else else continue
end
CatalogDao -> DynamoDB : save(Book) setting inactive attribute to true
DynamoDB -> CatalogDao : book data
CatalogDao -> RemoveBookFromCatalogActivity : return CatalogItemVersion
RemoveBookFromCatalogActivity -> RemoveBookFromCatalogActivity : convert CatalogItemVersion to Book Model
RemoveBookFromCatalogActivity -> RemoveBookFromCatalogActivity : create RemoveBookFromCatalogResponse
RemoveBookFromCatalogActivity -> LB : return RemoveBookFromCatalogResponse
LB -> Client : 200 response w/ data
@enduml