diff --git a/docSite/content/zh-cn/docs/development/upgrading/4111.md b/docSite/content/zh-cn/docs/development/upgrading/4111.md new file mode 100644 index 000000000..cbb8afeb8 --- /dev/null +++ b/docSite/content/zh-cn/docs/development/upgrading/4111.md @@ -0,0 +1,21 @@ +--- +title: 'V4.11.1(进行中)' +description: 'FastGPT V4.11.1 更新说明' +icon: 'upgrade' +draft: false +toc: true +weight: 782 +--- + + + +## 🚀 新增内容 + +## ⚙️ 优化 + +1. 兑换码功能支持指定对公支付模式。 + +## 🐛 修复 + + +## 🔨 工具更新 diff --git a/packages/global/support/wallet/sub/coupon/constants.ts b/packages/global/support/wallet/sub/coupon/constants.ts new file mode 100644 index 000000000..d5c90a006 --- /dev/null +++ b/packages/global/support/wallet/sub/coupon/constants.ts @@ -0,0 +1,4 @@ +export enum CouponTypeEnum { + bank = 'bank', + activity = 'activity' +} diff --git a/packages/global/support/wallet/sub/coupon/type.d.ts b/packages/global/support/wallet/sub/coupon/type.d.ts index f75e3c32b..eadbf28b7 100644 --- a/packages/global/support/wallet/sub/coupon/type.d.ts +++ b/packages/global/support/wallet/sub/coupon/type.d.ts @@ -1,4 +1,5 @@ import type { SubTypeEnum, StandardSubLevelEnum } from '../constants'; +import type { CouponTypeEnum } from './constants'; export type TeamCouponSub = { type: `${SubTypeEnum}`; // Sub type @@ -13,4 +14,7 @@ export type TeamCouponSchema = { subscriptions: TeamCouponSub[]; redeemedAt?: Date; expiredAt?: Date; + redeemedTeamId?: string; + type: CouponTypeEnum; + price?: number; }; diff --git a/packages/service/support/wallet/coupon/schema.ts b/packages/service/support/wallet/coupon/schema.ts index 88ec96a5d..8be723654 100644 --- a/packages/service/support/wallet/coupon/schema.ts +++ b/packages/service/support/wallet/coupon/schema.ts @@ -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)