package com.correx.core.events.events

import com.correx.core.events.types.CausationId
import com.correx.core.events.types.CorrelationId
import com.correx.core.events.types.EventId
import com.correx.core.events.types.SessionId
import kotlinx.datetime.Instant
import kotlinx.serialization.Serializable

@Serializable
data class EventMetadata(
    val eventId: EventId,
    val sessionId: SessionId,
    val timestamp: Instant,
    /**
     * Reserved for future event schema migration. Currently always hardcoded to `1`.
     * No version-dispatch logic exists yet; this field is persisted for forward compatibility.
     * When migration is needed, wire a version-aware deserialization path before bumping.
     */
    val schemaVersion: Int,
    val causationId: CausationId?,
    val correlationId: CorrelationId?
)
