---
# System prepended metadata

title: Transaction Notifications

---

# Transaction Notifications

## Architecture Diagram
```plantuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml

title Transaction Notifications - Architecture Diagram

Person(brand_admin, "Brand / Stockiest")

System_Boundary(brand_web_system, "Brand Administration Web Application") {
    Container(brand_web, "Browser", "Software System", "All supported browser")
    Container(brand_app, "Brand Administration Web Application", "Nuxt.js", "Provides brand management functionalities to brand admin via their web browser")
}

System_Boundary(api_endpoint, "API Endpoint") {
    Container(evm_brand, "evm-brand API", "Golang", "Provides brand management functionalities via HTTPS / REST / JSON API")
    Container(evm_notification, "evm-notification API", "Golang", "Provides notifications functionalities via HTTPS / REST / JSON API")
}

ContainerDb(db_evm_notification, "Database", "MySQL", "evm_notification schema")

Rel_R(brand_admin, brand_web, "View dashboard", "Client Device")
Rel_R(brand_web, brand_app, "Access", "HTTPS")
Rel(brand_app, evm_brand, "Makes API calls to", "HTTPS / REST / JSON")
Rel_L(evm_brand, evm_notification, "Makes API calls to", "HTTPS / REST / JSON")
Rel(evm_notification, db_evm_notification, "Reads from & Writes to", "TCP/IP")
```

## Architecture Diagram (Worker)
```plantuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml

title Worker Partner Notification - Architecture Diagram

System(cronjobs, "Cronjobs")
Container(evm_partner_notif, "evm-partner-notif-worker", "Golang", "Provides Partner Worker Notification functionalities via HTTPS / REST / JSON API")

System_Boundary(cronjob_system_push, "Evermos Cronjobs System (Push Notif)") {
    Container(partner_notif_worker_daily_reminder, "partner-notif-worker-daily-reminder", "bash", "Provides cron job daily reminder at midnight 3:15AM & Processing data 72 hours ago .")
    Container(partner_notif_worker_new_order, "partner-notif-worker-new-order", "bash", "Provides cron job new order every 30 minutes & Processing data 30 minutes ago.")
}

System_Boundary(cronjob_system_pull, "Evermos Cronjobs System (Pull Notif)") {
    Container(partner_pullnotif_new_order, "partner-pullnotif-new-order", "bash", "Provides cron job pull notification new order every one minutes & Processing data 1 minutes ago.")
    Container(partner_pullnotif_old_order, "partner-pullnotif-old-order", "bash", "Provides cron job pull notification old order every 10 minutes & Processing data 72 hours ago.")
}

System_Boundary(api_endpoint, "API Endpoint") {
    Container(evm_notif_publisher, "evm-notif-publisher API", "Golang", "Provides notification publisher functionalities via HTTPS / REST / JSON API")
   Container(evm_notification, "evm-notification API", "Golang", "Provides notification managements functionalities via HTTPS / REST / JSON API")
}

ContainerDb(db_evm_notification, "Database", "MySQL", "evm_notification schema")
ContainerDb(db_notification, "Database", "MySQL", "notification schema")
ContainerDb(db_evm, "Database", "MySQL", "evm schema")
ContainerDb(db_itr, "Database", "MySQL", "itr schema")
System(onesignal, "One Signal")
ContainerDb(redis, "Memory Data", "Open Source", "Redis")

Rel(cronjobs, evm_partner_notif, "Access", "HTTPS")
Rel(evm_partner_notif, partner_notif_worker_daily_reminder, "Access", "HTTPS")
Rel(evm_partner_notif, partner_notif_worker_new_order, "Access", "HTTPS")
Rel(evm_partner_notif, partner_pullnotif_new_order, "Access", "HTTPS")
Rel(evm_partner_notif, partner_pullnotif_old_order, "Access", "HTTPS")

Rel(partner_notif_worker_daily_reminder, evm_notif_publisher, "Makes API calls to", "HTTPS / REST / JSON")
Rel(partner_notif_worker_new_order, evm_notif_publisher, "Makes API calls to", "HTTPS / REST / JSON")
Rel(partner_pullnotif_new_order, evm_notification, "Makes API calls to", "HTTPS / REST / JSON")
Rel(partner_pullnotif_new_order, redis, "Store Data", "Access")
Rel(partner_pullnotif_old_order, redis, "Get Data", "Access")
Rel(partner_pullnotif_old_order, evm_notification, "Makes API calls to", "HTTPS / REST / JSON")

Rel(evm_notif_publisher, db_notification, "R", "TCP/IP")
Rel(evm_notif_publisher, onesignal, "R & W", "TCP/IP")
Rel(evm_notification, db_evm_notification, "W", "TCP/IP")
Rel_L(evm_partner_notif, db_evm, "R & W", "TCP/IP")
Rel_R(evm_partner_notif, db_itr, "R & W", "TCP/IP")
```

## Process Flow

```plantuml
skinparam responseMessageBelowArrow true

title  Get List Transaction Notifications - Interaction Diagram

participant "client" as c
participant "evm-brand" as eb
participant "evm-notification" as en
database "evm_notification" as evm_n

c -> eb : get list notification
activate eb

alt if client unauthorized
    eb -> c : error unauthorized
end

eb -> en : get list notification
activate en

en -> evm_n : get list notification
activate evm_n
return list notification data

return list notification data
return list notification data
```
