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.

add RewardCondition type

Kiran K5e934eaeef76
diff --git a/apps/web/lib/partners/evaluate-reward-rules.ts b/apps/web/lib/partners/evaluate-reward-rules.ts
index 634c82df21..37a6e17b62 100644
--- a/apps/web/lib/partners/evaluate-reward-rules.ts
+++ b/apps/web/lib/partners/evaluate-reward-rules.ts
@@ -1,14 +1,6 @@
import { Prisma } from "@dub/prisma/client";
-import { z } from "zod";
-import {
- rewardConditionSchema,
- rewardContextSchema,
- rewardModifierSchema,
-} from "../zod/schemas/rewards";
-import { RewardContext } from "../types";
-
-
-type RewardCondition = z.infer<typeof rewardConditionSchema>;
+import { RewardCondition, RewardContext } from "../types";
+import { rewardModifierSchema } from "../zod/schemas/rewards";
export const evaluateRewardRules = ({
modifier,
diff --git a/apps/web/lib/types.ts b/apps/web/lib/types.ts
index 281da8a46d..557d200cbe 100644
--- a/apps/web/lib/types.ts
+++ b/apps/web/lib/types.ts
@@ -64,7 +64,11 @@ import {
ProgramSchema,
ProgramWithLanderDataSchema,
} from "./zod/schemas/programs";
-import { rewardContextSchema, RewardSchema } from "./zod/schemas/rewards";
+import {
+ rewardConditionSchema,
+ rewardContextSchema,
+ RewardSchema,
+} from "./zod/schemas/rewards";
import {
saleEventResponseSchema,
trackSaleResponseSchema,
@@ -490,4 +494,6 @@ export interface FolderLinkCount {
_count: number;
}
-export type RewardContext = z.infer<typeof rewardContextSchema>;
\ No newline at end of file
+export type RewardContext = z.infer<typeof rewardContextSchema>;
+
+export type RewardCondition = z.infer<typeof rewardConditionSchema>;