@startuml
interface ApprovalReducer
interface ApprovalEngine
interface Projection

class DefaultApprovalReducer
class DefaultApprovalEngine
class NoOpApprovalEngine
class ApprovalProjector
class DefaultApprovalRepository
class ApprovalState
class DomainApprovalRequest
class ApprovalDecision
class ApprovalGrant
class ApprovalContext

ApprovalReducer <|.. DefaultApprovalReducer
ApprovalEngine <|.. DefaultApprovalEngine
ApprovalEngine <|.. NoOpApprovalEngine
Projection <|.. ApprovalProjector
ApprovalProjector --> ApprovalReducer
DefaultApprovalRepository --> ApprovalProjector
DefaultApprovalRepository ..> ApprovalState
DefaultApprovalState --> "requests" DomainApprovalRequest
DefaultApprovalState --> "decisions" ApprovalDecision
DefaultApprovalState --> "grants" ApprovalGrant
ApprovalDecision --> ApprovalContext
DefaultApprovalEngine ..> ApprovalGrant
DefaultApprovalEngine ..> ApprovalDecision
DefaultApprovalEngine ..> ApprovalContext

package "core:events" <<External>> {
  [ApprovalRequestedEvent]
  [ApprovalDecisionResolvedEvent]
  [ApprovalGrantCreatedEvent]
  [ApprovalGrantExpiredEvent]
}
package "core:sessions" <<External>> {
  [Projection]
  [EventReplayer]
}
DefaultApprovalReducer ..> "core:events"
DefaultApprovalRepository ..> "core:events"
DefaultApprovalRepository ..> "core:sessions"

@enduml
