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.

hide autoProvisionEnabledAt from customer discount schema

Steven Teycd495ee687d0
diff --git a/apps/web/lib/zod/schemas/customers.ts b/apps/web/lib/zod/schemas/customers.ts
index 537f256645..3abc7daaed 100644
--- a/apps/web/lib/zod/schemas/customers.ts
+++ b/apps/web/lib/zod/schemas/customers.ts
@@ -181,5 +181,7 @@ export const CustomerEnrichedSchema = CustomerSchema.extend({
email: true,
image: true,
}).nullish(),
- discount: DiscountSchema.nullish(),
+ discount: DiscountSchema.omit({
+ autoProvisionEnabledAt: true,
+ }).nullish(),
});
diff --git a/apps/web/lib/zod/schemas/discount.ts b/apps/web/lib/zod/schemas/discount.ts
index 3b5c7a5666..779639dffa 100644
--- a/apps/web/lib/zod/schemas/discount.ts
+++ b/apps/web/lib/zod/schemas/discount.ts
@@ -14,13 +14,17 @@ export const DiscountSchema = z.object({
autoProvisionEnabledAt: z.coerce.date().nullish(),
});
-export const DiscountSchemaWithDeprecatedFields = DiscountSchema.extend({
- duration: z
- .number()
- .nullish()
- .describe("Deprecated: Use `maxDuration` instead"),
- interval: z.string().nullish().describe("Deprecated: Defaults to `month`"),
-}).nullish();
+export const DiscountSchemaWithDeprecatedFields = DiscountSchema.omit({
+ autoProvisionEnabledAt: true,
+})
+ .extend({
+ duration: z
+ .number()
+ .nullish()
+ .describe("Deprecated: Use `maxDuration` instead"),
+ interval: z.string().nullish().describe("Deprecated: Defaults to `month`"),
+ })
+ .nullish();
export const createDiscountSchema = z.object({
workspaceId: z.string(),