import { IPaginatedQuery } from '@/core/models/service.model';

const baseUrl = () => `/api/v1/consumer/sale-invoices`;

export const CONSUMER_SALE_INVOICES_API_ROUTES = {
  list: (paginationQuery?: IPaginatedQuery) => {
    if (!paginationQuery) return baseUrl();
    const params = new URLSearchParams();
    if (paginationQuery.page) params.set('page', String(paginationQuery.page));
    if (paginationQuery.pageSize) params.set('perPage', String(paginationQuery.pageSize));
    const query = params.toString();
    return query ? `${baseUrl()}?${query}` : baseUrl();
  },
  single: (id: string) => `${baseUrl()}/${id}`,
};
