2
0

🛂 (billing) Add isPastDue field in workspace (#1046)

Closes #1039

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

## Summary by CodeRabbit

- **New Features**
  - Workspaces now include additional status indicator: `isPastDue`.
- New pages for handling workspaces that are past due. Meaning, an
invoice is unpaid.

- **Bug Fixes**
- Fixed issues with workspace status checks and redirections for
suspended workspaces.

- **Refactor**
- Refactored workspace-related API functions to accommodate new status
fields.
- Improved permission checks for reading and writing typebots based on
workspace status.

- **Chores**
  - Database schema updated to include `isPastDue` field for workspaces.
- Implemented new webhook event handling for subscription and invoice
updates.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Baptiste Arnaud
2023-11-23 08:16:23 +01:00
committed by GitHub
parent 94886ca58e
commit ca79934ef5
27 changed files with 450 additions and 97 deletions

View File

@ -415,6 +415,52 @@
"data"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"userId": {
"type": "string"
},
"workspaceId": {
"type": "string"
},
"name": {
"type": "string",
"enum": [
"Workspace past due"
]
}
},
"required": [
"userId",
"workspaceId",
"name"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"userId": {
"type": "string"
},
"workspaceId": {
"type": "string"
},
"name": {
"type": "string",
"enum": [
"Workspace past due status removed"
]
}
},
"required": [
"userId",
"workspaceId",
"name"
],
"additionalProperties": false
}
]
}
@ -7487,6 +7533,9 @@
},
"isSuspended": {
"type": "boolean"
},
"isPastDue": {
"type": "boolean"
}
},
"required": [
@ -7507,7 +7556,8 @@
"customStorageLimit",
"customSeatsLimit",
"isQuarantined",
"isSuspended"
"isSuspended",
"isPastDue"
],
"additionalProperties": false
}
@ -7636,6 +7686,9 @@
},
"isSuspended": {
"type": "boolean"
},
"isPastDue": {
"type": "boolean"
}
},
"required": [
@ -7656,7 +7709,8 @@
"customStorageLimit",
"customSeatsLimit",
"isQuarantined",
"isSuspended"
"isSuspended",
"isPastDue"
],
"additionalProperties": false
}
@ -7802,6 +7856,9 @@
},
"isSuspended": {
"type": "boolean"
},
"isPastDue": {
"type": "boolean"
}
},
"required": [
@ -7822,7 +7879,8 @@
"customStorageLimit",
"customSeatsLimit",
"isQuarantined",
"isSuspended"
"isSuspended",
"isPastDue"
],
"additionalProperties": false
}
@ -54515,6 +54573,9 @@
},
"isSuspended": {
"type": "boolean"
},
"isPastDue": {
"type": "boolean"
}
},
"required": [
@ -54535,7 +54596,8 @@
"customStorageLimit",
"customSeatsLimit",
"isQuarantined",
"isSuspended"
"isSuspended",
"isPastDue"
],
"additionalProperties": false,
"nullable": true