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

import com.ffii.core.entity.BaseEntity
import com.ffii.fpsms.modules.master.entity.Currency
import com.ffii.fpsms.modules.master.entity.Items
import com.ffii.fpsms.modules.master.entity.UomConversion
import com.ffii.fpsms.modules.master.entity.Warehouse
import jakarta.persistence.*
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Size
import java.math.BigDecimal
import java.time.LocalDate

@Entity
@Table(name = "inventory")
open class Inventory: BaseEntity<Long>(){
    @NotNull
    @Column(name = "qty")
    open var qty: BigDecimal? = null

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

    @Column(name = "stockInLineId")
    open var stockInLine: Long? = null // change this later

    @ManyToOne
    @JoinColumn(name = "currencyId")
    open var currency: Currency? = null

    @NotNull
    @Column(name = "cpu") // cost per unit
    open var cpu: BigDecimal? = null

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

    @NotNull
    @Column(name = "cpm") // cost per unit
    open var cpm: BigDecimal? = null

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

    @NotNull
    @ManyToOne
    @JoinColumn(name = "uomId")
    open var uomId: UomConversion? = null

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