create customer
This commit is contained in:
1 parent
7b207f2ccb
commit
01c0e9ef4d
11 files changed
+159
-14
No files matched your search
@@ -1,6 +1,11 @@
|
||||
import { Router } from "express";
|
||||
import BillingController from "@/controllers/BillingController.js";
|
||||
import { verifyToken } from "@/middleware/VerifyToken.js";
|
||||
import { validateBody } from "@/middleware/validation.js";
|
||||
import { subscribePlanSchema } from "@/validation/index.js";
|
||||
import { verifyOrgPermission } from "@/middleware/VerifyPermission.js";
|
||||
import { PERMISSIONS } from "@/types/permissions.js";
|
||||
import { addUserContext } from "@/middleware/AddUserContext.js";
|
||||
|
||||
class BillingRoutes {
|
||||
private router;
|
||||
@@ -13,7 +18,14 @@ class BillingRoutes {
|
||||
|
||||
initRoutes = () => {
|
||||
this.router.get("/plans", verifyToken, this.controller.listPlans);
|
||||
this.router.post("/subscribe", verifyToken, this.controller.subscribePlan);
|
||||
this.router.post(
|
||||
"/subscribe",
|
||||
verifyToken,
|
||||
addUserContext,
|
||||
verifyOrgPermission([PERMISSIONS.billing.all]),
|
||||
validateBody(subscribePlanSchema),
|
||||
this.controller.subscribePlan
|
||||
);
|
||||
};
|
||||
|
||||
getRouter() {
|
||||
|
||||
Reference in new issue
Block a user