The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Merge branch 'main' into bounties
Kiran K0ed626e97c4e
diff --cc apps/web/lib/partners/create-partner-commission.tsindex 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 "datimport { 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.tsindex 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 = zexport 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>| ClickEventWebhookPayloaddiff --cc apps/web/tests/webhooks/index.test.tsindex 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 @@@ importsaleWebhookEventSchema,} 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";