Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Merge branch 'main' into payouts

Kiran K412134071874
diff --cc apps/web/lib/zod/schemas/partners.ts
index 5aa77ead26,f25125ede1..b8f53a1bf8
--- a/apps/web/lib/zod/schemas/partners.ts
+++ b/apps/web/lib/zod/schemas/partners.ts
@@@ -1,9 -1,8 +1,10 @@@
import {
+ CommissionInterval,
CommissionType,
PartnerStatus,
+ PayoutStatus,
ProgramType,
+ SaleStatus,
} from "@prisma/client";
import { z } from "zod";
import { LinkSchema } from "./links";
@@@ -48,37 -48,7 +50,38 @@@ export const ProgramEnrollmentSchema =
sales: true,
saleAmount: true,
}).nullable(),
+});
+
+export const PayoutSchema = z.object({
+ id: z.string(),
+ total: z.number(),
+ payoutFee: z.number().nullable(),
+ netTotal: z.number(),
+ currency: z.string(),
+ status: z.nativeEnum(PayoutStatus),
+ periodStart: z.date(),
+ periodEnd: z.date(),
+ createdAt: z.date(),
+ updatedAt: z.date(),
+});
+
+export const CustomerSchema = z.object({
+ id: z.string(),
+ name: z.string(),
+ email: z.string(),
+ avatar: z.string().nullable(),
+ externalId: z.string(),
+ createdAt: z.date(),
+ updatedAt: z.date(),
+});
+
+export const SaleSchema = z.object({
+ id: z.string(),
+ amount: z.number(),
+ commissionEarned: z.number(),
+ currency: z.string(),
+ status: z.nativeEnum(SaleStatus),
+ program: ProgramSchema,
createdAt: z.date(),
updatedAt: z.date(),
});