mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-19 18:14:38 +00:00
feat: coupoun support bank pay way (#5285)
This commit is contained in:
21
docSite/content/zh-cn/docs/development/upgrading/4111.md
Normal file
21
docSite/content/zh-cn/docs/development/upgrading/4111.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
title: 'V4.11.1(进行中)'
|
||||||
|
description: 'FastGPT V4.11.1 更新说明'
|
||||||
|
icon: 'upgrade'
|
||||||
|
draft: false
|
||||||
|
toc: true
|
||||||
|
weight: 782
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 🚀 新增内容
|
||||||
|
|
||||||
|
## ⚙️ 优化
|
||||||
|
|
||||||
|
1. 兑换码功能支持指定对公支付模式。
|
||||||
|
|
||||||
|
## 🐛 修复
|
||||||
|
|
||||||
|
|
||||||
|
## 🔨 工具更新
|
4
packages/global/support/wallet/sub/coupon/constants.ts
Normal file
4
packages/global/support/wallet/sub/coupon/constants.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export enum CouponTypeEnum {
|
||||||
|
bank = 'bank',
|
||||||
|
activity = 'activity'
|
||||||
|
}
|
@@ -1,4 +1,5 @@
|
|||||||
import type { SubTypeEnum, StandardSubLevelEnum } from '../constants';
|
import type { SubTypeEnum, StandardSubLevelEnum } from '../constants';
|
||||||
|
import type { CouponTypeEnum } from './constants';
|
||||||
|
|
||||||
export type TeamCouponSub = {
|
export type TeamCouponSub = {
|
||||||
type: `${SubTypeEnum}`; // Sub type
|
type: `${SubTypeEnum}`; // Sub type
|
||||||
@@ -13,4 +14,7 @@ export type TeamCouponSchema = {
|
|||||||
subscriptions: TeamCouponSub[];
|
subscriptions: TeamCouponSub[];
|
||||||
redeemedAt?: Date;
|
redeemedAt?: Date;
|
||||||
expiredAt?: Date;
|
expiredAt?: Date;
|
||||||
|
redeemedTeamId?: string;
|
||||||
|
type: CouponTypeEnum;
|
||||||
|
price?: number;
|
||||||
};
|
};
|
||||||
|
@@ -2,6 +2,8 @@ import { addDays } from 'date-fns';
|
|||||||
import { connectionMongo, getMongoModel } from '../../../common/mongo';
|
import { connectionMongo, getMongoModel } from '../../../common/mongo';
|
||||||
const { Schema } = connectionMongo;
|
const { Schema } = connectionMongo;
|
||||||
import type { TeamCouponSchema } from '@fastgpt/global/support/wallet/sub/coupon/type';
|
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';
|
export const couponCollectionName = 'team_sub_coupons';
|
||||||
|
|
||||||
@@ -10,6 +12,11 @@ const CouponSchema = new Schema({
|
|||||||
type: String,
|
type: String,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
enum: Object.values(CouponTypeEnum)
|
||||||
|
},
|
||||||
|
price: Number,
|
||||||
subscriptions: {
|
subscriptions: {
|
||||||
type: [Object],
|
type: [Object],
|
||||||
required: true
|
required: true
|
||||||
@@ -18,6 +25,10 @@ const CouponSchema = new Schema({
|
|||||||
type: Date,
|
type: Date,
|
||||||
default: undefined
|
default: undefined
|
||||||
},
|
},
|
||||||
|
redeemedTeamId: {
|
||||||
|
type: Schema.Types.ObjectId,
|
||||||
|
ref: TeamCollectionName
|
||||||
|
},
|
||||||
expiredAt: {
|
expiredAt: {
|
||||||
type: Date,
|
type: Date,
|
||||||
default: () => addDays(new Date(), 7)
|
default: () => addDays(new Date(), 7)
|
||||||
|
Reference in New Issue
Block a user