package com.correx.core.kernel.orchestration

import com.correx.core.events.events.StoredEvent
import com.correx.core.events.orchestration.OrchestrationState
import com.correx.core.sessions.projections.Projection

class OrchestrationProjector(
    private val orchestrationReducer: OrchestrationReducer,
) : Projection<OrchestrationState> {
    override fun initial(): OrchestrationState = OrchestrationState()

    override fun apply(
        state: OrchestrationState,
        event: StoredEvent,
    ): OrchestrationState = orchestrationReducer.reduce(state, event)
}
