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

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

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