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.

Update reward-conditions.ts

Kiran K73b2b3e8d5f7
diff --git a/apps/web/scripts/reward-conditions.ts b/apps/web/scripts/reward-conditions.ts
index e77c3daddf..bae82aefcc 100644
--- a/apps/web/scripts/reward-conditions.ts
+++ b/apps/web/scripts/reward-conditions.ts
@@ -2,24 +2,40 @@ import { prisma } from "@dub/prisma";
import "dotenv-flow/config";
async function main() {
- const conditions = {
- operator: "AND",
- amount: 100,
- conditions: [
- {
- entity: "customer",
- attribute: "country",
- operator: "in",
- value: ["US", "IN"],
- },
- {
- entity: "sale",
- attribute: "productId",
- operator: "equals_to",
- value: "basic",
- },
- ],
- };
+ // should support tieredRewardConditionsSchema
+ const conditions = [
+ {
+ operator: "AND",
+ amount: 200,
+ conditions: [
+ {
+ entity: "customer",
+ attribute: "country",
+ operator: "equals_to",
+ value: "US",
+ },
+ {
+ entity: "sale",
+ attribute: "productId",
+ operator: "equals_to",
+ value: "basic",
+ },
+ ],
+ },
+
+ {
+ operator: "AND",
+ amount: 100,
+ conditions: [
+ {
+ entity: "customer",
+ attribute: "country",
+ operator: "equals_to",
+ value: "IN",
+ },
+ ],
+ },
+ ];
await prisma.reward.update({
where: {