mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Billing for formula assistant
Summary: Adding limits for AI calls and connecting those limits with a Stripe Account. - New table in homedb called `limits` - All calls to the AI are not routed through DocApi and measured. - All products now contain a special key `assistantLimit`, with a default value 0 - Limit is reset every time the subscription has changed its period - The billing page is updated with two new options that describe the AI plan - There is a new popup that allows the user to upgrade to a higher plan - Tiers are read directly from the Stripe product with a volume pricing model Test Plan: Updated and added Reviewers: georgegevoian, paulfitz Reviewed By: georgegevoian Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D3907
This commit is contained in:
@@ -2,15 +2,17 @@
|
||||
* A tip for fixing an error.
|
||||
*/
|
||||
export interface ApiTip {
|
||||
action: 'add-members' | 'upgrade' |'ask-for-help';
|
||||
action: 'add-members' | 'upgrade' | 'ask-for-help' | 'manage';
|
||||
message: string;
|
||||
}
|
||||
|
||||
export type LimitType = 'collaborators' | 'docs' | 'workspaces' | 'assistant';
|
||||
|
||||
/**
|
||||
* Documentation of a limit relevant to an API error.
|
||||
*/
|
||||
export interface ApiLimit {
|
||||
quantity: 'collaborators' | 'docs' | 'workspaces'; // what are we counting
|
||||
quantity: LimitType; // what are we counting
|
||||
subquantity?: string; // a nuance to what we are counting
|
||||
maximum: number; // maximum allowed
|
||||
value: number; // current value of quantity for user
|
||||
|
||||
Reference in New Issue
Block a user