package com.ffii.fpsms.modules.stock.entity

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

@Entity
@Table(name = "supervision_approval_log")
open class SupervisionApprovalLog : BaseEntity<Long>() {
    @NotNull
    @ManyToOne
    @JoinColumn(name = "personInCharge", nullable = false, referencedColumnName = "id")
    open var personInCharge: User? = null

    @Size(max = 100)
    @NotNull
    @Column(name = "type", nullable = false, length = 100)
    open var type: String? = null

    @ManyToOne
    @JoinColumn(name = "stockInLineId")
    open var stockInLine: StockInLine? = null

    @ManyToOne
    @JoinColumn(name = "stockOutLineId")
    open var stockOutLine: StockOutLine? = null

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

    @Size(max = 100)
    @NotNull
    @Column(name = "status", nullable = false, length = 100)
    open var status: String? = null

    @Size(max = 500)
    @NotNull
    @Column(name = "reason", nullable = false, length = 500)
    open var reason: String? = null
}