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

import jakarta.validation.constraints.NotBlank
import jakarta.validation.constraints.NotNull
import java.time.LocalDate
import java.time.LocalDateTime
enum class StockOutStatus(val status: String) {
    PENDING("pending"),
    COMPLETE("completed"),
//    CANCELLED("cancelled")
}
enum class StockOutLineStatus(val status: String) {
    PENDING("pending"),
    DETERMINE1("determine1"), // qc failed qty?
    LOT_CHANGE_APPROVAL("lot-change"), // just a flag for frontend
    CHECKED("checked"),
    PARTIALLY_COMPLETE("partially_completed"),
    REJECTED("rejected"),
    COMPLETE("completed"), // == picked
}
data class SaveStockOutRequest( // not usable
    val id: Long?,
    val type: String, // delivery || pick || etc
    val deliveryOrderCode: String?,
    val pickOrderCode: String?,
    val consoCode: String?,
    val completeDate: LocalDateTime?,
    val status: StockOutStatus?,
    val handler: Long?,
    val targetOutletId: Long?,
    val remarks: String?,
    val stockOutLine: List<UpdateStockOutLineRequest>
)
data class CreateStockOutLineRequest(
    val consoCode: String,
    val pickOrderLineId: Long,
    val inventoryLotLineId: Long,
    val qty: Double,
)
data class UpdateStockOutLineRequest(
    val id: Long,
    val itemId: Long,
    val qty: Double,
    val pickOrderLineId: Long,
    val status: String,

    val inventoryLotLineId: Long?,
    val pickTime: LocalDateTime?,
//    val pickerId: Long?
)
data class CreateStockOutLineWithoutConsoRequest(
    val pickOrderLineId: Long,
    val inventoryLotLineId: Long,
    val stockOutId: Long, 
    val qty: Double,
)
data class UpdateStockOutLineStatusRequest(
    val id: Long,
    val status: String,
    val qty: Double? = null,
    val remarks: String? = null
)