Skip to content

Commit

Permalink
Add transaction reporter router
Browse files Browse the repository at this point in the history
  • Loading branch information
witoszekdev committed Jul 12, 2024
1 parent 9662006 commit e8ec163
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 28 deletions.
6 changes: 2 additions & 4 deletions src/server/routers/app-router.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { productsRouter } from "./products.router";
import { router } from "../server";
import { channelsRouter } from "./channels.router";
import { transactionReporterRouter } from "./transaction-reporter.router";

export const appRouter = router({
products: productsRouter,
channels: channelsRouter,
transactionReporter: transactionReporterRouter,
});

export type AppRouter = typeof appRouter;
8 changes: 0 additions & 8 deletions src/server/routers/channels.router.ts

This file was deleted.

16 changes: 0 additions & 16 deletions src/server/routers/products.router.ts

This file was deleted.

16 changes: 16 additions & 0 deletions src/server/routers/transaction-reporter.router.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { z } from "zod";
import { procedureWithGraphqlClient } from "../procedure/procedure-with-graphql-client";
import { router } from "../server";
import { TransactionEventTypeEnum } from "../../../generated/graphql";

export const transactionReporterRouter = router({
reportEvent: procedureWithGraphqlClient
.input(
z.object({
id: z.string(),
amount: z.number(),
type: z.nativeEnum(TransactionEventTypeEnum),
})
)
.mutation(async ({ ctx, input }) => {}),
});

0 comments on commit e8ec163

Please sign in to comment.