* New pay (#2484)

* remove sub status

* feat: new pay mode

* fix: ts

* limit
This commit is contained in:
Archer
2024-08-26 09:52:09 +08:00
committed by GitHub
parent a4c19fbd0a
commit c1d08c0ccc
17 changed files with 170 additions and 440 deletions

View File

@@ -7,10 +7,9 @@ import { connectionMongo, getMongoModel } from '../../../common/mongo';
const { Schema } = connectionMongo;
import { TeamCollectionName } from '@fastgpt/global/support/user/team/constant';
import {
standardSubLevelMap,
subModeMap,
subStatusMap,
subTypeMap
StandardSubLevelEnum,
SubModeEnum,
SubTypeEnum
} from '@fastgpt/global/support/wallet/sub/constants';
import type { TeamSubSchema } from '@fastgpt/global/support/wallet/sub/type';
@@ -24,12 +23,7 @@ const SubSchema = new Schema({
},
type: {
type: String,
enum: Object.keys(subTypeMap),
required: true
},
status: {
type: String,
enum: Object.keys(subStatusMap),
enum: Object.values(SubTypeEnum),
required: true
},
startTime: {
@@ -40,38 +34,29 @@ const SubSchema = new Schema({
type: Date,
required: true
},
price: {
// last sub pay price(total price)
type: Number,
required: true
},
// standard sub
currentMode: {
type: String,
enum: Object.keys(subModeMap)
enum: Object.values(SubModeEnum)
},
nextMode: {
type: String,
enum: Object.keys(subModeMap)
enum: Object.values(SubModeEnum)
},
currentSubLevel: {
type: String,
enum: Object.keys(standardSubLevelMap)
enum: Object.values(StandardSubLevelEnum)
},
nextSubLevel: {
type: String,
enum: Object.keys(standardSubLevelMap)
enum: Object.values(StandardSubLevelEnum)
},
// stand sub and extra points sub. Plan total points
totalPoints: {
type: Number
},
pointPrice: {
// stand level point total price
type: Number
},
surplusPoints: {
// plan surplus points
type: Number