You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
918 B
918 B
Add item sequence
sequenceDiagram
participant Controller as StoreController
participant UseCase as AddItem Use Case
participant Clock as IClock
participant Policy as ExpirationPolicy
participant OrderService as OrderingService
participant HttpClient as HttpClient
participant Repo as IItemRepository
Controller->>UseCase: execute(item)
UseCase->>Clock: getCurrentTime()
Clock-->>UseCase: DateTime
UseCase->>Policy: IsExpired(item, currentTime)
Policy-->>UseCase: boolean
alt Item is expired
UseCase->>OrderService: orderItem(item)
OrderService->>HttpClient: POST to order URL
HttpClient-->>OrderService: Response
OrderService-->>UseCase: OrderResult
end
UseCase->>Repo: save(item)
Repo->>Repo: Persist to storage
Repo-->>UseCase: Saved Item ID
UseCase-->>Controller: Result (success/error)