mirror of
https://github.com/3ybactuk/marketplace-go-service-project.git
synced 2025-10-30 22:13:44 +03:00
[HW-1] added docs
This commit is contained in:
13
docs/homework-1/img/cart-cart-clear.plantuml
Normal file
13
docs/homework-1/img/cart-cart-clear.plantuml
Normal file
@@ -0,0 +1,13 @@
|
||||
@startuml
|
||||
|
||||
actor User as u
|
||||
collections Cart as c
|
||||
database CartStorage as cs
|
||||
|
||||
u -> c : DELETE /user/<user_id>/cart
|
||||
activate c
|
||||
c -> cs : cart.DeleteItemsByUserID
|
||||
c -> u : Response: 204 No Content
|
||||
deactivate c
|
||||
|
||||
@enduml
|
||||
BIN
docs/homework-1/img/cart-cart-clear.png
Normal file
BIN
docs/homework-1/img/cart-cart-clear.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
21
docs/homework-1/img/cart-cart-item-add.plantuml
Normal file
21
docs/homework-1/img/cart-cart-item-add.plantuml
Normal file
@@ -0,0 +1,21 @@
|
||||
@startuml
|
||||
|
||||
actor User as u
|
||||
collections Cart as c
|
||||
database CartStorage as cs
|
||||
collections ProductService as p
|
||||
|
||||
u -> c : POST /user/<user_id>/cart/<sku_id>\n\t- count
|
||||
activate c
|
||||
|
||||
c -> p : GET /product/<sku>
|
||||
activate p
|
||||
p -> c : \nResponse: 200 OK\n\t- name\n\t- price\n\t- sku
|
||||
deactivate p
|
||||
c -> c : validate product exists
|
||||
c -> cs : cart.AddItem()
|
||||
c -> u : Response: 200 OK
|
||||
|
||||
deactivate c
|
||||
|
||||
@enduml
|
||||
BIN
docs/homework-1/img/cart-cart-item-add.png
Normal file
BIN
docs/homework-1/img/cart-cart-item-add.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
13
docs/homework-1/img/cart-cart-item-delete.plantuml
Normal file
13
docs/homework-1/img/cart-cart-item-delete.plantuml
Normal file
@@ -0,0 +1,13 @@
|
||||
@startuml
|
||||
|
||||
actor User as u
|
||||
collections Cart as c
|
||||
database CartStorage as cs
|
||||
|
||||
u -> c : DELETE /user/<user_id>/cart/<sku_id>
|
||||
activate c
|
||||
c -> cs : cart.DeleteItem(userID, skuID)
|
||||
c -> u : Response: 204 No Content
|
||||
deactivate c
|
||||
|
||||
@enduml
|
||||
BIN
docs/homework-1/img/cart-cart-item-delete.png
Normal file
BIN
docs/homework-1/img/cart-cart-item-delete.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
25
docs/homework-1/img/cart-cart-list.plantuml
Normal file
25
docs/homework-1/img/cart-cart-list.plantuml
Normal file
@@ -0,0 +1,25 @@
|
||||
@startuml
|
||||
|
||||
actor User as u
|
||||
collections Cart as c
|
||||
database CartStorage as cs
|
||||
collections ProductService as p
|
||||
|
||||
u -> c : GET /user/<user_id>/cart
|
||||
activate c
|
||||
c -> cs : cart.GetItemsByUserID
|
||||
alt cart exists
|
||||
loop for each item in cart
|
||||
c -> p : GET /product/<sku>
|
||||
activate p
|
||||
p -> c : Response: 200 OK\n\t- name\n\t- price\n\t- sku
|
||||
deactivate p
|
||||
c -> c : calculate total price
|
||||
end
|
||||
c -> u : Response: 200 OK\n\t- []item\n\t- total_price
|
||||
else
|
||||
c -> u : Response: 404 Not Found
|
||||
end
|
||||
deactivate c
|
||||
|
||||
@enduml
|
||||
BIN
docs/homework-1/img/cart-cart-list.png
Normal file
BIN
docs/homework-1/img/cart-cart-list.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
Reference in New Issue
Block a user