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

import com.ffii.fpsms.modules.master.entity.*
import jakarta.validation.constraints.NotBlank
import java.math.BigDecimal
import java.time.LocalDateTime

data class SaveBomRequest (
    val id: Long? = null,
    @field:NotBlank(message = "bom code cannot be empty")
    val code: String,
    @field:NotBlank(message = "bom name cannot be empty")
    val name: String,
    @field:NotBlank(message = "bom description cannot be empty")
    val description: String,
    val itemId: Long? = null,
    val outputQty: BigDecimal? = null,
    val outputQtyUom: String? = null,
    val yield: BigDecimal? = null,
    val uomId: Long? = null,
    val m18UomId: Long? = null,
    val m18Id: Long? = null,
    val m18LastModifyDate: LocalDateTime? = null
)
data class ImportBomRequest (
    @field:NotBlank(message = "bom code cannot be empty")
    var code: String,
    @field:NotBlank(message = "bom name cannot be empty")
    var name: String,
    @field:NotBlank(message = "bom description cannot be empty")
    var description: String,
    var itemId: Long? = null,
    var scrapRate: Int? = null,
    var allergicSubstances: Int? = null,
    var outputQty: BigDecimal? = null,
    var outputQtyUom: String? = null,
    var timeSequence: Int? = null,
    var complexity: Int? = null,
    var yield: BigDecimal? = null,
    var uomId: Long? = null,
    var isDark: Int? = null,
    var isFloat: Int? = null,
    var isDense: Int? = null,
//    var excelUom: String? = null
)

data class ImportBomMatRequest (
    var item: Items? = null,
    var isConsumable: Boolean? = false,
    var qty: BigDecimal? = null,
    var uom: UomConversion? = null,
    var saleQty: BigDecimal? = null,
    var salesUnit: UomConversion? = null,
    var salesUnitCode: String? = null,
    var uomName: String? = null,
    var bom: Bom? = null,
)

data class ImportBomProcessRequest(
    var process: Process? = null,
    var description: String? = null,
    var equipment: Equipment? = null,
    var seqNo: Long? = null,
    var durationInMinute: Int? = 0,
    var prepTimeInMinute: Int? = 0,
    var postProdTimeInMinute: Int? = 0,
    var bom: Bom? = null,
)
data class ImportBomProcessMaterialRequest(
    var bomProcess: BomProcess? = null,
    var bomMaterial: BomMaterial? = null,
)
