invite, inident
This commit is contained in:
1 parent
332300dde4
commit
80f3168837
4 files changed
+21
-6
No files matched your search
@@ -5,7 +5,14 @@ import { IIncidentService } from "@/service/index.js";
|
|||||||
import { getIncidentsByTeamQueryValidation, getIncidentSummaryQueryValidation } from "@/validation/incidentValidation.js";
|
import { getIncidentsByTeamQueryValidation, getIncidentSummaryQueryValidation } from "@/validation/incidentValidation.js";
|
||||||
|
|
||||||
const SERVICE_NAME = "IncidentController";
|
const SERVICE_NAME = "IncidentController";
|
||||||
class IncidentController {
|
|
||||||
|
export interface IIncidentController {
|
||||||
|
getIncidentsByTeam: (req: Request, res: Response, next: NextFunction) => Promise<Response | void>;
|
||||||
|
getIncidentSummary: (req: Request, res: Response, next: NextFunction) => Promise<Response | void>;
|
||||||
|
getIncidentById: (req: Request, res: Response, next: NextFunction) => Promise<Response | void>;
|
||||||
|
resolveIncidentManually: (req: Request, res: Response, next: NextFunction) => Promise<Response | void>;
|
||||||
|
}
|
||||||
|
class IncidentController implements IIncidentController {
|
||||||
private incidentService: IIncidentService;
|
private incidentService: IIncidentService;
|
||||||
constructor(incidentService: IIncidentService) {
|
constructor(incidentService: IIncidentService) {
|
||||||
this.incidentService = incidentService;
|
this.incidentService = incidentService;
|
||||||
|
|||||||
@@ -4,7 +4,13 @@ import { requireFirstName, requireTeamId, requireUserRoles } from "@/controllers
|
|||||||
import { IInviteService } from "@/service/index.js";
|
import { IInviteService } from "@/service/index.js";
|
||||||
const SERVICE_NAME = "inviteController";
|
const SERVICE_NAME = "inviteController";
|
||||||
|
|
||||||
class InviteController {
|
export interface IInviteController {
|
||||||
|
getInviteToken: (req: Request, res: Response, next: NextFunction) => Promise<Response | void>;
|
||||||
|
sendInviteEmail: (req: Request, res: Response, next: NextFunction) => Promise<Response | void>;
|
||||||
|
verifyInviteToken: (req: Request, res: Response, next: NextFunction) => Promise<Response | void>;
|
||||||
|
}
|
||||||
|
|
||||||
|
class InviteController implements IInviteController {
|
||||||
static SERVICE_NAME = SERVICE_NAME;
|
static SERVICE_NAME = SERVICE_NAME;
|
||||||
private inviteService: IInviteService;
|
private inviteService: IInviteService;
|
||||||
constructor(inviteService: IInviteService) {
|
constructor(inviteService: IInviteService) {
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import { Router } from "express";
|
import { Router } from "express";
|
||||||
import { isAllowed } from "../middleware/isAllowed.js";
|
import { isAllowed } from "../middleware/isAllowed.js";
|
||||||
|
import { IIncidentController } from "@/controllers/incidentController.js";
|
||||||
|
|
||||||
class IncidentRoutes {
|
class IncidentRoutes {
|
||||||
private router: Router;
|
private router: Router;
|
||||||
private incidentController: any;
|
private incidentController: IIncidentController;
|
||||||
|
|
||||||
constructor(incidentController: any) {
|
constructor(incidentController: IIncidentController) {
|
||||||
this.router = Router();
|
this.router = Router();
|
||||||
this.incidentController = incidentController;
|
this.incidentController = incidentController;
|
||||||
this.initRoutes();
|
this.initRoutes();
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import { RequestHandler, Router } from "express";
|
import { RequestHandler, Router } from "express";
|
||||||
import { isAllowed } from "../middleware/isAllowed.js";
|
import { isAllowed } from "../middleware/isAllowed.js";
|
||||||
|
import { IInviteController } from "@/controllers/inviteController.js";
|
||||||
|
|
||||||
class InviteRoutes {
|
class InviteRoutes {
|
||||||
private router: Router;
|
private router: Router;
|
||||||
private inviteController: any;
|
private inviteController: IInviteController;
|
||||||
|
|
||||||
constructor(inviteController: any, verifyJWT: RequestHandler) {
|
constructor(inviteController: IInviteController, verifyJWT: RequestHandler) {
|
||||||
this.router = Router();
|
this.router = Router();
|
||||||
this.inviteController = inviteController;
|
this.inviteController = inviteController;
|
||||||
this.initRoutes(verifyJWT);
|
this.initRoutes(verifyJWT);
|
||||||
|
|||||||
Reference in new issue
Block a user