package com.example.ops_android.data.remote.api

import com.example.ops_android.data.model.Customer
import com.example.ops_android.data.remote.ApiResponse
import retrofit2.http.Body
import retrofit2.http.POST

data class CustomerListRequest(
    val search: String? = null,
    val page: Int = 1,
    val page_size: Int = 10
)

data class CustomerListResponse(
    val customers: List<Customer>?
)

data class CustomerGetRequest(
    val id: Int
)

data class CustomerResponse(
    val customer: Customer?
)

interface CustomerApi {

    @POST("/customer/list")
    suspend fun list(@Body request: CustomerListRequest): ApiResponse<CustomerListResponse>

    @POST("/customer/get")
    suspend fun get(@Body request: CustomerGetRequest): ApiResponse<CustomerResponse>

    @POST("/customer/add")
    suspend fun add(@Body request: Map<String, @JvmSuppressWildcards Any>): ApiResponse<Any>

    @POST("/customer/update")
    suspend fun update(@Body request: Map<String, @JvmSuppressWildcards Any>): ApiResponse<Any>

    @POST("/customer/delete")
    suspend fun delete(@Body request: Map<String, @JvmSuppressWildcards Int>): ApiResponse<Any>
}
