import { ListDealersUseCase } from "@/contexts/sales/application";
import { registerDealerRepository } from "../../../../Dealer.repository";
import { ISalesContext } from "../../../../Sales.context";
import { ListDealersController } from "./ListDealers.controller";
import { listDealersPresenter } from "./presenter/ListDealers.presenter";

export const listDealersController = (context: ISalesContext) => {
  registerDealerRepository(context);
  return new ListDealersController(
    {
      useCase: new ListDealersUseCase(context),
      presenter: listDealersPresenter,
    },
    context
  );
};
