package space.nstart.pcp.pcp_mission_planing_service.entity

import jakarta.persistence.Column
import jakarta.persistence.Entity
import jakarta.persistence.FetchType
import jakarta.persistence.GeneratedValue
import jakarta.persistence.GenerationType
import jakarta.persistence.Id
import jakarta.persistence.JoinColumn
import jakarta.persistence.ManyToOne
import jakarta.persistence.Table
import java.time.LocalDateTime

@Entity
@Table(name = "plans")
class PlanEntity(
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    val id: Long? = null,

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "mission_id", nullable = false)
    var mission: MissionEntity? = null,

    @Column(name = "plan_start")
    var planStart: LocalDateTime? = null,

    @Column(name = "plan_stop")
    var planStop: LocalDateTime? = null,

    @Column(name = "plan_number", nullable = false)
    var planNumber: Long = 0,

    @Column(name = "revolution", nullable = false)
    var revolution: Long = 0,

    @Column(name = "stage4_snapshot_id")
    var stage4SnapshotId: Long? = null
)
