Replace 'base' line item type with 'flat'

This commit updates all instances of 'base' line item type to 'flat'. It modifies the BillingIntervalSchema, the validation rules for one-time plans, and the function to get the primary line item for a plan. Furthermore, it adjusts the display and filtering of line items in the pricing table component and the plan picker component. The SQL migration script and the sample billing configuration are also updated to reflect this change.
This commit is contained in:
giancarlo
2024-04-07 17:34:47 +08:00
parent b049dfca80
commit 1e23ee2783
6 changed files with 87 additions and 51 deletions

View File

@@ -32,7 +32,7 @@ export default createBillingSchema({
id: '324643',
name: 'Base',
cost: 999.99,
type: 'base',
type: 'flat',
},
],
},
@@ -53,33 +53,23 @@ export default createBillingSchema({
interval: 'month',
lineItems: [
{
id: '55476',
name: 'Base',
id: '324646',
name: 'Addon 2',
cost: 9.99,
type: 'base',
},
{
id: '324644',
name: 'Addon 1',
cost: 99.99,
type: 'metered',
unit: 'GB',
unit: 'GBs',
tiers: [
{
upTo: 5,
cost: 0,
},
{
upTo: 10,
cost: 0.99,
},
{
upTo: 100,
cost: 0.49,
},
{
upTo: 1000,
cost: 0.29,
cost: 6.99,
},
{
upTo: 'unlimited',
cost: 0.19,
cost: 0.49,
},
],
},
@@ -115,7 +105,7 @@ export default createBillingSchema({
id: 'price_1NNwYHI1i3VnbZTqI2UzaHIe1',
name: 'Base',
cost: 99.99,
type: 'base',
type: 'flat',
},
],
},
@@ -140,7 +130,7 @@ export default createBillingSchema({
id: 'price_1NNwYHI1i3VnbZTqI2UzaHIe2',
name: 'Base',
cost: 19.99,
type: 'base',
type: 'flat',
},
],
},
@@ -154,7 +144,7 @@ export default createBillingSchema({
id: 'price_1NNwYHI1i3VnbZTqI2UzaHIe3',
name: 'Base',
cost: 199.99,
type: 'base',
type: 'flat',
},
],
},
@@ -183,7 +173,7 @@ export default createBillingSchema({
id: 'price_1NNwYHI1i3VnbZTqI2UzaHIe4',
name: 'Base',
cost: 29.99,
type: 'base',
type: 'flat',
},
],
},
@@ -197,7 +187,7 @@ export default createBillingSchema({
id: 'price_1NNwYHI1i3VnbZTqI2UzaHIe5',
name: 'Base',
cost: 299.99,
type: 'base',
type: 'flat',
},
],
},