package com.correx.core.journal

import com.correx.core.events.events.StoredEvent
import com.correx.core.journal.model.DecisionJournalState
import com.correx.core.sessions.projections.Projection

class DecisionJournalProjector(
    private val reducer: DecisionJournalReducer,
) : Projection<DecisionJournalState> {
    override fun initial(): DecisionJournalState = DecisionJournalState()
    override fun apply(state: DecisionJournalState, event: StoredEvent): DecisionJournalState =
        reducer.reduce(state, event)
}
