moahmedwafy commited on
Commit
ccb54a8
·
1 Parent(s): 2e01f1b

feat: add swagger summary and description

Browse files
.sc.png DELETED
Binary file (142 kB)
 
src/lib/decorators/{prefix.decorator.ts → controller.decorator.ts} RENAMED
@@ -2,7 +2,13 @@ import { swaggerRegistry } from "@lib/swagger/swagger";
2
  import { BaseController } from "../controllers/controller.base";
3
  import { getCallingFileName } from "@lib/utils/calling-file.helper";
4
 
5
- export const Controller = (prefix: string) => {
 
 
 
 
 
 
6
  return (target: typeof BaseController) => {
7
  const originalConstructor = target;
8
  const newConstructor: any = function (...args: any[]) {
@@ -12,18 +18,25 @@ export const Controller = (prefix: string) => {
12
  };
13
  newConstructor.prototype = originalConstructor.prototype;
14
 
15
- target.prototype.constructor['targetName'] = target.prototype.constructor.name + getCallingFileName();
 
16
  swaggerRegistry.setControllerPrefix(
17
- target.prototype.constructor['targetName'],
18
  prefix
19
  );
20
- swaggerRegistry.setControllerTags(target.prototype.constructor['targetName'], [
21
- prefix
22
- .split("/")
23
- .slice(1)
24
- .map((tag) => tag.charAt(0).toUpperCase() + tag.slice(1))
25
- .join(" - "),
26
- ]);
 
 
 
 
 
 
27
  return newConstructor;
28
  };
29
  };
 
2
  import { BaseController } from "../controllers/controller.base";
3
  import { getCallingFileName } from "@lib/utils/calling-file.helper";
4
 
5
+ export const Controller = (
6
+ prefix: string,
7
+ options: { autoTag?: boolean } = {}
8
+ ) => {
9
+ // default options
10
+ const { autoTag = true } = options;
11
+
12
  return (target: typeof BaseController) => {
13
  const originalConstructor = target;
14
  const newConstructor: any = function (...args: any[]) {
 
18
  };
19
  newConstructor.prototype = originalConstructor.prototype;
20
 
21
+ target.prototype.constructor["targetName"] =
22
+ target.prototype.constructor.name + getCallingFileName();
23
  swaggerRegistry.setControllerPrefix(
24
+ target.prototype.constructor["targetName"],
25
  prefix
26
  );
27
+
28
+ if (autoTag) {
29
+ swaggerRegistry.setControllerTags(
30
+ target.prototype.constructor["targetName"],
31
+ [
32
+ prefix
33
+ .split("/")
34
+ .slice(1)
35
+ .map((tag) => tag.charAt(0).toUpperCase() + tag.slice(1))
36
+ .join(" - "),
37
+ ]
38
+ );
39
+ }
40
  return newConstructor;
41
  };
42
  };
src/lib/decorators/{swagger-tags.decorator.ts → swagger-controller-tags.decorator.ts} RENAMED
@@ -1,11 +1,10 @@
1
  import { swaggerRegistry } from "@lib/swagger/swagger";
2
  import { getCallingFileName } from "@lib/utils/calling-file.helper";
3
 
4
- export const SwaggerTags = (...tags: string[]) => {
5
  if (!tags.length) return;
6
  return (target: any) => {
7
  target.constructor['targetName'] = target.prototype.constructor.name = getCallingFileName();
8
- target = target.prototype.constructor.name + getCallingFileName();
9
- swaggerRegistry.setControllerTags(target, tags);
10
  };
11
  };
 
1
  import { swaggerRegistry } from "@lib/swagger/swagger";
2
  import { getCallingFileName } from "@lib/utils/calling-file.helper";
3
 
4
+ export const SwaggerControllerTags = (...tags: string[]) => {
5
  if (!tags.length) return;
6
  return (target: any) => {
7
  target.constructor['targetName'] = target.prototype.constructor.name = getCallingFileName();
8
+ swaggerRegistry.setControllerTags(target.constructor['targetName'], tags);
 
9
  };
10
  };
src/lib/decorators/swagger-description.decorator.ts ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { swaggerRegistry } from "@lib/swagger/swagger";
2
+ import { getCallingFileName } from "@lib/utils/calling-file.helper";
3
+
4
+ export const SwaggerDescription = (description: string) => {
5
+ return (target: any, propertyKey: string) => {
6
+ target.constructor['targetName'] = target.constructor.name + getCallingFileName()
7
+ swaggerRegistry.updateRoute(target.constructor.name + getCallingFileName(), {
8
+ propertyKey,
9
+ description,
10
+ });
11
+ };
12
+ };
src/lib/decorators/swagger-endpoint-tags.decorator.ts ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { swaggerRegistry } from "@lib/swagger/swagger";
2
+ import { getCallingFileName } from "@lib/utils/calling-file.helper";
3
+
4
+ export const SwaggerEndpointTags = (...tags: string[]) => {
5
+ if (!tags.length) return;
6
+ return (target: any, propertyKey: string) => {
7
+ target.constructor['targetName'] = target.constructor.name + getCallingFileName()
8
+ swaggerRegistry.updateRoute(target.constructor.name + getCallingFileName(), {
9
+ propertyKey,
10
+ tags,
11
+ });
12
+ };
13
+ };
src/lib/decorators/swagger-routes.decorator.ts CHANGED
@@ -7,7 +7,7 @@ export const SwaggerRoute = (
7
  ) => {
8
  return (target: any, propertyKey: string) => {
9
  target.constructor['targetName'] = target.constructor.name + getCallingFileName()
10
- swaggerRegistry.updateRoute(target.constructor.name + getCallingFileName(), {
11
  propertyKey,
12
  path,
13
  method,
 
7
  ) => {
8
  return (target: any, propertyKey: string) => {
9
  target.constructor['targetName'] = target.constructor.name + getCallingFileName()
10
+ swaggerRegistry.updateRoute(target.constructor['targetName'], {
11
  propertyKey,
12
  path,
13
  method,
src/lib/decorators/swagger-summary.decorator.ts ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { swaggerRegistry } from "@lib/swagger/swagger";
2
+ import { getCallingFileName } from "@lib/utils/calling-file.helper";
3
+
4
+ export const SwaggerSummary = (summary: string) => {
5
+ return (target: any, propertyKey: string) => {
6
+ target.constructor['targetName'] = target.constructor.name + getCallingFileName()
7
+ swaggerRegistry.updateRoute(target.constructor.name + getCallingFileName(), {
8
+ propertyKey,
9
+ summary,
10
+ });
11
+ };
12
+ };
src/lib/swagger/swagger.ts CHANGED
@@ -13,6 +13,10 @@ class SwaggerRegistry {
13
  method?: "get" | "post" | "put" | "patch" | "delete";
14
  request?: any;
15
  response?: any;
 
 
 
 
16
  }[];
17
  prefix: string;
18
  tags?: string[];
@@ -77,6 +81,10 @@ class SwaggerRegistry {
77
  method?: "get" | "post" | "put" | "patch" | "delete";
78
  request?: any;
79
  response?: any;
 
 
 
 
80
  }
81
  ) {
82
  this.initControllerIfNotExists(controller);
@@ -124,7 +132,9 @@ class SwaggerRegistry {
124
  bearerAuth: [],
125
  },
126
  ],
127
- tags: controllerData.tags,
 
 
128
  responses: {
129
  200: {
130
  description: "Success",
@@ -146,22 +156,6 @@ class SwaggerRegistry {
146
  },
147
  };
148
  }
149
-
150
- if (!paths[route.path].summary) {
151
- paths[route.path].summary = route.propertyKey;
152
- }
153
-
154
- if (!paths[route.path].description) {
155
- paths[route.path].description = route.propertyKey;
156
- }
157
-
158
- if (!paths[route.path].parameters) {
159
- paths[route.path].parameters = [];
160
- }
161
-
162
- if (!paths[route.path].responses) {
163
- paths[route.path].responses = [];
164
- }
165
  });
166
  });
167
 
 
13
  method?: "get" | "post" | "put" | "patch" | "delete";
14
  request?: any;
15
  response?: any;
16
+ query?: any;
17
+ description?: string;
18
+ summary?: string;
19
+ tags?: string[];
20
  }[];
21
  prefix: string;
22
  tags?: string[];
 
81
  method?: "get" | "post" | "put" | "patch" | "delete";
82
  request?: any;
83
  response?: any;
84
+ query?: any;
85
+ description?: string;
86
+ summary?: string;
87
+ tags?: string[];
88
  }
89
  ) {
90
  this.initControllerIfNotExists(controller);
 
132
  bearerAuth: [],
133
  },
