diff --git a/server/src/controllers/incidentController.ts b/server/src/controllers/incidentController.ts index 4e6242184..f12327541 100644 --- a/server/src/controllers/incidentController.ts +++ b/server/src/controllers/incidentController.ts @@ -5,7 +5,14 @@ import { IIncidentService } from "@/service/index.js"; import { getIncidentsByTeamQueryValidation, getIncidentSummaryQueryValidation } from "@/validation/incidentValidation.js"; const SERVICE_NAME = "IncidentController"; -class IncidentController { + +export interface IIncidentController { + getIncidentsByTeam: (req: Request, res: Response, next: NextFunction) => Promise; + getIncidentSummary: (req: Request, res: Response, next: NextFunction) => Promise; + getIncidentById: (req: Request, res: Response, next: NextFunction) => Promise; + resolveIncidentManually: (req: Request, res: Response, next: NextFunction) => Promise; +} +class IncidentController implements IIncidentController { private incidentService: IIncidentService; constructor(incidentService: IIncidentService) { this.incidentService = incidentService; diff --git a/server/src/controllers/inviteController.ts b/server/src/controllers/inviteController.ts index 84f6c30ae..700a7bc6a 100755 --- a/server/src/controllers/inviteController.ts +++ b/server/src/controllers/inviteController.ts @@ -4,7 +4,13 @@ import { requireFirstName, requireTeamId, requireUserRoles } from "@/controllers import { IInviteService } from "@/service/index.js"; const SERVICE_NAME = "inviteController"; -class InviteController { +export interface IInviteController { + getInviteToken: (req: Request, res: Response, next: NextFunction) => Promise; + sendInviteEmail: (req: Request, res: Response, next: NextFunction) => Promise; + verifyInviteToken: (req: Request, res: Response, next: NextFunction) => Promise; +} + +class InviteController implements IInviteController { static SERVICE_NAME = SERVICE_NAME; private inviteService: IInviteService; constructor(inviteService: IInviteService) { diff --git a/server/src/routes/incidentRoute.ts b/server/src/routes/incidentRoute.ts index 83f1ff8f9..fdbb6f532 100644 --- a/server/src/routes/incidentRoute.ts +++ b/server/src/routes/incidentRoute.ts @@ -1,11 +1,12 @@ import { Router } from "express"; import { isAllowed } from "../middleware/isAllowed.js"; +import { IIncidentController } from "@/controllers/incidentController.js"; class IncidentRoutes { private router: Router; - private incidentController: any; + private incidentController: IIncidentController; - constructor(incidentController: any) { + constructor(incidentController: IIncidentController) { this.router = Router(); this.incidentController = incidentController; this.initRoutes(); diff --git a/server/src/routes/inviteRoute.ts b/server/src/routes/inviteRoute.ts index b91f922df..4542bd21e 100755 --- a/server/src/routes/inviteRoute.ts +++ b/server/src/routes/inviteRoute.ts @@ -1,11 +1,12 @@ import { RequestHandler, Router } from "express"; import { isAllowed } from "../middleware/isAllowed.js"; +import { IInviteController } from "@/controllers/inviteController.js"; class InviteRoutes { private router: Router; - private inviteController: any; + private inviteController: IInviteController; - constructor(inviteController: any, verifyJWT: RequestHandler) { + constructor(inviteController: IInviteController, verifyJWT: RequestHandler) { this.router = Router(); this.inviteController = inviteController; this.initRoutes(verifyJWT);