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 program-onboarding

Steven Tey6312e68be7eb
diff --cc apps/web/lib/zod/schemas/rewards.ts
index a2ee3f0ecf,31ab76023a..a618d33bf2
--- a/apps/web/lib/zod/schemas/rewards.ts
+++ b/apps/web/lib/zod/schemas/rewards.ts
@@@ -1,22 -1,7 +1,20 @@@
import { CommissionType, EventType } from "@dub/prisma/client";
import { z } from "zod";
- import { getPaginationQuerySchema } from "./misc";
-
- export const RECURRING_MAX_DURATIONS = [0, 3, 6, 12, 18, 24];
+ import { getPaginationQuerySchema, maxDurationSchema } from "./misc";
+export const COMMISSION_TYPES = [
+ {
+ value: "one-off",
+ label: "One-off",
+ description: "Pay a one-time payout",
+ },
+ {
+ value: "recurring",
+ label: "Recurring",
+ description: "Pay an ongoing payout",
+ },
+] as const;
+
export const RewardSchema = z.object({
id: z.string(),
event: z.nativeEnum(EventType),
diff --cc apps/web/ui/partners/add-edit-reward-sheet.tsx
index a2998514be,565f5f7349..1162d0236f
--- a/apps/web/ui/partners/add-edit-reward-sheet.tsx
+++ b/apps/web/ui/partners/add-edit-reward-sheet.tsx
@@@ -11,11 -11,8 +11,11 @@@ import useRewardPartners from "@/lib/sw
import useRewards from "@/lib/swr/use-rewards";
import useWorkspace from "@/lib/swr/use-workspace";
import { EnrolledPartnerProps, RewardProps } from "@/lib/types";
+ import { RECURRING_MAX_DURATIONS } from "@/lib/zod/schemas/misc";
-import { createRewardSchema } from "@/lib/zod/schemas/rewards";
+import {
+ COMMISSION_TYPES,
+ createRewardSchema,
- RECURRING_MAX_DURATIONS,
+} from "@/lib/zod/schemas/rewards";
import { SelectEligiblePartnersSheet } from "@/ui/partners/select-eligible-partners-sheet";
import { X } from "@/ui/shared/icons";
import { EventType } from "@dub/prisma/client";