Refactor logger usage and add discount field to checkout

This commit refactors the logger usage in various files to make it more streamlined and consistent. It also introduces a new 'enableDiscountField' feature for the checkout that can be toggled on specific products. This allows customers to apply discounts at checkout if the product or subscription plan has the 'enableDiscountField' set to true.
This commit is contained in:
giancarlo
2024-04-10 22:04:38 +08:00
parent 69942ec243
commit 37c5e3ed76
9 changed files with 137 additions and 158 deletions

View File

@@ -167,7 +167,18 @@ const ProductSchema = z
'Badge for the product. Displayed to the user. Example: "Popular"',
})
.optional(),
features: z.array(z.string()).nonempty(),
features: z
.array(
z.string({
description: 'Features of the product. Displayed to the user.',
}),
)
.nonempty(),
enableDiscountField: z
.boolean({
description: 'Enable discount field for the product in the checkout.',
})
.optional(),
highlighted: z
.boolean({
description: 'Highlight this product. Displayed to the user.',