package com.ffii.fpsms.modules.stock.web.model

import com.ffii.fpsms.modules.qc.web.model.SaveQcResultRequest
import java.math.BigDecimal
import java.time.LocalDate
import java.time.LocalDateTime

enum class StockInStatus(val status: String) {
    PENDING("pending"),
    COMPLETE("completed"),
//    CANCELLED("cancelled")
}
enum class StockInLineStatus(val status: String) {
    PENDING("pending"),
    QC("qc"),
    ESCALATED("escalated"),
    FirstDetermine("determine1"),
    SecondDetermine("determine2"),
    ThirdDetermine("determine3"),
    RECEIVING("receiving"),
    RECEIVED("received"),
    COMPLETE("completed"),
    PARTIALLY_COMPLETE("partially_completed"),
    REJECT("rejected");
}
data class SaveStockInRequest(
    val purchaseOrderId: Long? = null,
    val code: String? = null,
    val supplierId: Long? = null,
    val shopId: Long? = null,
    val orderDate: Long? = null,
    val estimatedCompleteDate: LocalDateTime? = null,
    val completeDate: LocalDateTime? = null,
    val status: String? = null,
    val stockOutId: Long? = null,
    val stockTakeId: Long? = null,
//    val m18
)

data class SaveStockInLineRequest(
    var id: Long? = null,
    var stockInId: Long? = null,
    var stockTakeId: Long? = null,
    var stockTakeLineId: Long? = null,
    var itemId: Long,
    var purchaseOrderId: Long? = null,
    var purchaseOrderLineId: Long? = null,
    var jobOrderId: Long? = null,
    var acceptedQty: BigDecimal,
    var acceptQty: BigDecimal?,
    var acceptedWeight: BigDecimal? = null,
    var status: String?,
    var expiryDate: LocalDate?,
    var productLotNo: String? = null,
    var dnNo: String? = null,
    var invoiceNo: String? = null,
    var remarks: String? = null,
//    var dnDate: LocalDate? = null,
    var receiptDate: LocalDate? = null,
    var productionDate: LocalDate? = null,
    var qcAccept: Boolean? = null,
    var qcResult: List<SaveQcResultRequest>? = null,
    var escalationLog: SaveEscalationLogRequest? = null,
    var warehouseId: Long? = null,
    var rejectQty: BigDecimal? = null,
    var inventoryLotLines: List<SaveInventoryLotLineForSil>? = null
)

data class SaveInventoryLotLineForSil (
    val qty: BigDecimal,
    val warehouseId: Long?
)
data class NewStockInCreateRequest(
   
    val inventoryLotLineId: Long,
    val itemId: Long,
    val itemNo: String,

    val demandQty: BigDecimal,
    val acceptedQty: BigDecimal,
    val expiryDate: LocalDate,
    val lotNo: String?,
    val stockIntype: String,
    val stockInLineType: String,

    val warehouseId: Long,
    val stockUomId: Long,
)
