---
# System prepended metadata

title: Untitled

---

```plantuml
@startuml


participant "evm-stockist" as evm_stock
control     "in service evm-stockist"     as ctrl1
entity      "product_variant"      as pv
participant "evm-inventory" as evm_inv
database "evm_stockist" as dbstock
database "evm" as dbevm

evm_stock <-> dbstock : 1. get data exist in table auto_deploy_product


evm_stock -> ctrl1 : 1.1
note left
if data is null
filter complete order use
cut off date
end note

evm_stock -> ctrl1 : 1.2
note left
if data not null
filter complete order use
complete order desc limit 1 from tb_auto_deploy_product
end note

evm_stock <-> dbevm : 2. get data complete order using stockist voucher, stockist_flagging, order by brand parent

evm_stock -> ctrl1 : 2.1
note left
if auto_deploy_product.od_id != complete_order.od_id
then
populate data
else
continue
end note

evm_stock -> pv : 2.2   to model product_variant

evm_stock <-> evm_inv : 3. /v1/product-variant-attribute/search [POST]

alt variant attribute not found
evm_stock <-> evm_inv : 4.1 /v1/product-variant-mapping/bulk [POST]
evm_stock <-> evm_inv : 4.2 /v1/product-variant-attribute/search [POST]
evm_stock <-> evm_inv : 4.3 /v2/internal/stock?isContinueToLog=true [PUT]
end

evm_stock <-> evm_inv : 4.4 /v2/internal/stock?isContinueToLog=true [PUT]

evm_stock <-> dbstock : 4.5 insert data to auto_deploy_product

@enduml
```