Skip to content

Instantly share code, notes, and snippets.

@domingoladron
Created June 1, 2020 23:29
Show Gist options
  • Save domingoladron/bb40aaeffd83950559333721e3b985d3 to your computer and use it in GitHub Desktop.
Save domingoladron/bb40aaeffd83950559333721e3b985d3 to your computer and use it in GitHub Desktop.
get-widget-by-id.puml
@startuml
actor caller order 1
participant API order 2
participant WidgetAppService order 3
participant AuthorisationService order 4
participant WidgetRepository order 5
participant MoreDetailsWidgetRepository order 6
database WidgetDB order 7
boundary MoreDetailsAPI order 8
title: Domain Flow: Get Widget by ID for a caller
caller -> API: GET /widgets/{WidgetId}
API -> WidgetAppService: GetWidget(WidgetId, User.CompanyId)
WidgetAppService -> WidgetRepository: GetWidget(WidgetId, companyId)
WidgetRepository -> WidgetDB: get_Widget(WidgetId, companyId)
WidgetDB -> WidgetRepository: WidgetData
WidgetRepository -> WidgetRepository: Inflate Widget(WidgetData)
WidgetRepository -> WidgetAppService: Widget
WidgetAppService -> AuthorisationService: GetIsAuthorised(Widget)
AuthorisationService -> WidgetAppService: IsAuthorised : bool
alt !IsAuthorised
WidgetAppService -> API: ForbidResult
end
alt Widget.NeedsMoreDetails == true
WidgetAppService -> MoreDetailsWidgetRepository: GetMoreDetailsForWidget(Widget)
MoreDetailsWidgetRepository -> MoreDetailsAPI: POST /more-details/ {Widget}
MoreDetailsAPI -> MoreDetailsWidgetRepository: {MoreDetailsResponse}
MoreDetailsWidgetRepository ->WidgetAppService: {MoreDetailsResponse}
WidgetAppService->WidgetAppService: Widget.ApplyMoreDetails(MoreDetailsResponse)
end
WidgetAppService -> API: Widget
API -> caller: Widget or Result
@enduml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment