import { Router } from "express"
import { addAsync } from "@awaitjs/express"
import {
  getSubscription,
  createCheckout,
  cancelSubscription,
} from "../endpoints/subscription-management.js"
import { ROUTES } from "../constants/index.js"

const router = addAsync(Router()) as any

// Subscription management endpoints
router.getAsync(ROUTES.SUBSCRIPTION, getSubscription)
router.postAsync(ROUTES.CREATE_CHECKOUT, createCheckout)
router.postAsync(ROUTES.CANCEL_SUBSCRIPTION, cancelSubscription)

export default router
