2
0

(billing) Automatic usage-based billing (#924)

BREAKING CHANGE: Stripe environment variables simplified. Check out the
new configs to adapt your existing system.

Closes #906





<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
### Summary by CodeRabbit

**New Features:**
- Introduced a usage-based billing system, providing more flexibility
and options for users.
- Integrated with Stripe for a smoother and more secure payment process.
- Enhanced the user interface with improvements to the billing,
workspace, and pricing pages for a more intuitive experience.

**Improvements:**
- Simplified the billing logic, removing additional chats and yearly
billing for a more streamlined user experience.
- Updated email notifications to keep users informed about their usage
and limits.
- Improved pricing and currency formatting for better clarity and
understanding.

**Testing:**
- Updated tests and specifications to ensure the reliability of new
features and improvements.

**Note:** These changes aim to provide a more flexible and user-friendly
billing system, with clearer pricing and improved notifications. Users
should find the new system more intuitive and easier to navigate.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Baptiste Arnaud
2023-10-17 08:03:30 +02:00
committed by GitHub
parent a8c2deb258
commit 797751b418
55 changed files with 1589 additions and 1497 deletions

View File

@@ -229,14 +229,10 @@
"CUSTOM",
"UNLIMITED"
]
},
"additionalChatsIndex": {
"type": "number"
}
},
"required": [
"plan",
"additionalChatsIndex"
"plan"
],
"additionalProperties": false
}
@@ -643,6 +639,14 @@
"youtube",
"vimeo"
]
},
"height": {
"anyOf": [
{
"type": "number"
},
{}
]
}
},
"additionalProperties": false
@@ -5032,6 +5036,14 @@
"youtube",
"vimeo"
]
},
"height": {
"anyOf": [
{
"type": "number"
},
{}
]
}
},
"additionalProperties": false
@@ -9062,6 +9074,14 @@
"youtube",
"vimeo"
]
},
"height": {
"anyOf": [
{
"type": "number"
},
{}
]
}
},
"additionalProperties": false
@@ -13232,6 +13252,14 @@
"youtube",
"vimeo"
]
},
"height": {
"anyOf": [
{
"type": "number"
},
{}
]
}
},
"additionalProperties": false
@@ -17282,6 +17310,14 @@
"youtube",
"vimeo"
]
},
"height": {
"anyOf": [
{
"type": "number"
},
{}
]
}
},
"additionalProperties": false
@@ -21387,6 +21423,14 @@
"youtube",
"vimeo"
]
},
"height": {
"anyOf": [
{
"type": "number"
},
{}
]
}
},
"additionalProperties": false
@@ -25555,6 +25599,14 @@
"youtube",
"vimeo"
]
},
"height": {
"anyOf": [
{
"type": "number"
},
{}
]
}
},
"additionalProperties": false
@@ -30419,9 +30471,6 @@
"returnUrl": {
"type": "string"
},
"additionalChats": {
"type": "number"
},
"vat": {
"type": "object",
"properties": {
@@ -30437,9 +30486,6 @@
"value"
],
"additionalProperties": false
},
"isYearly": {
"type": "boolean"
}
},
"required": [
@@ -30448,9 +30494,7 @@
"workspaceId",
"currency",
"plan",
"returnUrl",
"additionalChats",
"isYearly"
"returnUrl"
],
"additionalProperties": false
}
@@ -30516,27 +30560,19 @@
"PRO"
]
},
"additionalChats": {
"type": "number"
},
"currency": {
"type": "string",
"enum": [
"usd",
"eur"
]
},
"isYearly": {
"type": "boolean"
}
},
"required": [
"returnUrl",
"workspaceId",
"plan",
"additionalChats",
"currency",
"isYearly"
"currency"
],
"additionalProperties": false
}
@@ -30706,8 +30742,23 @@
{
"type": "object",
"properties": {
"isYearly": {
"type": "boolean"
"currentBillingPeriod": {
"type": "object",
"properties": {
"start": {
"type": "string",
"format": "date-time"
},
"end": {
"type": "string",
"format": "date-time"
}
},
"required": [
"start",
"end"
],
"additionalProperties": false
},
"currency": {
"type": "string",
@@ -30729,7 +30780,7 @@
}
},
"required": [
"isYearly",
"currentBillingPeriod",
"currency",
"status"
],
@@ -30790,10 +30841,15 @@
"properties": {
"totalChatsUsed": {
"type": "number"
},
"resetsAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"totalChatsUsed"
"totalChatsUsed",
"resetsAt"
],
"additionalProperties": false
}

View File

@@ -238,6 +238,14 @@
"youtube",
"vimeo"
]
},
"height": {
"anyOf": [
{
"type": "number"
},
{}
]
}
},
"additionalProperties": false
@@ -4196,6 +4204,14 @@
"youtube",
"vimeo"
]
},
"height": {
"anyOf": [
{
"type": "number"
},
{}
]
}
},
"additionalProperties": false
@@ -5674,9 +5690,6 @@
},
"additionalProperties": false
}
},
"displayStream": {
"type": "boolean"
}
},
"required": [