import { DeleteQuoteUseCase } from "@/contexts/sales/application";
import { NextFunction, Request, Response } from "express";
import { registerQuoteRepository } from "../../../../Quote.repository";
import { ISalesContext } from "../../../../Sales.context";
import { DeleteQuoteController } from "./DeleteQuote.controller";

export const deleteQuoteController = (req: Request, res: Response, next: NextFunction) => {
  const context: ISalesContext = res.locals.context;

  registerQuoteRepository(context);
  return new DeleteQuoteController(
    {
      useCase: new DeleteQuoteUseCase(context),
    },
    context
  ).execute(req, res, next);
};
