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 'partners' into payouts

Kiran K5877a7d07e25
diff --cc apps/web/lib/zod/schemas/partners.ts
index 26abb0137a,f3eba7692e..31032ca0c7
--- a/apps/web/lib/zod/schemas/partners.ts
+++ b/apps/web/lib/zod/schemas/partners.ts
@@@ -1,10 -1,6 +1,11 @@@
-import { CommissionType, PartnerStatus, ProgramType } from "@prisma/client";
+import {
+ CommissionType,
+ PartnerStatus,
+ PayoutStatus,
+ ProgramType,
+} from "@prisma/client";
import { z } from "zod";
+ import { LinkSchema } from "./links";
export const PartnerSchema = z.object({
id: z.string(),
@@@ -34,16 -30,18 +35,30 @@@ export const ProgramSchema = z.object(
updatedAt: z.date(),
});
+ export const ProgramEnrollmentSchema = z.object({
+ partnerId: z.string(),
+ programId: z.string(),
+ link: LinkSchema.pick({
+ id: true,
+ shortLink: true,
+ url: true,
+ clicks: true,
+ leads: true,
+ sales: true,
+ saleAmount: true,
+ }).nullable(),
++});
++
+export const PayoutSchema = z.object({
+ id: z.string(),
+ subtotal: z.number(),
+ taxes: z.number(),
+ total: z.number(),
+ payoutFee: z.number(),
+ netTotal: z.number(),
+ currency: z.string(),
+ status: z.nativeEnum(PayoutStatus),
+ due: z.date(),
createdAt: z.date(),
updatedAt: z.date(),
});