package id.iiyh.inatrading.feature.cart.data.model

data class CartCreateRequest(
    val sellerId: String,
    val quantity: Int,
    val productModelId: String,
    val productMeasurementId: String = "",
    val warehouseId: String,
)

data class CartUpdateRequest(
    val cartItemId: String,
    val quantity: Int,
)

data class CartSeller(
    val id: String? = null,
    val image: String? = null,
    val name: String? = null,
)

data class CartProductModel(
    val currency: String? = null,
    val id: String? = null,
    val image: String? = null,
    val name: String? = null,
    val price: Double? = null,
)

data class CartProductMeasurement(
    val id: String? = null,
    val name: String? = null,
)

data class CartItem(
    val id: String? = null,
    val productMeasurement: CartProductMeasurement? = null,
    val productModel: CartProductModel? = null,
    val quantity: Int? = null,
    val warehouseId: String? = null,
)

data class CartGroup(
    val cartItems: List<CartItem> = emptyList(),
    val id: String? = null,
    val seller: CartSeller? = null,
)

data class CartListResponse(
    val responseCode: String? = null,
    val responseDesc: String? = null,
    val rows: List<CartGroup> = emptyList(),
    val totalItem: Int = 0,
    val totalPage: Int = 0,
) {
    val isSuccess: Boolean get() = responseCode == "0000"
}
