diff --git a/server/src/internal/products/product-items/validateProductItems.ts b/server/src/internal/products/product-items/validateProductItems.ts index 98e523b6f..500bb641f 100644 --- a/server/src/internal/products/product-items/validateProductItems.ts +++ b/server/src/internal/products/product-items/validateProductItems.ts @@ -138,6 +138,14 @@ const validateProductItem = ({ }); } + if (item.included_usage === Infinite) { + throw new RecaseError({ + message: `Included usage can't be '${Infinite}' for tiered prices`, + code: ErrCode.InvalidInputs, + statusCode: StatusCodes.BAD_REQUEST, + }); + } + if (item.billing_units && item.billing_units <= 0) { throw new RecaseError({ message: `Billing units must be greater than 0`, diff --git a/shared/utils/productV3Utils/mapToProductV3.ts b/shared/utils/productV3Utils/mapToProductV3.ts index e8aca264f..0ec16d9b9 100644 --- a/shared/utils/productV3Utils/mapToProductV3.ts +++ b/shared/utils/productV3Utils/mapToProductV3.ts @@ -16,8 +16,7 @@ export function mapToProductV3({ is_add_on: product.is_add_on, is_default: product.is_default, version: product.version, - description: - "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", + description: "", created_at: product.created_at, price: productV2ToBasePrice({ product }) || null, }; diff --git a/vite/src/views/products/plan/components/EditPlanFeatureSheet/BillingType.tsx b/vite/src/views/products/plan/components/EditPlanFeatureSheet/BillingType.tsx index bfd8fe40a..6fb7ee56d 100644 --- a/vite/src/views/products/plan/components/EditPlanFeatureSheet/BillingType.tsx +++ b/vite/src/views/products/plan/components/EditPlanFeatureSheet/BillingType.tsx @@ -15,10 +15,10 @@ export function BillingType() { const setBillingType = (type: "included" | "priced") => { if (type === "included") { // Remove tiers to switch to included - setItem({ ...item, tiers: null }); + setItem({ ...item, tiers: null, billing_units: undefined }); } else { // Add initial tier to switch to priced - setItem({ ...item, tiers: [{ to: 0, amount: 0 }] }); + setItem({ ...item, tiers: [{ to: 0, amount: 0 }], billing_units: 1 }); } };