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

import com.ffii.core.entity.BaseEntity
import com.ffii.fpsms.modules.master.entity.Warehouse
import jakarta.persistence.Column
import jakarta.persistence.Entity
import jakarta.persistence.JoinColumn
import jakarta.persistence.ManyToOne
import jakarta.persistence.Table
import jakarta.validation.constraints.NotNull
import org.hibernate.annotations.JdbcTypeCode
import org.hibernate.type.SqlTypes
import java.math.BigDecimal

@Entity
@Table(name = "inventory_lot_line")
open class InventoryLotLine : BaseEntity<Long>() {
    @NotNull
    @ManyToOne
    @JoinColumn(name = "inventoryLotId")
    open var inventoryLot: InventoryLot? = null

    @NotNull
    @ManyToOne
    @JoinColumn(name = "warehouseId")
    open var warehouse: Warehouse? = null

    @Column(name = "inQty")
    open var inQty: BigDecimal? = null

    @Column(name = "outQty")
    open var outQty: BigDecimal? = null

    @Column(name = "holdQty")
    open var holdQty: BigDecimal? = null

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

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

//    @JdbcTypeCode(SqlTypes.JSON)
//    @Column(name = "qrCode")
//    open var qrCode: MutableMap<String, Any?>? = null
}