import { router } from "@repo/core-shared/trpc/init";

import { {{camelCase name}}Container } from "../../di/container";
import { {{constantCase name}}_SYMBOLS } from "../../di/symbols";

import { get{{pascalCase entity}}InputSchema } from "../../application/use-cases/get-{{kebabCase entity}}.use-case";
import type { IGet{{pascalCase entity}}Controller } from "../../interface-adapters/controllers/get-{{kebabCase entity}}.controller";

import { {{camelCase name}}Procedure } from "./procedures";

export const {{camelCase name}}Router = router({
  get{{pascalCase entity}}: {{camelCase name}}Procedure
    .input(get{{pascalCase entity}}InputSchema)
    .query(({ input }) => {
      const ctrl = {{camelCase name}}Container.get<IGet{{pascalCase entity}}Controller>(
        {{constantCase name}}_SYMBOLS.IGet{{pascalCase entity}}Controller,
      );
      return ctrl(input);
    }),
});

export type {{pascalCase name}}Router = typeof {{camelCase name}}Router;
