billing - route cleanup + constants renamed
MODIFY
src/server/rest/v1/router/api/BillingRouter.ts
src/server/rest/v1/router/api/BillingRouter.ts
@@ -17,9 +17,9 @@ export default class BillingRouter {
// -----------------------------------
this.buildRouteBillingSetting();
this.buildRouteUpdateBillingSetting();
- this.buildRouteCheckBillingSettingConnection();
- this.buildRouteCheckBillingSettingPrerequisites();
- this.buildRouteActivateBillingSetting();
+ this.buildRouteCheckBillingConnection();
+ this.buildRouteCheckBillingPrerequisites();
+ this.buildRouteActivateBilling();
// -----------------------------------
// ROUTES for PAYMENT METHODS
// -----------------------------------
@@ -34,8 +34,8 @@ export default class BillingRouter {
return this.router;
}
- protected buildRouteCheckBillingSettingPrerequisites(): void {
- this.router.post(`/${ServerRoute.REST_BILLING_SETTING_CHECK_PREREQUISITES}`, (req: Request, res: Response, next: NextFunction) => {
+ protected buildRouteCheckBillingPrerequisites(): void {
+ this.router.post(`/${ServerRoute.REST_BILLING_CHECK_PREREQUISITES}`, (req: Request, res: Response, next: NextFunction) => {
void RouterUtils.handleServerAction(BillingService.handleCheckBillingSettingPrerequisites.bind(this), ServerAction.SETTINGS, req, res, next);
});
}
@@ -52,20 +52,14 @@ export default class BillingRouter {
});
}
- // protected buildRouteCheckBillingSetting(): void {
- // this.router.post(`/${ServerRoute.REST_BILLING_SETTING_CHECK}`, (req: Request, res: Response, next: NextFunction) => {
- // void RouterUtils.handleServerAction(BillingService.handleCheckBillingSetting.bind(this), ServerAction.SETTINGS, req, res, next);
- // });
- // }
-
- protected buildRouteActivateBillingSetting(): void {
- this.router.post(`/${ServerRoute.REST_BILLING_SETTING_ACTIVATE}`, (req: Request, res: Response, next: NextFunction) => {
+ protected buildRouteActivateBilling(): void {
+ this.router.post(`/${ServerRoute.REST_BILLING_ACTIVATE}`, (req: Request, res: Response, next: NextFunction) => {
void RouterUtils.handleServerAction(BillingService.handleActivateBillingSetting.bind(this), ServerAction.SETTINGS, req, res, next);
});
}
- protected buildRouteCheckBillingSettingConnection(): void {
- this.router.post(`/${ServerRoute.REST_BILLING_SETTING_CHECK_CONNECTION}`, (req: Request, res: Response, next: NextFunction) => {
+ protected buildRouteCheckBillingConnection(): void {
+ this.router.post(`/${ServerRoute.REST_BILLING_CHECK_CONNECTION}`, (req: Request, res: Response, next: NextFunction) => {
void RouterUtils.handleServerAction(BillingService.handleCheckBillingSettingConnection.bind(this), ServerAction.SETTINGS, req, res, next);
});
}

MODIFY
src/types/Server.ts
src/types/Server.ts
@@ -506,11 +506,8 @@ export enum ServerRoute {
REST_BILLING_PAYMENT_METHOD_ATTACH = 'users/:userID/payment-methods/:paymentMethodID/attach',
REST_BILLING_PAYMENT_METHOD_DETACH = 'users/:userID/payment-methods/:paymentMethodID/detach',
- // BILLING SETTING URLs
- // REST_BILLING_SETTINGS = 'billing-settings',
- REST_BILLING_SETTING = 'billing-setting',
- // REST_BILLING_SETTING_CHECK = 'billing-settings/:id/check',
- REST_BILLING_SETTING_CHECK_CONNECTION = 'billing/check-connection',
- REST_BILLING_SETTING_CHECK_PREREQUISITES = 'billing/check-prerequisites',
- REST_BILLING_SETTING_ACTIVATE = 'billing/activate',
+ REST_BILLING_SETTING = 'billing-setting', // GET and PUT
+ REST_BILLING_CHECK_CONNECTION = 'billing/check-connection',
+ REST_BILLING_CHECK_PREREQUISITES = 'billing/check-prerequisites',
+ REST_BILLING_ACTIVATE = 'billing/activate',
}

billing - route cleanup + constants renamed