mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-14 15:11:13 +00:00
feat: coupoun support bank pay way (#5285)
This commit is contained in:
@@ -2,6 +2,8 @@ import { addDays } from 'date-fns';
|
||||
import { connectionMongo, getMongoModel } from '../../../common/mongo';
|
||||
const { Schema } = connectionMongo;
|
||||
import type { TeamCouponSchema } from '@fastgpt/global/support/wallet/sub/coupon/type';
|
||||
import { TeamCollectionName } from '@fastgpt/global/support/user/team/constant';
|
||||
import { CouponTypeEnum } from '@fastgpt/global/support/wallet/sub/coupon/constants';
|
||||
|
||||
export const couponCollectionName = 'team_sub_coupons';
|
||||
|
||||
@@ -10,6 +12,11 @@ const CouponSchema = new Schema({
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
enum: Object.values(CouponTypeEnum)
|
||||
},
|
||||
price: Number,
|
||||
subscriptions: {
|
||||
type: [Object],
|
||||
required: true
|
||||
@@ -18,6 +25,10 @@ const CouponSchema = new Schema({
|
||||
type: Date,
|
||||
default: undefined
|
||||
},
|
||||
redeemedTeamId: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: TeamCollectionName
|
||||
},
|
||||
expiredAt: {
|
||||
type: Date,
|
||||
default: () => addDays(new Date(), 7)
|
||||
|
Reference in New Issue
Block a user