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

import org.springframework.beans.factory.annotation.Value
import java.math.BigDecimal

// Job Orders
interface JobOrderInfo {
    val id: Long;
    val code: String;

    @get:Value("#{target.bom.name}")
    val name: String;
    val reqQty: BigDecimal;

    @get:Value("#{target.bom.item.itemUoms.^[salesUnit == true && deleted == false]?.uom.udfudesc}")
    val uom: String;

@get:Value("#{target.status.value}")
    val status: String;
}

// Job Order
interface JobOrderDetailWithJsonString {
    val id: Long?;
    val code: String?;
    val name: String?;
    val reqQty: BigDecimal?;
    val uom: String?;
    val pickLines: String?;
    val status: String?;
}

data class JobOrderDetail(
    val id: Long?,
    val code: String?,
    val name: String?,
    val reqQty: BigDecimal?,
    val uom: String?,
    val pickLines: List<JobOrderDetailPickLine>?,
    val status: String?
)

data class JobOrderDetailPickLine(
    val id: Long?,
    val code: String?,
    val name: String?,
    val pickedLotNo: List<JobOrderDetailPickedLotNo>?,
    val reqQty: BigDecimal?,
    val uom: String?,
    val status: String?
)

data class JobOrderDetailPickedLotNo(
    val lotNo: String?,
    val qty: BigDecimal?,
)