import { apiRequest, buildQuery } from "@/lib/api-client"
import { PagedResponse } from "@/types/common"
import { Customer } from "@/types/customers"

export interface ListCustomersParams {
  page?: number
  pageSize?: number
  q?: string
}

export const customersApi = {
  list(params: ListCustomersParams = {}): Promise<PagedResponse<Customer>> {
    return apiRequest<PagedResponse<Customer>>(`/customers${buildQuery(params)}`)
  },
}
