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.

cleanup

Kiran Kb66d38f6b926
diff --git a/apps/web/lib/zod/schemas/commissions.ts b/apps/web/lib/zod/schemas/commissions.ts
index c2732de848..4cd3b970f5 100644
--- a/apps/web/lib/zod/schemas/commissions.ts
+++ b/apps/web/lib/zod/schemas/commissions.ts
@@ -15,8 +15,13 @@ export const CommissionSchema = z.object({
earnings: z.number(),
currency: z.string(),
status: z.nativeEnum(CommissionStatus),
- invoiceId: z.string().nullish(),
- description: z.string().nullish(),
+ invoiceId: z.string().nullable(),
+ description: z.string().nullable(),
+ quantity: z.number(),
+ userId: z
+ .string()
+ .nullable()
+ .describe("The user who created the manual commission."),
createdAt: z.date(),
updatedAt: z.date(),
});
@@ -24,7 +29,6 @@ export const CommissionSchema = z.object({
// Represents the commission object used in webhook and API responses (/api/commissions/**)
export const CommissionEnrichedSchema = CommissionSchema.merge(
z.object({
- quantity: z.number(),
partner: PartnerSchema,
customer: CustomerSchema.nullish(), // customer can be null for click-based / custom commissions
}),
diff --git a/apps/web/lib/zod/schemas/partner-profile.ts b/apps/web/lib/zod/schemas/partner-profile.ts
index ba53996c6a..4bd3ae35f8 100644
--- a/apps/web/lib/zod/schemas/partner-profile.ts
+++ b/apps/web/lib/zod/schemas/partner-profile.ts
@@ -16,8 +16,6 @@ import { LinkSchema } from "./links";
export const PartnerEarningsSchema = CommissionSchema.merge(
z.object({
- type: z.string(),
- quantity: z.number().nullable(),
customer: z
.object({
id: z.string(),