Skip to content

Commit 9be1b42

Browse files
authored
Merge pull request #1410 from AppQuality/test-purchasable-plans
Add payment processing features and enhance plan status handling
2 parents 916620b + 9799652 commit 9be1b42

File tree

22 files changed

+569
-69
lines changed

22 files changed

+569
-69
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"@analytics/google-tag-manager": "^0.6.0",
77
"@analytics/segment": "^2.1.0",
88
"@appquality/languages": "1.4.3",
9-
"@appquality/unguess-design-system": "4.0.48",
9+
"@appquality/unguess-design-system": "4.0.49",
1010
"@atlaskit/pragmatic-drag-and-drop": "^1.7.4",
1111
"@atlaskit/pragmatic-drag-and-drop-flourish": "^2.0.3",
1212
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",

src/common/schema.ts

Lines changed: 112 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ export interface paths {
2222
/** A request to login with your username and password */
2323
post: operations["post-authenticate"];
2424
};
25+
"/buy": {
26+
/**
27+
* Stripe webhook destination, listen three event types:
28+
* - charge.failed,
29+
* - checkout.session.completed
30+
* - checkout.session.expired
31+
*/
32+
post: operations["post-buy"];
33+
};
2534
"/campaigns/{cid}": {
2635
get: operations["get-campaign"];
2736
patch: operations["patch-campaigns"];
@@ -305,6 +314,10 @@ export interface paths {
305314
};
306315
};
307316
};
317+
"/checkout": {
318+
/** Start a checkout Session */
319+
post: operations["post-checkout"];
320+
};
308321
"/companies/sizes": {
309322
get: operations["get-companies-sizes"];
310323
};
@@ -356,6 +369,14 @@ export interface paths {
356369
};
357370
};
358371
};
372+
"/plans/{pid}/checkoutItem": {
373+
get: operations["get-plans-pid-checkoutItem"];
374+
parameters: {
375+
path: {
376+
pid: string;
377+
};
378+
};
379+
};
359380
"/plans/{pid}/status": {
360381
/** */
361382
patch: operations["patch-workspaces-wid-plans-pid-status"];
@@ -1363,7 +1384,7 @@ export interface components {
13631384
* PlanStatus
13641385
* @enum {string}
13651386
*/
1366-
PlanStatus: "pending_review" | "draft" | "approved";
1387+
PlanStatus: "pending_review" | "draft" | "approved" | "paying";
13671388
/** Platform Object */
13681389
Platform: {
13691390
/**
@@ -1861,9 +1882,7 @@ export interface components {
18611882
is_public?: number;
18621883
languages?: string[];
18631884
outOfScope?: string;
1864-
/** @description Da togliere */
18651885
page_manual_id?: number;
1866-
/** @description Da togliere */
18671886
page_preview_id?: number;
18681887
platforms: components["schemas"]["Platform"][];
18691888
pm_id: number;
@@ -1960,6 +1979,46 @@ export interface operations {
19601979
};
19611980
requestBody: components["requestBodies"]["Credentials"];
19621981
};
1982+
/**
1983+
* Stripe webhook destination, listen three event types:
1984+
* - charge.failed,
1985+
* - checkout.session.completed
1986+
* - checkout.session.expired
1987+
*/
1988+
"post-buy": {
1989+
responses: {
1990+
/** OK */
1991+
200: unknown;
1992+
400: components["responses"]["Error"];
1993+
404: components["responses"]["Error"];
1994+
406: components["responses"]["Error"];
1995+
500: components["responses"]["Error"];
1996+
};
1997+
requestBody: {
1998+
content: {
1999+
"application/json": {
2000+
api_version?: string;
2001+
created?: number;
2002+
data: {
2003+
object: {
2004+
/** @description Checkout id */
2005+
id: string;
2006+
metadata: {
2007+
iv: string;
2008+
key: string;
2009+
tag: string;
2010+
};
2011+
};
2012+
};
2013+
/** @enum {undefined} */
2014+
type:
2015+
| "checkout.session.completed"
2016+
| "checkout.session.async_payment_failed"
2017+
| "checkout.session.expired";
2018+
};
2019+
};
2020+
};
2021+
};
19632022
"get-campaign": {
19642023
parameters: {
19652024
path: {
@@ -3108,6 +3167,30 @@ export interface operations {
31083167
500: components["responses"]["Error"];
31093168
};
31103169
};
3170+
/** Start a checkout Session */
3171+
"post-checkout": {
3172+
responses: {
3173+
/** Created */
3174+
201: {
3175+
content: {
3176+
"application/json": {
3177+
id: string;
3178+
url: string;
3179+
};
3180+
};
3181+
};
3182+
};
3183+
requestBody: {
3184+
content: {
3185+
"application/json": {
3186+
cancel_url?: string;
3187+
meta?: string;
3188+
price_id: string;
3189+
success_url?: string;
3190+
};
3191+
};
3192+
};
3193+
};
31113194
"get-companies-sizes": {
31123195
responses: {
31133196
/** OK */
@@ -3262,6 +3345,7 @@ export interface operations {
32623345
modules: components["schemas"]["Module"][];
32633346
};
32643347
id: number;
3348+
is_frozen?: number;
32653349
project: {
32663350
id: number;
32673351
name: string;
@@ -3314,6 +3398,29 @@ export interface operations {
33143398
};
33153399
};
33163400
};
3401+
"get-plans-pid-checkoutItem": {
3402+
parameters: {
3403+
path: {
3404+
pid: string;
3405+
};
3406+
};
3407+
responses: {
3408+
/** OK */
3409+
200: {
3410+
content: {
3411+
"application/json": {
3412+
metadata?: { [key: string]: unknown };
3413+
price_id: string;
3414+
status: string;
3415+
};
3416+
};
3417+
};
3418+
403: components["responses"]["Error"];
3419+
404: components["responses"]["Error"];
3420+
405: components["responses"]["Error"];
3421+
500: components["responses"]["Error"];
3422+
};
3423+
};
33173424
/** */
33183425
"patch-workspaces-wid-plans-pid-status": {
33193426
parameters: {
@@ -3610,6 +3717,7 @@ export interface operations {
36103717
password: string;
36113718
roleId: number;
36123719
surname: string;
3720+
templateId?: number;
36133721
} & (
36143722
| components["schemas"]["PostUserInviteData"]
36153723
| components["schemas"]["PostUserNewData"]
@@ -4120,8 +4228,7 @@ export interface operations {
41204228
/** @enum {string} */
41214229
status: "pending" | "proposed" | "approved" | "rejected";
41224230
};
4123-
/** @enum {string} */
4124-
status: "draft" | "pending_review" | "approved";
4231+
status: components["schemas"]["PlanStatus"];
41254232
title: string;
41264233
}[];
41274234
};

0 commit comments

Comments
 (0)