import axiosInstance from "./api";
import { apiUrl } from "./endpoints";

export type SubscriptionPlan = {
  _id: string;
  id: string;
  plan_name: string;
  plan_price: string;
  plan_duration_months: number;
  android_product_id: string;
  ios_product_id: string;
  revenuecat_identifier: string;
  features: string[];
  createdAt: string;
  updatedAt: string;
};

export const getSubscriptionPlansApi = async () => {
  const res = await axiosInstance.get(apiUrl.getSubscription);
  return res.data as { status: number; data: SubscriptionPlan[] };
};