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 bounties

Kiran K0ed626e97c4e
diff --cc apps/web/lib/partners/create-partner-commission.ts
index 056171d633,7c9ba35da0..63008ff051
--- a/apps/web/lib/partners/create-partner-commission.ts
+++ b/apps/web/lib/partners/create-partner-commission.ts
@@@ -11,8 -10,8 +11,9 @@@ import { differenceInMonths } from "dat
import { recordAuditLog } from "../api/audit-logs/record-audit-log";
import { createId } from "../api/create-id";
import { syncTotalCommissions } from "../api/partners/sync-total-commissions";
+ import { getProgramEnrollmentOrThrow } from "../api/programs/get-program-enrollment-or-throw";
import { calculateSaleEarnings } from "../api/sales/calculate-sale-earnings";
+import { executeWorkflows } from "../api/workflows/execute-workflows";
import { Session } from "../auth";
import { RewardContext, RewardProps } from "../types";
import { sendWorkspaceWebhook } from "../webhook/publish";
diff --cc apps/web/lib/webhook/types.ts
index 7f72bd7aeb,590054f4af..1531113d16
--- a/apps/web/lib/webhook/types.ts
+++ b/apps/web/lib/webhook/types.ts
@@@ -1,6 -1,5 +1,6 @@@
import z from "../zod";
+import { BountySchema } from "../zod/schemas/bounties";
- import { CommissionEnrichedSchema } from "../zod/schemas/commissions";
+ import { CommissionWebhookSchema } from "../zod/schemas/commissions";
import { linkEventSchema } from "../zod/schemas/links";
import { EnrolledPartnerSchema } from "../zod/schemas/partners";
import { WEBHOOK_TRIGGERS } from "./constants";
@@@ -21,11 -20,9 +21,11 @@@ export type SaleEventWebhookPayload = z
export type PartnerEventWebhookPayload = z.infer<typeof EnrolledPartnerSchema>;
export type CommissionEventWebhookPayload = z.infer<
- typeof CommissionEnrichedSchema
+ typeof CommissionWebhookSchema
>;
+export type BountyEventWebhookPayload = z.infer<typeof BountySchema>;
+
export type WebhookEventPayload =
| z.infer<typeof linkEventSchema>
| ClickEventWebhookPayload
diff --cc apps/web/tests/webhooks/index.test.ts
index d0b24da99c,a08de56dda..a5e738d584
--- a/apps/web/tests/webhooks/index.test.ts
+++ b/apps/web/tests/webhooks/index.test.ts
@@@ -9,8 -9,7 +9,8 @@@ import
saleWebhookEventSchema,
} from "@/lib/webhook/schemas";
import z from "@/lib/zod";
+import { BountySchema } from "@/lib/zod/schemas/bounties";
- import { CommissionEnrichedSchema } from "@/lib/zod/schemas/commissions";
+ import { CommissionWebhookSchema } from "@/lib/zod/schemas/commissions";
import { CustomerSchema } from "@/lib/zod/schemas/customers";
import { linkEventSchema } from "@/lib/zod/schemas/links";
import { EnrolledPartnerSchema } from "@/lib/zod/schemas/partners";