package com.ffii.fpsms.modules.qc.entity

import com.ffii.core.entity.BaseEntity
import com.ffii.fpsms.modules.master.entity.Items
import com.ffii.fpsms.modules.master.entity.QcItem
import com.ffii.fpsms.modules.stock.entity.EscalationLog
import com.ffii.fpsms.modules.stock.entity.StockInLine
import com.ffii.fpsms.modules.stock.entity.StockOutLine
import jakarta.persistence.*
import jakarta.validation.constraints.NotNull

@Entity
@Table(name = "qc_result")
open class QcResult: BaseEntity<Long>() {
    @NotNull
    @ManyToOne
    @JoinColumn(name = "qcItemId")
    open var qcItem: QcItem? = null

    @NotNull
    @ManyToOne
    @JoinColumn(name = "itemId")
    open var item: Items? = null

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

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

    @ManyToOne
    @JoinColumn(name = "escalationLogId")
    open var escalationLog: EscalationLog? = null

    @Column(name = "failQty")
    open var failQty: Double? = null

    @Column(name = "type")
    open var type: String? = null

    @Column(name = "remarks")
    open var remarks: String? = null

    @NotNull
    @Column(name = "qcPassed")
    open var qcPassed: Boolean = true
}