134
  ],
135
+ tags: [...(controllerData.tags || []), ...(route.tags || [])],
136
+ summary: route.summary,
137
+ description: route.description,
138
  responses: {
139
  200: {
140
  description: "Success",
 
156
  },
157
  };
158
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  });
160
  });
161
 
src/modules/console/modules/admins/controllers/admins.controller.ts CHANGED
@@ -1,7 +1,7 @@
1
  import { asyncHandler } from "@helpers/async-handler";
2
  import { paramsValidator, bodyValidator } from "@helpers/validation.helper";
3
  import { BaseController } from "@lib/controllers/controller.base";
4
- import { Controller } from "@lib/decorators/prefix.decorator";
5
  import { Request, Response } from "express";
6
  import { AdminsService } from "../services/admins.service";
7
  import {
@@ -24,6 +24,8 @@ import {
24
  } from "@lib/decorators/swagger-routes.decorator";
25
  import { SwaggerResponse } from "@lib/decorators/swagger-response.decorator";
26
  import { SwaggerRequest } from "@lib/decorators/swagger-request.decorator";
 
 
27
 
28
  @Controller("/console/admins")
29
  @ControllerMiddleware(AdminGuardMiddleware({ roles: [Role.SUPER_ADMIN] }))
@@ -53,6 +55,8 @@ export class AdminsController extends BaseController {
53
 
54
  @SwaggerGet()
55
  @SwaggerResponse([AdminSerialization])
 
 
56
  list = async (
57
  req: Request,
58
  res: Response<IJSONSuccessResponse<AdminSerialization[]>>
@@ -74,6 +78,8 @@ export class AdminsController extends BaseController {
74
 
75
  @SwaggerGet("/:id")
76
  @SwaggerResponse(AdminSerialization)
 
 
77
  get = async (
78
  req: Request<{ id: string }>,
79
  res: Response<IJSONSuccessResponse<AdminSerialization>>
@@ -93,6 +99,8 @@ export class AdminsController extends BaseController {
93
  @SwaggerPost()
94
  @SwaggerResponse(AdminSerialization)
95
  @SwaggerRequest(createAdminSchema)
 
 
96
  create = async (
97
  req: Request<{}, {}, ICreateAdmin>,
98
  res: Response<IJSONSuccessResponse<AdminSerialization>>
@@ -111,6 +119,8 @@ export class AdminsController extends BaseController {
111
  @SwaggerPatch("/:id")
112
  @SwaggerResponse(AdminSerialization)
113
  @SwaggerRequest(createAdminSchema)
 
 
114
  update = async (
115
  req: Request<{ id: string }, {}, ICreateAdmin>,
116
  res: Response<IJSONSuccessResponse<AdminSerialization>>
@@ -132,6 +142,8 @@ export class AdminsController extends BaseController {
132
 
133
  @SwaggerDelete("/:id")
134
  @SwaggerResponse(AdminSerialization)
 
 
135
  delete = async (
136
  req: Request<{ id: string }>,
137
  res: Response<IJSONSuccessResponse<AdminSerialization>>
 
1
  import { asyncHandler } from "@helpers/async-handler";
2
  import { paramsValidator, bodyValidator } from "@helpers/validation.helper";
3
  import { BaseController } from "@lib/controllers/controller.base";
4
+ import { Controller } from "@lib/decorators/controller.decorator";
5
  import { Request, Response } from "express";
6
  import { AdminsService } from "../services/admins.service";
7
  import {
 
24
  } from "@lib/decorators/swagger-routes.decorator";
25
  import { SwaggerResponse } from "@lib/decorators/swagger-response.decorator";
26
  import { SwaggerRequest } from "@lib/decorators/swagger-request.decorator";
27
+ import { SwaggerSummary } from "@lib/decorators/swagger-summary.decorator";
28
+ import { SwaggerDescription } from "@lib/decorators/swagger-description.decorator";
29
 
30
  @Controller("/console/admins")
31
  @ControllerMiddleware(AdminGuardMiddleware({ roles: [Role.SUPER_ADMIN] }))
 
55
 
56
  @SwaggerGet()
57
  @SwaggerResponse([AdminSerialization])
58
+ @SwaggerSummary("List all admins")
59
+ @SwaggerDescription("List all admins")
60
  list = async (
61
  req: Request,
62
  res: Response<IJSONSuccessResponse<AdminSerialization[]>>
 
78
 
79
  @SwaggerGet("/:id")
80
  @SwaggerResponse(AdminSerialization)
81
+ @SwaggerSummary("Get admin by id")
82
+ @SwaggerDescription("Get admin by id")
83
  get = async (
84
  req: Request<{ id: string }>,
85
  res: Response<IJSONSuccessResponse<AdminSerialization>>
 
99
  @SwaggerPost()
100
  @SwaggerResponse(AdminSerialization)
101
  @SwaggerRequest(createAdminSchema)
102
+ @SwaggerSummary("Create new admin")
103
+ @SwaggerDescription("Creates a new admin with role of admin")
104
  create = async (
105
  req: Request<{}, {}, ICreateAdmin>,
106
  res: Response<IJSONSuccessResponse<AdminSerialization>>
 
119
  @SwaggerPatch("/:id")
120
  @SwaggerResponse(AdminSerialization)
121
  @SwaggerRequest(createAdminSchema)
122
+ @SwaggerSummary("Update admin")
123
+ @SwaggerDescription("Updates an admin")
124
  update = async (
125
  req: Request<{ id: string }, {}, ICreateAdmin>,
126
  res: Response<IJSONSuccessResponse<AdminSerialization>>
 
142
 
143
  @SwaggerDelete("/:id")
144
  @SwaggerResponse(AdminSerialization)
145
+ @SwaggerSummary("Delete admin")
146
+ @SwaggerDescription("Deletes an admin")
147
  delete = async (
148
  req: Request<{ id: string }>,
149
  res: Response<IJSONSuccessResponse<AdminSerialization>>
src/modules/console/modules/auth/controllers/auth.controller.ts CHANGED
@@ -2,7 +2,7 @@ import { asyncHandler } from "@helpers/async-handler";
2
  import { serialize } from "@helpers/serialize";
3
  import { bodyValidator } from "@helpers/validation.helper";
4
  import { BaseController } from "@lib/controllers/controller.base";
5
- import { Controller } from "@lib/decorators/prefix.decorator";
6
  import { JsonResponse } from "@lib/responses/json-response";
7
  import { Request, Response } from "express";
8
  import { loginValidationSchema } from "modules/users/modules/auth/validation/login.validation";
 
2
  import { serialize } from "@helpers/serialize";
3
  import { bodyValidator } from "@helpers/validation.helper";
4
  import { BaseController } from "@lib/controllers/controller.base";
5
+ import { Controller } from "@lib/decorators/controller.decorator";
6
  import { JsonResponse } from "@lib/responses/json-response";
7
  import { Request, Response } from "express";
8
  import { loginValidationSchema } from "modules/users/modules/auth/validation/login.validation";
src/modules/console/modules/equipments/controllers/equipments.controller.ts CHANGED
@@ -4,7 +4,7 @@ import { parsePaginationQuery } from "@helpers/pagination";
4
  import { asyncHandler } from "@helpers/async-handler";
5
  import { paramsValidator, bodyValidator } from "@helpers/validation.helper";
6
  import { BaseController } from "@lib/controllers/controller.base";
7
- import { Controller } from "@lib/decorators/prefix.decorator";
8
  import { serialize } from "@helpers/serialize";
9
  import { ControllerMiddleware } from "@lib/decorators/controller-middleware.decorator";
10
  import { AdminGuardMiddleware } from "modules/console/common/guards/admins.guard";
 
4
  import { asyncHandler } from "@helpers/async-handler";
5
  import { paramsValidator, bodyValidator } from "@helpers/validation.helper";
6
  import { BaseController } from "@lib/controllers/controller.base";
7
+ import { Controller } from "@lib/decorators/controller.decorator";
8
  import { serialize } from "@helpers/serialize";
9
  import { ControllerMiddleware } from "@lib/decorators/controller-middleware.decorator";
10
  import { AdminGuardMiddleware } from "modules/console/common/guards/admins.guard";
src/modules/console/modules/exercises/controllers/exercises.controller.ts CHANGED
@@ -4,7 +4,7 @@ import { parsePaginationQuery } from "@helpers/pagination";
4
  import { paramsValidator, bodyValidator } from "@helpers/validation.helper";
5
  import { BaseController } from "@lib/controllers/controller.base";
6
  import { ControllerMiddleware } from "@lib/decorators/controller-middleware.decorator";
7
- import { Controller } from "@lib/decorators/prefix.decorator";
8
  import { JsonResponse } from "@lib/responses/json-response";
9
  import { AdminGuardMiddleware } from "modules/console/common/guards/admins.guard";
10
  import { ExercisesService } from "../services/exercises.service";
 
4
  import { paramsValidator, bodyValidator } from "@helpers/validation.helper";
5
  import { BaseController } from "@lib/controllers/controller.base";
6
  import { ControllerMiddleware } from "@lib/decorators/controller-middleware.decorator";
7
+ import { Controller } from "@lib/decorators/controller.decorator";
8
  import { JsonResponse } from "@lib/responses/json-response";
9
  import { AdminGuardMiddleware } from "modules/console/common/guards/admins.guard";
10
  import { ExercisesService } from "../services/exercises.service";
src/modules/console/modules/muscles/controllers/muscles.controller.ts CHANGED
@@ -4,7 +4,7 @@ import { parsePaginationQuery } from "@helpers/pagination";
4
  import { asyncHandler } from "@helpers/async-handler";
5
  import { paramsValidator, bodyValidator } from "@helpers/validation.helper";
6
  import { BaseController } from "@lib/controllers/controller.base";
7
- import { Controller } from "@lib/decorators/prefix.decorator";
8
  import { serialize } from "@helpers/serialize";
9
  import { ControllerMiddleware } from "@lib/decorators/controller-middleware.decorator";
10
  import { AdminGuardMiddleware } from "modules/console/common/guards/admins.guard";
 
4
  import { asyncHandler } from "@helpers/async-handler";
5
  import { paramsValidator, bodyValidator } from "@helpers/validation.helper";
6
  import { BaseController } from "@lib/controllers/controller.base";
7
+ import { Controller } from "@lib/decorators/controller.decorator";
8
  import { serialize } from "@helpers/serialize";
9
  import { ControllerMiddleware } from "@lib/decorators/controller-middleware.decorator";
10
  import { AdminGuardMiddleware } from "modules/console/common/guards/admins.guard";
src/modules/console/modules/users/controllers/users.controller.ts CHANGED
@@ -3,7 +3,7 @@ import { JsonResponse } from "@lib/responses/json-response";
3
  import { Request, Response } from "express";
4
  import { asyncHandler } from "@helpers/async-handler";
5
  import { BaseController } from "@lib/controllers/controller.base";
6
- import { Controller } from "@lib/decorators/prefix.decorator";
7
  import { serialize } from "@helpers/serialize";
8
  import { UserSerialization } from "@common/serializers/user.serialization";
9
  import { SwaggerPost } from "@lib/decorators/swagger-routes.decorator";
 
3
  import { Request, Response } from "express";
4
  import { asyncHandler } from "@helpers/async-handler";
5
  import { BaseController } from "@lib/controllers/controller.base";
6
+ import { Controller } from "@lib/decorators/controller.decorator";
7
  import { serialize } from "@helpers/serialize";
8
  import { UserSerialization } from "@common/serializers/user.serialization";
9
  import { SwaggerPost } from "@lib/decorators/swagger-routes.decorator";
src/modules/console/modules/workouts/controllers/workouts.controller.ts CHANGED
@@ -7,7 +7,7 @@ import { paramsValidator, bodyValidator } from "@helpers/validation.helper";
7
  import { createWorkoutSchema } from "../validations/create-workout.validation";
8
  import { updateWorkoutSchema } from "../validations/update-workout.validation";
9
  import { BaseController } from "@lib/controllers/controller.base";
10
- import { Controller } from "@lib/decorators/prefix.decorator";
11
  import { serialize } from "@helpers/serialize";
12
  import { WorkoutSerialization } from "@common/serializers/workout.serialization";
13
  import { ControllerMiddleware } from "@lib/decorators/controller-middleware.decorator";
 
7
  import { createWorkoutSchema } from "../validations/create-workout.validation";
8
  import { updateWorkoutSchema } from "../validations/update-workout.validation";
9
  import { BaseController } from "@lib/controllers/controller.base";
10
+ import { Controller } from "@lib/decorators/controller.decorator";
11
  import { serialize } from "@helpers/serialize";
12
  import { WorkoutSerialization } from "@common/serializers/workout.serialization";
13
  import { ControllerMiddleware } from "@lib/decorators/controller-middleware.decorator";
src/modules/users/modules/auth/controllers/auth.controller.ts CHANGED
@@ -8,7 +8,7 @@ import {
8
  import { asyncHandler } from "@helpers/async-handler";
9
  import { bodyValidator } from "@helpers/validation.helper";
10
  import { BaseController } from "@lib/controllers/controller.base";
11
- import { Controller } from "@lib/decorators/prefix.decorator";
12
  import { serialize } from "@helpers/serialize";
13
  import { UserSerialization } from "@common/serializers/user.serialization";
14
  import { UsersAuthService } from "../services/users-auth.service";
 
8
  import { asyncHandler } from "@helpers/async-handler";
9
  import { bodyValidator } from "@helpers/validation.helper";
10
  import { BaseController } from "@lib/controllers/controller.base";
11
+ import { Controller } from "@lib/decorators/controller.decorator";
12
  import { serialize } from "@helpers/serialize";
13
  import { UserSerialization } from "@common/serializers/user.serialization";
14
  import { UsersAuthService } from "../services/users-auth.service";
src/modules/users/modules/exercises/controllers/exercises.controller.ts CHANGED
@@ -5,7 +5,7 @@ import { parsePaginationQuery } from "@helpers/pagination";
5
  import { asyncHandler } from "@helpers/async-handler";
6
  import { paramsValidator } from "@helpers/validation.helper";
7
  import { BaseController } from "@lib/controllers/controller.base";
8
- import { Controller } from "@lib/decorators/prefix.decorator";
9
  import { serialize } from "@helpers/serialize";
10
  import { ExerciseSerialization } from "@common/serializers/exercise.serialization";
11
  import { ControllerMiddleware } from "@lib/decorators/controller-middleware.decorator";
 
5
  import { asyncHandler } from "@helpers/async-handler";
6
  import { paramsValidator } from "@helpers/validation.helper";
7
  import { BaseController } from "@lib/controllers/controller.base";
8
+ import { Controller } from "@lib/decorators/controller.decorator";
9
  import { serialize } from "@helpers/serialize";
10
  import { ExerciseSerialization } from "@common/serializers/exercise.serialization";
11
  import { ControllerMiddleware } from "@lib/decorators/controller-middleware.decorator";
src/modules/users/modules/templates/controllers/templates.controller.ts CHANGED
@@ -5,7 +5,7 @@ import { parsePaginationQuery } from "@helpers/pagination";
5
  import { asyncHandler } from "@helpers/async-handler";
6
  import { paramsValidator, bodyValidator } from "@helpers/validation.helper";
7
  import { BaseController } from "@lib/controllers/controller.base";
8
- import { Controller } from "@lib/decorators/prefix.decorator";
9
  import { serialize } from "@helpers/serialize";
10
  import { TemplateSerialization } from "@common/serializers/template.serialization";
11
  import { ControllerMiddleware } from "@lib/decorators/controller-middleware.decorator";
 
5
  import { asyncHandler } from "@helpers/async-handler";
6
  import { paramsValidator, bodyValidator } from "@helpers/validation.helper";
7
  import { BaseController } from "@lib/controllers/controller.base";
8
+ import { Controller } from "@lib/decorators/controller.decorator";
9
  import { serialize } from "@helpers/serialize";
10
  import { TemplateSerialization } from "@common/serializers/template.serialization";
11
  import { ControllerMiddleware } from "@lib/decorators/controller-middleware.decorator";
src/modules/users/modules/user-registered-workouts/controllers/user-registered-workouts.controller.ts CHANGED
@@ -5,7 +5,7 @@ import { parsePaginationQuery } from "@helpers/pagination";
5
  import { paramsValidator, bodyValidator } from "@helpers/validation.helper";
6
  import { asyncHandler } from "@helpers/async-handler";
7
  import { BaseController } from "@lib/controllers/controller.base";
8
- import { Controller } from "@lib/decorators/prefix.decorator";
9
  import { serialize } from "@helpers/serialize";
10
  import { UserRegisteredWorkoutsSerialization } from "@common/serializers/user-registered-workout.serialization";
11
  import { ControllerMiddleware } from "@lib/decorators/controller-middleware.decorator";
 
5
  import { paramsValidator, bodyValidator } from "@helpers/validation.helper";
6
  import { asyncHandler } from "@helpers/async-handler";
7
  import { BaseController } from "@lib/controllers/controller.base";
8
+ import { Controller } from "@lib/decorators/controller.decorator";
9
  import { serialize } from "@helpers/serialize";
10
  import { UserRegisteredWorkoutsSerialization } from "@common/serializers/user-registered-workout.serialization";
11
  import { ControllerMiddleware } from "@lib/decorators/controller-middleware.decorator";
src/modules/users/modules/users/controllers/users.controller.ts CHANGED
@@ -5,7 +5,7 @@ import { updateUserSchema } from "../validation/update.validation";
5
  import { paramsValidator, bodyValidator } from "@helpers/validation.helper";
6
  import { asyncHandler } from "@helpers/async-handler";
7
  import { BaseController } from "@lib/controllers/controller.base";
8
- import { Controller } from "@lib/decorators/prefix.decorator";
9
  import { serialize } from "@helpers/serialize";
10
  import { UserSerialization } from "@common/serializers/user.serialization";
11
  import { ControllerMiddleware } from "@lib/decorators/controller-middleware.decorator";
 
5
  import { paramsValidator, bodyValidator } from "@helpers/validation.helper";
6
  import { asyncHandler } from "@helpers/async-handler";
7
  import { BaseController } from "@lib/controllers/controller.base";
8
+ import { Controller } from "@lib/decorators/controller.decorator";
9
  import { serialize } from "@helpers/serialize";
10
  import { UserSerialization } from "@common/serializers/user.serialization";
11
  import { ControllerMiddleware } from "@lib/decorators/controller-middleware.decorator";
src/modules/users/modules/workouts/controllers/workouts.controller.ts CHANGED
@@ -5,7 +5,7 @@ import { parsePaginationQuery } from "@helpers/pagination";
5
  import { asyncHandler } from "@helpers/async-handler";
6
  import { paramsValidator } from "@helpers/validation.helper";
7
  import { BaseController } from "@lib/controllers/controller.base";
8
- import { Controller } from "@lib/decorators/prefix.decorator";
9
  import { serialize } from "@helpers/serialize";
10
  import { WorkoutSerialization } from "@common/serializers/workout.serialization";
11
  import { ControllerMiddleware } from "@lib/decorators/controller-middleware.decorator";
 
5
  import { asyncHandler } from "@helpers/async-handler";
6
  import { paramsValidator } from "@helpers/validation.helper";
7
  import { BaseController } from "@lib/controllers/controller.base";
8
+ import { Controller } from "@lib/decorators/controller.decorator";
9
  import { serialize } from "@helpers/serialize";
10
  import { WorkoutSerialization } from "@common/serializers/workout.serialization";
11
  import { ControllerMiddleware } from "@lib/decorators/controller-middleware.decorator";