Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
d37f8ddc
authored
Jul 30, 2026
by
Archer
Committed by
GitHub
Jul 30, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: support custom coupon expiration days (#7415)
parent
c8608e6d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
6 deletions
+27
-6
packages/global/openapi/admin/support/wallet/coupon/api.ts
+26
-5
pro
+1
-1
No files found.
packages/global/openapi/admin/support/wallet/coupon/api.ts
View file @
d37f8ddc
...
...
@@ -30,7 +30,7 @@ export const CreateCouponSubscriptionSchema = z.object({
});
export
type
CreateCouponSubscriptionType
=
z
.
infer
<
typeof
CreateCouponSubscriptionSchema
>
;
export
const
CreateCouponBody
Schema
=
z
.
object
({
const
CreateCouponBodyBase
Schema
=
z
.
object
({
subscriptions
:
z
.
array
(
CreateCouponSubscriptionSchema
).
min
(
1
).
meta
({
description
:
'兑换码包含的套餐列表'
}),
...
...
@@ -38,10 +38,6 @@ export const CreateCouponBodySchema = z.object({
description
:
'生成兑换码数量'
,
example
:
1
}),
type
:
z
.
enum
(
CouponTypeEnum
).
meta
({
description
:
'兑换码类型'
,
example
:
CouponTypeEnum
.
activity
}),
price
:
NumSchema
.
nonnegative
().
optional
().
meta
({
description
:
'订单原价'
,
example
:
100
...
...
@@ -59,6 +55,31 @@ export const CreateCouponBodySchema = z.object({
example
:
'线下付款兑换码'
})
});
export
const
CreateCouponBodySchema
=
z
.
discriminatedUnion
(
'type'
,
[
CreateCouponBodyBaseSchema
.
extend
({
type
:
z
.
literal
(
CouponTypeEnum
.
bank
).
meta
({
description
:
'兑换码类型'
,
example
:
CouponTypeEnum
.
bank
}),
expiredDays
:
IntSchema
.
positive
().
optional
().
default
(
360
).
meta
({
description
:
'兑换码有效天数;不传时默认 360 天'
,
example
:
360
})
}),
CreateCouponBodyBaseSchema
.
extend
({
type
:
z
.
literal
(
CouponTypeEnum
.
activity
).
meta
({
description
:
'兑换码类型'
,
example
:
CouponTypeEnum
.
activity
}),
expiredDays
:
IntSchema
.
positive
().
optional
().
default
(
30
).
meta
({
description
:
'兑换码有效天数;不传时默认 30 天'
,
example
:
30
})
})
]);
export
type
CreateCouponBodyInputType
=
z
.
input
<
typeof
CreateCouponBodySchema
>
;
export
type
CreateCouponBodyType
=
z
.
infer
<
typeof
CreateCouponBodySchema
>
;
export
const
CreateCouponResponseSchema
=
z
...
...
pro
@
a704153c
Subproject commit
53897c1c15c00adf4fc79461fd17e109e7948813
Subproject commit
a704153cf360c5b4ca60ac16c5788b97aecd8198
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment