Deals TRPC Router (deals/deals.router.ts)

mperkins0155/crm · crm, CRM / Leads, trpc, deals, router, crud

Defines TRPC endpoints for listing, retrieving, creating, updating, and deleting deal records with authentication middleware.

// Source: https://github.com/mperkins0155/crm | License: MIT | Copyright 2026 Comp AI
// Provided via justclaw.it.com; keep this notice with the code.
import { Inject } from "@nestjs/common";
import {
	Ctx,
	Input,
	Mutation,
	Query,
	Router,
	UseMiddlewares,
} from "nestjs-trpc";
import type { z } from "zod";
import type { AuthedTrpcContext } from "../trpc/context.types";
import { AuthMiddleware } from "../trpc/middlewares/auth.middleware";
import {
	dealAttachContactInput,
	dealBulkInput,
	dealBulkOwnerInput,
	dealBulkStageInput,
	dealContactRoleInput,
	dealContactsInput,
	dealCreateInput,
	dealDetachContactInput,
	dealIdInput,
	dealListInput,
	dealUpdateArgs,
	setStageInput,
} from "./deals.contracts";
import { DealsService } from "./deals.service";

@Router({ alias: "deals" })
@UseMid

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key