package space.nstart.pcp_tgu_service.entity

import jakarta.persistence.Column
import jakarta.persistence.Entity
import jakarta.persistence.Id
import jakarta.persistence.Table
import java.time.LocalDateTime
import java.util.UUID
import space.nstart.pcp.pcp_types_lib.utils.UtcDateTimes

/**
 * Dedup-запись Kafka decision event по eventId.
 */
@Entity
@Table(name = "processed_plan_decision_event")
class ProcessedPlanDecisionEventEntity(
    @Id
    @Column(name = "event_id", nullable = false, updatable = false)
    var eventId: UUID,

    @Column(name = "received_at", nullable = false)
    var receivedAt: LocalDateTime = UtcDateTimes.now()
) {
    /** Создаёт пустой экземпляр сущности, необходимый для JPA. */
    constructor() : this(eventId = UUID.randomUUID())
}
