mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
* New pay (#2484) * remove sub status * feat: new pay mode * fix: ts * limit
This commit is contained in:
29
packages/global/support/wallet/bill/api.d.ts
vendored
29
packages/global/support/wallet/bill/api.d.ts
vendored
@@ -1,16 +1,25 @@
|
||||
import { StandardSubLevelEnum, SubModeEnum } from '../sub/constants';
|
||||
import { BillTypeEnum } from './constants';
|
||||
|
||||
export type CreateBillProps = {
|
||||
type: BillTypeEnum;
|
||||
|
||||
// balance
|
||||
balance?: number; // read
|
||||
|
||||
month?: number;
|
||||
// extra dataset size
|
||||
extraDatasetSize?: number; // 1k
|
||||
extraPoints?: number; // 100w
|
||||
export type CreateStandPlanBill = {
|
||||
type: BillTypeEnum.standSubPlan;
|
||||
level: `${StandardSubLevelEnum}`;
|
||||
subMode: `${SubModeEnum}`;
|
||||
};
|
||||
type CreateExtractPointsBill = {
|
||||
type: BillTypeEnum.extraPoints;
|
||||
extraPoints: number;
|
||||
};
|
||||
type CreateExtractDatasetBill = {
|
||||
type: BillTypeEnum.extraDatasetSub;
|
||||
extraDatasetSize: number;
|
||||
month: number;
|
||||
};
|
||||
export type CreateBillProps =
|
||||
| CreateStandPlanBill
|
||||
| CreateExtractPointsBill
|
||||
| CreateExtractDatasetBill;
|
||||
|
||||
export type CreateBillResponse = {
|
||||
billId: string;
|
||||
codeUrl: string;
|
||||
|
@@ -19,7 +19,6 @@ export type BillSchemaType = {
|
||||
month?: number;
|
||||
datasetSize?: number;
|
||||
extraPoints?: number;
|
||||
invoice: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
|
@@ -1,3 +1,5 @@
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
|
||||
export enum SubTypeEnum {
|
||||
standard = 'standard',
|
||||
extraDatasetSize = 'extraDatasetSize',
|
||||
@@ -19,19 +21,6 @@ export const subTypeMap = {
|
||||
}
|
||||
};
|
||||
|
||||
export enum SubStatusEnum {
|
||||
active = 'active',
|
||||
expired = 'expired'
|
||||
}
|
||||
export const subStatusMap = {
|
||||
[SubStatusEnum.active]: {
|
||||
label: 'support.wallet.subscription.status.active'
|
||||
},
|
||||
[SubStatusEnum.expired]: {
|
||||
label: 'support.wallet.subscription.status.canceled'
|
||||
}
|
||||
};
|
||||
|
||||
export enum SubModeEnum {
|
||||
month = 'month',
|
||||
year = 'year'
|
||||
@@ -56,23 +45,28 @@ export enum StandardSubLevelEnum {
|
||||
}
|
||||
export const standardSubLevelMap = {
|
||||
[StandardSubLevelEnum.free]: {
|
||||
label: 'support.wallet.subscription.standardSubLevel.free',
|
||||
desc: 'support.wallet.subscription.standardSubLevel.free desc'
|
||||
label: i18nT('common:support.wallet.subscription.standardSubLevel.free'),
|
||||
desc: i18nT('common:support.wallet.subscription.standardSubLevel.free desc'),
|
||||
weight: 1
|
||||
},
|
||||
[StandardSubLevelEnum.experience]: {
|
||||
label: 'support.wallet.subscription.standardSubLevel.experience',
|
||||
desc: ''
|
||||
label: i18nT('common:support.wallet.subscription.standardSubLevel.experience'),
|
||||
desc: '',
|
||||
weight: 2
|
||||
},
|
||||
[StandardSubLevelEnum.team]: {
|
||||
label: 'support.wallet.subscription.standardSubLevel.team',
|
||||
desc: ''
|
||||
label: i18nT('common:support.wallet.subscription.standardSubLevel.team'),
|
||||
desc: '',
|
||||
weight: 3
|
||||
},
|
||||
[StandardSubLevelEnum.enterprise]: {
|
||||
label: 'support.wallet.subscription.standardSubLevel.enterprise',
|
||||
desc: ''
|
||||
label: i18nT('common:support.wallet.subscription.standardSubLevel.enterprise'),
|
||||
desc: '',
|
||||
weight: 4
|
||||
},
|
||||
[StandardSubLevelEnum.custom]: {
|
||||
label: 'support.wallet.subscription.standardSubLevel.custom',
|
||||
desc: ''
|
||||
label: i18nT('common:support.wallet.subscription.standardSubLevel.custom'),
|
||||
desc: '',
|
||||
weight: 5
|
||||
}
|
||||
};
|
||||
|
9
packages/global/support/wallet/sub/type.d.ts
vendored
9
packages/global/support/wallet/sub/type.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import { StandardSubLevelEnum, SubModeEnum, SubStatusEnum, SubTypeEnum } from './constants';
|
||||
import { StandardSubLevelEnum, SubModeEnum, SubTypeEnum } from './constants';
|
||||
|
||||
// Content of plan
|
||||
export type TeamStandardSubPlanItemType = {
|
||||
@@ -36,17 +36,14 @@ export type TeamSubSchema = {
|
||||
_id: string;
|
||||
teamId: string;
|
||||
type: `${SubTypeEnum}`;
|
||||
status: `${SubStatusEnum}`;
|
||||
startTime: Date;
|
||||
expiredTime: Date;
|
||||
price: number;
|
||||
|
||||
currentMode: `${SubModeEnum}`;
|
||||
nextMode: `${SubModeEnum}`;
|
||||
currentSubLevel: `${StandardSubLevelEnum}`;
|
||||
nextSubLevel: `${StandardSubLevelEnum}`;
|
||||
currentSubLevel: StandardSubLevelEnum;
|
||||
nextSubLevel: StandardSubLevelEnum;
|
||||
|
||||
pointPrice: number;
|
||||
totalPoints: number;
|
||||
surplusPoints: number;
|
||||
|
||||
|
Reference in New Issue
Block a user