package com.ffii.fpsms.m18.model

import java.math.BigDecimal

/** Product / Material Response */
data class M18ProductResponse (
    val data: M18ProductData?,
    val messages: List<M18ErrorMessages>?
)

data class M18ProductData (
    val pro: List<M18ProductPro>?,
    val price: List<M18ProductPrice>?
)

data class M18ProductPro (
    val id: Long,
    val code: String,
    val desc: String,
    val unitId: Long,
    val seriesId: Long,
    val lastModifyDate: Long,
)

data class M18ProductPrice (
    val id: Long,
    val hId: Long,
    val unitId: Long,
    val basicUnit: Boolean,
    val saleUnit: Boolean,
    val stkUnit: Boolean,
    val purUnit: Boolean,
    val pickUnit: Boolean,
)

/** Product / Material List Response */
data class M18ProductListResponse (
    val values: List<M18ProductListValue>?,
    val messages: List<M18ErrorMessages>?
)

data class M18ProductListValue (
    val id: Long,
    val lastModifyDate: String?,
)

/** Vendor Response */
data class M18VendorResponse (
    val data: M18VendorData?,
    val messages: List<M18ErrorMessages>?
)

data class M18VendorData (
    val ven: List<M18VendorVen>?
)

data class M18VendorVen (
    val id: Long,
    val code: String,
    /** name */
    val desc: String,
    val `desc_zh-TW`: String,
    /** contactNo */
    val tel: String,
    val email: String,
    val ad1: String,
    val ad2: String,
    val ad3: String,
    val ad4: String,
    val lastModifyDate: Long,
)

/** Vendor List Response */
data class M18VendorListResponse (
    val values: List<M18VendorListValue>?,
    val messages: List<M18ErrorMessages>?
)

data class M18VendorListValue (
    val id: Long,
    val lastModifyDate: String?,
)

/** Unit List Response */
data class M18UnitListResponse (
    val values: List<M18UnitListValue>?,
    val messages: List<M18ErrorMessages>?
)

data class M18UnitListValue (
    val id: Long,
    val lastModifyDate: String?,
    val code: String,
    val udfudesc: String,
)

/** Unit Response */
data class M18UnitResponse (
    val data: M18UnitData?,
    val messages: List<M18ErrorMessages>?
)

data class M18UnitData (
    val unit: List<M18UnitUnit>
)

data class M18UnitUnit (
    val id: Long,
    val expiredDate: Long,
    val lastModifyDate: Long,
    val code: String,
    val udfShortDesc: String,
    val udfudesc: String,
    val status: String,
)

/** Currency List Response */
data class M18CurrencyListResponse (
    val values: List<M18CurrencyListValue>?,
    val messages: List<M18ErrorMessages>?
)

data class M18CurrencyListValue (
    val id: Long,
    val lastModifyDate: String?,
    val code: String,
    val sym: String,
    val curDesc: String,
)

/** Currency Response */
data class M18CurrencyResponse (
    val data: M18CurrencyData?,
    val messages: List<M18ErrorMessages>?
)

data class M18CurrencyData (
    val cur: List<M18CurrencyCur>
)

data class M18CurrencyCur (
    val id: Long,
    val expiredDate: Long,
    val lastModifyDate: Long,
    val code: String,
    val sym: String,
    val desc: String,
    val status: String,
)

/** Bom List Response */
data class M18BomListResponse (
    val values: List<M18BomListValue>?,
    val messages: List<M18ErrorMessages>?
)

data class M18BomListValue (
    val id: Long,
    val code: String,
    val desc: String,
)

/** Bom Response */
data class M18BomResponse (
    val data: M18BomData?,
    val messages: List<M18ErrorMessages>?
)

data class M18BomData (
    val udfbomforshop: List<M18BomUdfBomForShop>,
    val udfproduct: List<M18BomUdfProduct>,
)

data class M18BomUdfBomForShop (
    val id: Long,
    val expiredDate: Long,
    val lastModifyDate: Long,
    val code: String,
    val udfYieldratePP: BigDecimal,
    val udfHarvestUnit: String,
    val udfHarvest: String,
    val udfUnit: Long,
    val desc: String,
    val status: String,
)

data class M18BomUdfProduct (
    val id: Long,
    val udfqty: BigDecimal,
    val udfpurchaseUnit: Long,
    val udfProduct: Long,
    val udfIngredients: String,
    val udfBaseUnit: String,
)

/** Shop Response */
data class M18BusinessUnitResponse (
    val data: M18BusinessUnitData?,
    val messages: List<M18ErrorMessages>?
)

data class M18BusinessUnitData (
    val virdept: List<M18BusinessUnitVirdept>?
)

data class M18BusinessUnitVirdept (
    val id: Long,
    val code: String,
    /** name */
    val desc: String,
    val `desc_zh-TW`: String,
    /** contactNo */
    val tel: String,
    val email: String,
    val addr: String,
    val addr_en: String,
    val addr2: String,
    val addr2_en: String,
    val addr3: String,
    val addr3_en: String,
    val udfdistrict: Long,
    val lastModifyDate: Long,
)

/** BusinessUnit List Response */
data class M18BusinessUnitListResponse (
    val values: List<M18BusinessUnitListValue>?,
    val messages: List<M18ErrorMessages>?
)

data class M18BusinessUnitListValue (
    val id: Long,
    val lastModifyDate: String?,
)