workspace extends ../common/finance-common-model.dsl { name "Offer management system " description "Offer management system is responsible for managing offers, changing and updating prices in stores" model { cronSystem = softwareSystem "Cron" "Cron trigger" { tags "Cron" "notOwned" } schedulingSystem = softwareSystem "Scheduling system" { tags "notOwned" } exchangeRatesExternalSystem = softwareSystem "Exchange rates external system" { tags "External" } externalStoresSystem = softwareSystem "External stores systems" { description "AppStore, PlayMarket, etc." tags "External" } !extend offerManagementSystem { priceTemplatorDb = container "PriceTemplatorDatabase" { description "Stores price templates" technology "MySQL" tags "Google Cloud Platform - Compute Engine" "Database" "MySQL" } priceTemplator = container "PriceTemplator" { description "Responsible for managing offer tires to simplify currency exchange and offer management in stores" tags "Google Cloud Platform - Kubernetes Engine" technology "Java" -> priceTemplatorDb "Stores/reads pricing templates" "SQL" user -> this "Get offer local price" "HTTP" } offerManagerDb = container "OfferManagerDatabase" { description "Stores offers and corresponding data (Finance DB)" technology "MySQL" tags "Google Cloud Platform - Compute Engine" "Database" "MySQL" "FinanceDB" } offerManagerKV = container "OfferManagerKV" { description "Cache offers" technology "Aerospike" tags "Google Cloud Platform - Compute Engine" "Database" "Aerospike" } offerManager = container "OfferManager" { description "Responsible for managing and updating offers metadata" tags "Google Cloud Platform - Kubernetes Engine" technology "Java" -> vipManagementSystem "Get VIP configs" "HTTP" user -> this "Get offer data" "HTTPS" -> priceTemplator "Get offer price in local currency" "HTTP" "Future" -> offerManagerKV "Cache offers" "Aerospike client" "Cache" -> offerManagerDb "Stores/reads offer data" "SQL" } exchangeRatesKV = container "ExchangeRatesKV" { description "Cache exchange rates" technology "Aerospike" tags "Google Cloud Platform - Compute Engine" "Database" "Aerospike" } exchangeRates = container "ExchangeRates" { description "Responsible for providing exchange rates to backend services" tags "Google Cloud Platform - Kubernetes Engine" technology "Java" -> exchangeRatesExternalSystem "Get rates" "HTTPS" -> exchangeRatesKV "Get/cache rates" "Aerospike client" "Cache" } offerPriceManager = container "OfferPriceManager" { description "Responsbile for managing and update offer prices in different currencies including/excluding taxes" tags "Google Cloud Platform - Kubernetes Engine" technology "Java" -> exchangeRates "Get exchange rates" "HTTP" -> priceTemplator "Store updated pricing templates for different currencies" "HTTP" -> externalStoresSystem "Update offer prices in different currencies" "HTTPS" liveOps -> this "Configure offers" "HTTP" cronSystem -> this "Trigger batch offers prices recalculation" "HTTP" -> schedulingSystem "Schedule offer update in stores (Due to rate limiting on stores side)" "Kafka" "Kafka" schedulingSystem -> this "Trigger offer update in stores" "Kafka" "Kafka" } } } views { systemLandscape "SystemLandscape" "Offer management system landscape" { include * autoLayout } systemContext offerManagementSystem "offerManagementSystemContext" { include * autoLayout } container offerManagementSystem "offerManagementSystem-container-view" { include * autoLayout } dynamic offerManagementSystem "change-offer-prices-flow" { autoLayout title "Change offer prices flow" description "Describes steps to change/recalculate offer prices in different currencys and update them in stores" { { liveOps -> offerPriceManager } { cronSystem -> offerPriceManager } } offerPriceManager -> exchangeRates exchangeRates -> exchangeRatesKV exchangeRates -> exchangeRatesExternalSystem offerPriceManager -> priceTemplator priceTemplator -> priceTemplatorDb offerPriceManager -> schedulingSystem schedulingSystem -> offerPriceManager offerPriceManager -> externalStoresSystem } } }