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

import com.fasterxml.jackson.annotation.JsonBackReference
import com.ffii.core.entity.BaseEntity
import com.ffii.fpsms.modules.master.entity.Warehouse
import com.ffii.fpsms.modules.pickOrder.entity.PickOrderLine
import com.ffii.fpsms.modules.stock.enums.SuggestedPickLotType
import com.ffii.fpsms.modules.stock.enums.SuggestedPickLotTypeConverter
import jakarta.persistence.*
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Size
import java.math.BigDecimal

@Entity
@Table(name = "suggested_pick_lot")
open class SuggestedPickLot: BaseEntity<Long>() {
    @NotNull
    @Convert(converter = SuggestedPickLotTypeConverter::class)
    @Column(name = "type", nullable = false, length = 100)
    open var type: SuggestedPickLotType? = null

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

//    @JsonBackReference
    @ManyToOne
    @JoinColumn(name = "suggestedLotLineId")
    open var suggestedLotLine: InventoryLotLine? = null

    @JsonBackReference
    @ManyToOne
    @JoinColumn(name = "pickOrderLineId")
    open var pickOrderLine: PickOrderLine? = null

    @Column(name = "qty", precision = 14, scale = 2)
    open var qty: BigDecimal? = null

    @Column(name = "pickSuggested")
    open var pickSuggested: Boolean? = null
}