package com.ffii.fpsms.modules.master.web.models

import jakarta.validation.constraints.NotBlank
import jakarta.validation.constraints.NotNull
import java.time.LocalDateTime
import java.math.BigDecimal
//enum class ItemType(val type: String) {
//    MATERIAL("mat"),
//    BY_PRODUCT("byp"),
//    PRODUCT("product"),
//    CONSUMABLE("consumables"),
//}

enum class ItemType(val type: String) {
    MATERIAL("mat"), // default
    CONSUMABLES("consumables"),
    NONCONSUMABLES("non-consumables"),
    FG("fg"),
    SFG("sfg"),
    ITEM("item"),
}

enum class M18ItemType(val type: String) {
    CONSUMABLES("Consumable Material"),
    NONCONSUMABLES("Non-consumable Material"),
    FG("Product"),
    SFG("WIP"),
    ITEM("Item"),
}

data class NewItemRequest(
    @field:NotBlank(message = "material code cannot be empty")
    val code: String,
    @field:NotBlank(message = "material name cannot be empty")
    val name: String,
    @field:NotNull(message = "typeId cannot be null")
    val type: String,

    val id: Long?,
    val description: String?,
    val remarks: String?,
    val shelfLife: Double?,
    val countryOfOrigin: String?,
    val maxQty: Double?,
    val m18Id: Long?,
    val m18LastModifyDate: LocalDateTime?,
    val qcCategoryId: Long?,
    val store_id: String?,
    val warehouse: String?,
    val area: String?,
    val slot: String?,
    val LocationCode: String?,
    val isEgg: Boolean?,
    val isFee: Boolean?,
    val isBag: Boolean?,
    val qcType: String?,
//    val type: List<NewTypeRequest>?,
//    val uom: List<NewUomRequest>?,
//    val weightUnit: List<NewWeightUnitRequest>?,
)
data class UomConversionResponse(
    val uomId: Long?,
    val uomCode: String?,
    val udfudesc: String?,
    val udfShortDesc: String?
)
data class ConversionUomRequest(
    val itemid: Long?,
    val itemcode: String?,
    val qty: String?,

    val currentUomCode: String?,
    val currentUomid: Long?,
    val currentUomUdfudesc: String?,

    val newUomCode: String?,
    val newUomid: Long?,
    val newUomUdfudesc: String?

)
data class ConversionUomResponse(
    val qty: BigDecimal,
    val UomCode: String,
    val UomUdfudesc: String,
    val udfShortDesc: String
)
data class ConvertUomByItemRequest(
    val itemId: Long,
    val qty: BigDecimal,
    val uomId: Long,
    val targetUnit: String
)
data class ConvertUomByItemResponse(
    val newQty: BigDecimal,
    val udfudesc: String?,
    val udfShortDesc: String?
)

