package com.ffii.fpsms.modules.purchaseOrder.entity.projections

import com.ffii.fpsms.modules.master.entity.UomConversion
import com.ffii.fpsms.modules.stock.entity.StockInLine
import com.ffii.fpsms.modules.stock.entity.projection.StockInLineInfo
import org.springframework.beans.factory.annotation.Value
import java.math.BigDecimal

interface PurchaseOrderLineInfo {
    val id: Long
    @get:Value("#{target.purchaseOrder.id}")
    val purchaseOrderId: Long
    val itemNo: String
    @get:Value("#{target.items?.name}")
    val itemName: String?
    val qty: BigDecimal
    @get:Value("#{target.uom}")
    val uom: UomConversion
    val price: BigDecimal
    val status: String
}

data class PoLineWithStockInLine (
    val id: Long,
    val purchaseOrderId: Long,
    val itemId: Long,
    val itemNo: String,
    val itemName: String?,
    val qty: BigDecimal,
    val processed: BigDecimal,
    @get:Value("#{target.uom}")
    val uom: UomConversion,
    val price: BigDecimal,
    val status: String,

    val stockInLine: List<StockInLineInfo>?
)