Skip to content

Commit 76cc42e

Browse files
authored
feat: reusable executeClaimTicket function (#316)
1 parent 00d0be4 commit 76cc42e

4 files changed

Lines changed: 863 additions & 1401 deletions

File tree

src/datasources/db/allowedCurrencies.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { pgTable, text, uuid } from "drizzle-orm/pg-core";
22
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
3+
import { z } from "zod";
34

45
import { createdAndUpdatedAtFields } from "./shared";
56
// ALLOWED_CURRENCIES-TABLE
@@ -19,6 +20,14 @@ export const selectAllowedCurrencySchema = createSelectSchema(
1920
allowedCurrencySchema,
2021
);
2122

23+
export type SelectAllowedCurrencySchema = z.infer<
24+
typeof selectAllowedCurrencySchema
25+
>;
26+
2227
export const insertAllowedCurrencySchema = createInsertSchema(
2328
allowedCurrencySchema,
2429
);
30+
31+
export type InsertAllowedCurrencySchema = z.infer<
32+
typeof insertAllowedCurrencySchema
33+
>;

src/datasources/db/communities.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { relations } from "drizzle-orm";
22
import { pgTable, text, uuid } from "drizzle-orm/pg-core";
33
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
4+
import { z } from "zod";
45

56
import {
67
eventsToCommunitiesSchema,
@@ -35,6 +36,10 @@ export const communityRelations = relations(communitySchema, ({ many }) => ({
3536

3637
export const selectCommunitySchema = createSelectSchema(communitySchema);
3738

39+
export type SelectCommunitySchema = z.infer<typeof selectCommunitySchema>;
40+
3841
export const insertCommunitySchema = createInsertSchema(communitySchema, {
3942
name: (schema) => schema.name.min(2).max(64),
4043
});
44+
45+
export type InsertCommunitySchema = z.infer<typeof insertCommunitySchema>;

src/datasources/db/purchaseOrders.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
timestamp,
99
} from "drizzle-orm/pg-core";
1010
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
11+
import { z } from "zod";
1112

1213
import {
1314
allowedCurrencySchema,
@@ -87,5 +88,13 @@ export const purchaseOrdersRelations = relations(
8788
export const selectPurchaseOrdersSchema =
8889
createSelectSchema(purchaseOrdersSchema);
8990

91+
export type SelectPurchaseOrderSchema = z.infer<
92+
typeof selectPurchaseOrdersSchema
93+
>;
94+
9095
export const insertPurchaseOrdersSchema =
9196
createInsertSchema(purchaseOrdersSchema);
97+
98+
export type InsertPurchaseOrderSchema = z.infer<
99+
typeof insertPurchaseOrdersSchema
100+
>;

0 commit comments

Comments
 (0)