package com.ffii.fpsms.modules.jobOrder.entity

import com.ffii.core.entity.BaseEntity
import com.ffii.fpsms.modules.master.entity.Process
import jakarta.persistence.*
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Size
import java.time.LocalDateTime

@Entity
@Table(name = "job_order_process")
open class JobOrderProcess : BaseEntity<Long>() {
    @NotNull
    @ManyToOne
    @JoinColumn(name = "joId", nullable = false)
    open var jo: JobOrder? = null

    @NotNull
    @ManyToOne
    @JoinColumn(name = "processId", nullable = false)
    open var process: Process? = null

    @Column(name = "startTime")
    open var startTime: LocalDateTime? = null

    @Column(name = "endTime")
    open var endTime: LocalDateTime? = null

    @Size(max = 20)
    @Column(name = "status", length = 20)
    open var status: String? = null

    @Column(name = "seqNo")
    open var seqNo: Long? = null

    @Size(max = 500)
    @Column(name = "remarks", length = 500)
    open var remarks: String? = null
}