import { httpPostRequest, APIUrlGenerator } from "@/utils/baseHttpService";
import { API_ROUTES } from "@/constant/routes";
import {
  DiscountUsageFilters,
  DiscountUsageResponse,
  CustomerDiscountUsageFilters,
  CustomerDiscountUsageResponse,
} from "./_models";

export const getDiscountUsageReport = async (
  filters: DiscountUsageFilters
): Promise<DiscountUsageResponse> => {
  const response = await httpPostRequest<DiscountUsageResponse>(
    APIUrlGenerator(API_ROUTES.DISCOUNT_USAGE_REPORT),
    filters
  );
  return response.data;
};

export const getCustomerDiscountUsageReport = async (
  filters: CustomerDiscountUsageFilters
): Promise<CustomerDiscountUsageResponse> => {
  const response = await httpPostRequest<CustomerDiscountUsageResponse>(
    APIUrlGenerator(API_ROUTES.CUSTOMER_DISCOUNT_USAGE_REPORT),
    filters
  );
  return response.data;
};

