feat: add coupon support to orders and create user_coupons model
- Added CouponID field to Order model to track used coupons. - Updated order query generation to include CouponID. - Introduced UserCoupon model to manage user coupon associations. - Implemented query methods for UserCoupon to facilitate CRUD operations. - Updated query context and default query setup to include UserCoupon.
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"quyun/v2/providers/job"
|
||||
"quyun/v2/providers/storage"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -14,11 +11,10 @@ var (
|
||||
Audit *audit
|
||||
Common *common
|
||||
Content *content
|
||||
Coupon *coupon
|
||||
Creator *creator
|
||||
Job *job.Job
|
||||
Notification *notification
|
||||
Order *order
|
||||
Storage *storage.Storage
|
||||
Super *super
|
||||
Tenant *tenant
|
||||
User *user
|
||||
@@ -32,11 +28,10 @@ type services struct {
|
||||
audit *audit
|
||||
common *common
|
||||
content *content
|
||||
coupon *coupon
|
||||
creator *creator
|
||||
job *job.Job
|
||||
notification *notification
|
||||
order *order
|
||||
storage *storage.Storage
|
||||
super *super
|
||||
tenant *tenant
|
||||
user *user
|
||||
@@ -50,11 +45,10 @@ func (svc *services) Prepare() error {
|
||||
Audit = svc.audit
|
||||
Common = svc.common
|
||||
Content = svc.content
|
||||
Coupon = svc.coupon
|
||||
Creator = svc.creator
|
||||
Job = svc.job
|
||||
Notification = svc.notification
|
||||
Order = svc.order
|
||||
Storage = svc.storage
|
||||
Super = svc.super
|
||||
Tenant = svc.tenant
|
||||
User = svc.user
|
||||
|
||||
Reference in New Issue
Block a user