import { baseClient } from './base.js';

export const billingApi = {
  createCheckoutSession(workspaceId, plan, successUrl, cancelUrl) {
    return baseClient.post('/billing/checkout', {
      workspaceId,
      plan,
      successUrl,
      cancelUrl,
    });
  },

  createPortalSession(returnUrl) {
    return baseClient.post('/billing/portal', { returnUrl });
  },

  getSubscription(workspaceId) {
    return baseClient.get(`/workspaces/${workspaceId}/subscription`);
  },
};
