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 reward-workflow

Kiran K9e4eb1e678ad
diff --cc apps/web/lib/partners/create-partner-commission.ts
index 86affdc508,7dbfd5fef8..3189522b28
--- a/apps/web/lib/partners/create-partner-commission.ts
+++ b/apps/web/lib/partners/create-partner-commission.ts
@@@ -14,7 -13,8 +14,9 @@@ import { syncTotalCommissions } from ".
import { calculateSaleEarnings } from "../api/sales/calculate-sale-earnings";
import { Session } from "../auth";
import { RewardProps } from "../types";
+ import { sendWorkspaceWebhook } from "../webhook/publish";
+ import { CommissionEnrichedSchema } from "../zod/schemas/commissions";
+import { rewardContextSchema } from "../zod/schemas/rewards";
import { determinePartnerReward } from "./determine-partner-reward";
export const createPartnerCommission = async ({
@@@ -51,8 -48,7 +51,8 @@@
currency?: string;
description?: string;
createdAt?: Date;
- user?: Session["user"]; // user who created the commission
+ context?: z.infer<typeof rewardContextSchema>;
+ user?: Session["user"]; // user who created the manual commission
}) => {
let earnings = 0;
let status: CommissionStatus = "pending";