import { t } from "@repo/core-shared/trpc/init";
import { defineErrorMiddleware } from "@repo/core-shared/trpc/define-error-middleware";

import { {{pascalCase entity}}NotFoundError } from "../../entities/errors/{{kebabCase entity}}";
import { InputParseError } from "../../entities/errors/common";

export const {{camelCase name}}Procedure = t.procedure.use(
  defineErrorMiddleware([
    [InputParseError, "BAD_REQUEST"],
    [{{pascalCase entity}}NotFoundError, "NOT_FOUND"],
  ]),
);
