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

import com.ffii.core.entity.BaseEntity
import com.ffii.fpsms.modules.master.entity.Items
import jakarta.persistence.*
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Size
import org.hibernate.annotations.JdbcTypeCode
import org.hibernate.type.SqlTypes
import java.time.LocalDate
import java.time.LocalDateTime

@Entity
@Table(name = "inventory_lot")
open class InventoryLot : BaseEntity<Long>() {
    @NotNull
    @OneToOne
    @JoinColumn(name = "itemId", nullable = false)
    open var item: Items? = null

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

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

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

    @NotNull
    @Column(name = "expiryDate")
    open var expiryDate: LocalDate? = null

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

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