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

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
    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,
    val uom: String? = null,
    val price: BigDecimal,
    val status: String,

    val stockInLine: List<StockInLineInfo>?
)