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.

Remove update-stripe-customers schema, add partnerStackCommission schema, and update types to include new commission type.

Kiran Kc62430104f98
diff --git a/apps/web/lib/partnerstack/schemas.ts b/apps/web/lib/partnerstack/schemas.ts
index d7069ee02d..b3355b3945 100644
--- a/apps/web/lib/partnerstack/schemas.ts
+++ b/apps/web/lib/partnerstack/schemas.ts
@@ -5,7 +5,6 @@ export const partnerStackImportSteps = z.enum([
"import-links",
"import-customers",
"import-commissions",
- "update-stripe-customers",
]);
export const partnerStackImportPayloadSchema = z.object({
@@ -39,7 +38,25 @@ export const partnerStackCustomer = z.object({
provider_key: z
.string()
.describe("A unique identifier given by a payment provider."),
- test: z.boolean().describe("True if created by a test partner."),
created_at: z.number(),
updated_at: z.number(),
+ test: z.boolean().describe("True if created by a test."),
+});
+
+export const partnerStackCommission = z.object({
+ key: z.string(),
+ amount: z.number().describe("The amount of the reward in cents (USD)."),
+ currency: z.string(),
+ customer: z.object({
+ email: z.string(),
+ external_key: z.string(),
+ }),
+ invoice: z.object({
+ key: z.string(),
+ }),
+ transaction: z.object({
+ amount: z.number().describe("The amount of the transaction."),
+ }),
+ reward_status: z.enum(["hold", "pending", "approved", "declined", "paid"]),
+ test: z.boolean().describe("True if created by a test."),
});
diff --git a/apps/web/lib/partnerstack/types.ts b/apps/web/lib/partnerstack/types.ts
index edcbbafe8a..d9d09f1245 100644
--- a/apps/web/lib/partnerstack/types.ts
+++ b/apps/web/lib/partnerstack/types.ts
@@ -1,6 +1,7 @@
import { z } from "zod";
import {
partnerStackAffiliate,
+ partnerStackCommission,
partnerStackCustomer,
partnerStackImportPayloadSchema,
partnerStackLink,
@@ -25,3 +26,5 @@ export type PartnerStackAffiliate = z.infer<typeof partnerStackAffiliate>;
export type PartnerStackLink = z.infer<typeof partnerStackLink>;
export type PartnerStackCustomer = z.infer<typeof partnerStackCustomer>;
+
+export type PartnerStackCommission = z.infer<typeof partnerStackCommission>;
diff --git a/apps/web/lib/partnerstack/update-stripe-customers.ts b/apps/web/lib/partnerstack/update-stripe-customers.ts
deleted file mode 100644
index e69de29bb2..0000000000