adding attach preview
This commit is contained in:
21
shared/models/attachModels/attachEnums/AttachBranch.ts
Normal file
21
shared/models/attachModels/attachEnums/AttachBranch.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
export enum AttachBranch {
|
||||
MultiProduct = "multi_product",
|
||||
|
||||
OneOff = "one_off",
|
||||
|
||||
New = "new",
|
||||
AddOn = "add_on",
|
||||
|
||||
// Same product
|
||||
NewVersion = "new_version",
|
||||
SameCustomEnts = "same_custom_ents",
|
||||
SameCustom = "same_custom",
|
||||
UpdatePrepaidQuantity = "update_prepaid_quantity",
|
||||
Renew = "renew",
|
||||
|
||||
// Handle upgrades / downgrades
|
||||
MainIsFree = "main_is_free",
|
||||
MainIsTrial = "main_is_trial",
|
||||
Upgrade = "upgrade",
|
||||
Downgrade = "downgrade",
|
||||
}
|
||||
15
shared/models/attachModels/attachEnums/AttachConfig.ts
Normal file
15
shared/models/attachModels/attachEnums/AttachConfig.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { AttachBranch } from "./AttachBranch.js";
|
||||
|
||||
export enum ProrationBehavior {
|
||||
Immediately = "immediately",
|
||||
NextBilling = "next_billing",
|
||||
None = "none",
|
||||
}
|
||||
|
||||
export interface AttachConfig {
|
||||
onlyCheckout: boolean;
|
||||
carryUsage: boolean; // Whether to carry over existing usages
|
||||
branch: AttachBranch;
|
||||
proration: ProrationBehavior;
|
||||
disableTrial: boolean;
|
||||
}
|
||||
15
shared/models/attachModels/attachEnums/AttachFunction.ts
Normal file
15
shared/models/attachModels/attachEnums/AttachFunction.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export enum AttachFunction {
|
||||
CreateCheckout = "create_checkout",
|
||||
AddProduct = "add_product",
|
||||
UpdateEnts = "update_ents", // only update entitlements
|
||||
UpdateProduct = "update_product", // update product
|
||||
ScheduleProduct = "schedule_product",
|
||||
UpdatePrepaidQuantity = "update_prepaid_quantity",
|
||||
Renew = "renew",
|
||||
}
|
||||
|
||||
/* Handle checkout / public error:
|
||||
1. New version, same custom, same custom ents, renew, update prepaid quantity
|
||||
|
||||
2.
|
||||
*/
|
||||
7
shared/models/attachModels/attachPreviewModels.ts
Normal file
7
shared/models/attachModels/attachPreviewModels.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { AttachBranch } from "./attachEnums/AttachBranch.js";
|
||||
|
||||
export interface AttachPreview {
|
||||
branch: AttachBranch;
|
||||
options: any;
|
||||
new_items: any;
|
||||
}
|
||||
Reference in New Issue
Block a user