fix: 🐛 crash

This commit is contained in:
amianthus
2025-10-20 11:12:29 +01:00
parent 78b938fd1f
commit 334d13ad94
14 changed files with 226 additions and 270 deletions

View File

@@ -1,44 +1,35 @@
import { z } from "zod/v4";
export const CreateReferralCodeResponseSchema = z
.object({
code: z.string().meta({
description: "The referral code that can be shared with customers",
example: "REF123ABC",
}),
customer_id: z.string().meta({
description: "Your unique identifier for the customer",
example: "cus_123",
}),
created_at: z.number().meta({
description: "The timestamp of when the referral code was created",
example: 1717000000,
}),
})
.meta({
id: "ReferralCode",
description: "Referral code object returned by the API",
});
// Note: IDs removed to avoid duplicate registration when exported through main index
export const CreateReferralCodeResponseSchema = z.object({
code: z.string().meta({
description: "The referral code that can be shared with customers",
example: "REF123ABC",
}),
customer_id: z.string().meta({
description: "Your unique identifier for the customer",
example: "cus_123",
}),
created_at: z.number().meta({
description: "The timestamp of when the referral code was created",
example: 1717000000,
}),
});
export const RedeemReferralCodeResponseSchema = z
.object({
id: z.string().meta({
description: "The ID of the redemption event",
example: "red_123",
}),
customer_id: z.string().meta({
description: "Your unique identifier for the customer",
example: "cus_456",
}),
reward_id: z.string().meta({
description: "The ID of the reward that will be granted",
example: "reward_789",
}),
})
.meta({
id: "RedeemReferralCodeResponse",
description: "Redemption response object returned by the API",
});
export const RedeemReferralCodeResponseSchema = z.object({
id: z.string().meta({
description: "The ID of the redemption event",
example: "red_123",
}),
customer_id: z.string().meta({
description: "Your unique identifier for the customer",
example: "cus_456",
}),
reward_id: z.string().meta({
description: "The ID of the reward that will be granted",
example: "reward_789",
}),
});
export type CreateReferralCodeResponse = z.infer<
typeof CreateReferralCodeResponseSchema