cccev.projection.api.entity.framework.FrameworkEvolver.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cccev-projection-api Show documentation
Show all versions of cccev-projection-api Show documentation
Kotlin implementation of Core Criterion and Core Evidence Vocabulary
The newest version!
package cccev.projection.api.entity.framework
import cccev.s2.framework.domain.FrameworkEvent
import cccev.s2.framework.domain.FrameworkState
import cccev.s2.framework.domain.command.FrameworkCreatedEvent
import org.springframework.stereotype.Service
import s2.sourcing.dsl.view.View
@Service
class FrameworkEvolver: View {
override suspend fun evolve(event: FrameworkEvent, model: FrameworkEntity?): FrameworkEntity? = when (event) {
is FrameworkCreatedEvent -> create(event)
else -> TODO()
}
private suspend fun create(event: FrameworkCreatedEvent): FrameworkEntity {
return FrameworkEntity(
id = event.id,
identifier = event.identifier,
name = event.name,
status = FrameworkState.CREATED
)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy