feat(kernel): inject decision journal into stage context + wire repository
This commit is contained in:
@@ -22,6 +22,7 @@ dependencies {
|
||||
implementation project(":infrastructure:workflow")
|
||||
implementation project(":core:artifacts")
|
||||
implementation project(":core:artifacts-store")
|
||||
implementation(project(":core:journal"))
|
||||
implementation project(":infrastructure:artifacts-cas")
|
||||
implementation "io.ktor:ktor-client-core:$ktor_version"
|
||||
implementation "io.ktor:ktor-client-cio:$ktor_version"
|
||||
|
||||
@@ -3,6 +3,9 @@ package com.correx.infrastructure
|
||||
import com.correx.core.approvals.ApprovalProjector
|
||||
import com.correx.core.approvals.DefaultApprovalReducer
|
||||
import com.correx.core.approvals.DefaultApprovalRepository
|
||||
import com.correx.core.journal.DecisionJournalProjector
|
||||
import com.correx.core.journal.DefaultDecisionJournalReducer
|
||||
import com.correx.core.journal.DefaultDecisionJournalRepository
|
||||
import com.correx.core.artifacts.DefaultArtifactReducer
|
||||
import com.correx.core.artifacts.repository.ArtifactRepository
|
||||
import com.correx.core.artifactstore.ArtifactStore
|
||||
@@ -177,6 +180,14 @@ object InfrastructureModule {
|
||||
),
|
||||
)
|
||||
|
||||
fun createDecisionJournalRepository(eventStore: EventStore): DefaultDecisionJournalRepository =
|
||||
DefaultDecisionJournalRepository(
|
||||
DefaultEventReplayer(
|
||||
eventStore,
|
||||
DecisionJournalProjector(DefaultDecisionJournalReducer()),
|
||||
),
|
||||
)
|
||||
|
||||
fun createWorkflowLoader(extraKinds: List<ArtifactKind> = emptyList()): WorkflowLoader {
|
||||
val registry = DefaultArtifactKindRegistry()
|
||||
extraKinds.forEach { registry.register(it) }
|
||||
|
||||
Reference in New Issue
Block a user