package es.verdnatura.presentation.view.feature.sacador.model

//Tarea 5890
// Sacado reservado

class CollectionTicket(
    var collectionFk: Int,
    var created: String? = null,
    var ticketTotalCount: Int = 0,
    var tickets: MutableList<Ticket> = mutableListOf(),
    var isError: Boolean = false,
    var errorMessage: String = "",
)

data class Ticket(
    val ticketFk: Int,
    var level: String?,
    var rgb: String?,
    val agencyName: String,
    val salesPersonFk: Int,
    val observations: String?,
    val warehouseFk: Int,
    val sales: MutableList<Sale> = mutableListOf()
)
data class Sale(
    val itemShelvingSaleFk: Int,
    val ticketFk: Int,
    val saleGroupFk: Int?,
    val saleFk: Int,
    val itemFk: Int,
    val longName: String,
    val size: Int,
    var semaphore: String?,
    val color: String ="",
    val productor: String?="",
    val origin: String="",
    val concept: String="",
    val packing: Int?=null,
    val grouping: Int?=null,
    val isAdded: Int=0,
    val workerFk: Int,
    val packingShelve: Int = 0,
    val hasMistake: Boolean?,
    val originalQuantity: Int?,
    var saleQuantity: Int,
    var reservedQuantity: Int= 0 ,
    val code: String? = null,
    val parkingCode: String?=null,
    val pickingOrder: Int?=null,
    var sonSales: MutableList<Sale> = mutableListOf(),
    var placements: List<PlacementVO> = listOf(),
    var Barcodes: List<String> = listOf(),
    var isParent: Boolean = false,
    //para agrupar
    var totalSales: Int = 0,
    //para mostar el level del ticket
    var level: String? = "",
    //para pintar color
    var rgb: String? = "",
    var isPicked: Int=0,
    var accumulatedQuantity:Int=0,
    var totalItemShelving: Int =0,
    var currentItemShelving:Int = 0


)

class CollectionTicketList(
    var list: List<CollectionTicket> = listOf()
)
// colecciones anteriores

class CollectionListVO(
    var list: List<CollectionVO> = listOf()
)

class CollectionVO(
    var collectionFk: Int,
    var created: String = "",
    var tickets: List<TicketVO> = listOf(),
    var isError: Boolean = false,
    var errorMessage: String = "",
    var itemPackingTypeFk: String = "",
    var rgb: String? = null,
    var ticketTotalCount: Int? = null
)

class TicketVO(
    var ticketFk: String = "",
    var level: String = "",
    var rgb: String?,
    var agencyName: String = "",
    var salesPersonFk: String = "",
    var sales: List<SaleVO> = listOf(),
    var observations: String = "",

    )

class SaleVO(
    var ticketFk: String = "",
    var level: String = "",
    var rgb: String?,
    var agencyName: String = "",
    var saleOrder: Int = 9999,
    var saleFk: Int,
    var itemFk: Int = 0,
    var quantity: Int?,
    var longName: String = "",
    var size: String = "",
    var reserved: String = "",
    var isPreviousPrepared: String = "",
    var isPrepared: String = "",
    var isControlled: String = "",
    var isPreControlled: String = "",
    var color: String = "",
    var productor: String = "",
    var discount: String = "",
    var price: String = "",
    var stems: String = "",
    var category: String = "",
    var origin: String = "",
    var clientFk: String = "",
    var originalQuantity: Int?,
    var line1: String = "",
    var line2: String? = "",
    var line3: String = "",
    var isAdded: String = "",
    var pickedQuantity: Int? = 0,
    var workerFk: String,
    var placements: List<PlacementVO> = listOf(),
    var Barcodes: List<String> = listOf(),
    var isNew: Boolean = false,
    var salePersonFk: String = "",
    var packingType: String? = "",
    var cel1: String = "",
    var cel2: String = "",
    var cel3: String = "",
    var saleGroupFk: String = "",
    var packingShelve: String = "",
    var picked: String = "",
    var isParent: Boolean = false,
    var totalSales: Int = 0,
    var sonSales: MutableList<SaleVO> = mutableListOf(),
    var code: String = "",
    var hasMistake: Boolean = false,
    var sectorFk: Int? = null


)

class PlacementVO(
    var saleFk: String = "",
    var itemFk: String = "",
    var placement: String = "",
    var parking: String = "",
    var stockTotal: String = "",
    var shelving: String = "",
    var created: String = "",
    var visible: String = "",
    var order: String = "",
    var grouping: String = "",
    var priority: String = "",
    var saleOrder: String = "",
    var isPreviousPrepared: String = "",
    var itemShelvingSaleFk: String = "",
    var ticketFk: String = "",
    var id: String = "",
    var pickingOrder: Int = 0

)

