import { ListArticlesUseCase } from "@/contexts/catalog/application";
import { ICatalogContext } from "../../..";
import { registerCatalogRepository } from "../../../Catalog.repository";
import { ListArticlesController } from "./ListArticlesController";
import { listArticlesPresenter } from "./presenter";

export const listArticlesController = (context: ICatalogContext) => {
  registerCatalogRepository(context);

  return new ListArticlesController(
    {
      useCase: new ListArticlesUseCase(context),
      presenter: listArticlesPresenter,
    },
    context
  );
};