class PlacementSupplyVO(
    var itemFk: String = "",
    var longName: String = "",
    var size: String = "",
    var subName: String = "",
    var itemShelvingFk: Int,
    var shelving: String = "",
    var stock: String = "",
    var total: String = "",
    var proposal: String = "",
    var isError: Boolean = false,
    var errorMessage: String = ""
)

class PlacementSupplyListVO(
    var list: List<PlacementSupplyVO> = listOf()
)

class MistakeTypeVO(
    var id: Int,
    var description: String
)

class MistakeTypeListVO(
    var list: List<MistakeTypeVO> = listOf()
)

val barcodes = listOf("12345678","87654321","11111111","00000000")

val sale1 = Sale(
    13421890,4475590, null, 42272072, 24460, "Lilium Oriental Signum 4", 90, null,
    "Blanco", "Bakker Lilies", "NLD", "LO Signum 4", 120, 10, 0, 24981,
    180, false, 10, 100, 10, null, null, 6,
)

val sale2 = Sale(
    13421889,4474654, null, 42263590, 61148, "Paniculata Rainbow MA 40 gr", 75, null,
    "Mixto", "Malima", "ECU", "PAN Rainbow MA 40 gr", 250, 25, 0, 24981,
    600, false, 25, 250, 30, null, null, 5
)

val sale3 = Sale(
    13421888,4475611, null, 42272185, 56628, "Lilium Oriental A2 Roselily 2", 70, null,
    "Mixto", "Moerman Lilium BV", "NLD", "LO A2 Roselily 2", 40, 10, 0, 24981,
    200, false, 80, 800, 20, null, null, 4
)

val sale4 = Sale(
    13421887,4475611, null, 42272186, 34087, "Lilium Asiatico Brindisi 4-5", 95, null,
    "Rosa", "Double Check Lily", "NLD", "LA Brindisi 4-5", 60, 10, 0, 24981,
    160, false, 60, 600, 10, null, null, 3
)

val sale5 = Sale(
    13421886,4474654, null, 42263585, 77582, "Clavel Red Fancy", 60, "2",
    "Rojo", "Daliaflora", "COL", "CL Red FCY", 15, 25, 0, 24981,
    933, true, 250, 250, 30, "KQS", "GA-24-3", 1, Barcodes = barcodes
)

val sale6 = Sale(
    13421885,4474654, null, 42263588, 117832, "Rosa Freedom", 50, "1",
    "Rojo", "Multiflora", "COL", "RS Freedom", 200, 25, 0, 24981,
    403, true, 25, 250, 25, "IXF", "B-29-1", 2
)
val sale7 = Sale(
    13421898,4475590, 222154, 42272074, 10067, "Brillo Floralife", 10, "3",
    "Negro", null, "---", "Brillo Floralife", 12, 1, 0, 24981,
    179020, false, 3, 30, 30, null, "CH--43", 121930
)
val sale8 = Sale(
    13421883,4475557, 222152, 42271653, 103803, "Bolsa Kraft Blanco", 1, null,
    "Blanco", null, "NLD", "Bolsa Kraft Blanco", 250, 25, 0, 24981,
    1000, false, 25, 250, 250, null, "CH--43", 121930
)
val listaDeSales: MutableList<Sale> = mutableListOf(sale1, sale7) // 4475590
val listaDeSales2: MutableList<Sale> = mutableListOf(sale2, sale5, sale6) //4474654
val listaDeSales3: MutableList<Sale> = mutableListOf(sale3, sale4) //4475611
val listaDeSales4: MutableList<Sale> = mutableListOf(sale8) //4475557


var ticketLocal = mutableListOf(
    Ticket(
        4475590,
        "ROJO",
        "#ff0000",
        "VIAEXPRESS Interdia",
        4994,
        "",
        60,
        sales = listaDeSales
    ),
    Ticket(
        4474654,
        "AMARILLO",
        "#ffce30",
        "MRW ECOM-TARDE",
        4994,
        "En agua",
        60,
        sales = listaDeSales2
    ),
    Ticket(
        4475611,
        "VERDE",
        "#008000",
        "MRW ECOM-TARDE",
        6264,
        "En seco",
        60,
        sales = listaDeSales3
    ),

    Ticket(
        4475557,
        "ROJO",
        "#ff0000",
        "VIAEXPRESS Interdia",
        4994,
        "",
        60,
        sales = listaDeSales4
    ),
)

var collectionLocal = CollectionTicket(
    895071,
    "2023-09-20",
    3,
    tickets = ticketLocal
)
