2026-03-17 11:44:36 +08:00
|
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
2026-03-18 12:40:51 +08:00
|
|
|
|
// GiftPayRequest 代付请求表(改造后:发起人创建并支付,好友领取)
|
2026-03-18 20:33:50 +08:00
|
|
|
|
// status: pending_pay(待发起人支付)| paid(已支付待领取)| refunded(已退款,不可再分享/领取)| cancelled | expired
|
2026-03-17 11:44:36 +08:00
|
|
|
|
type GiftPayRequest struct {
|
|
|
|
|
|
ID string `gorm:"column:id;primaryKey;size:50" json:"id"`
|
|
|
|
|
|
RequestSN string `gorm:"column:request_sn;uniqueIndex;size:32" json:"requestSn"`
|
|
|
|
|
|
InitiatorUserID string `gorm:"column:initiator_user_id;size:50;index" json:"initiatorUserId"`
|
|
|
|
|
|
ProductType string `gorm:"column:product_type;size:30" json:"productType"`
|
|
|
|
|
|
ProductID string `gorm:"column:product_id;size:50" json:"productId"`
|
|
|
|
|
|
Amount float64 `gorm:"column:amount;type:decimal(10,2)" json:"amount"`
|
|
|
|
|
|
Description string `gorm:"column:description;size:200" json:"description"`
|
2026-03-18 20:33:50 +08:00
|
|
|
|
Status string `gorm:"column:status;size:20;index" json:"status"` // pending_pay / paid / refunded / cancelled / expired
|
2026-03-18 12:40:51 +08:00
|
|
|
|
Quantity int `gorm:"column:quantity;default:1" json:"quantity"`
|
|
|
|
|
|
RedeemedCount int `gorm:"column:redeemed_count;default:0" json:"redeemedCount"`
|
2026-03-17 11:44:36 +08:00
|
|
|
|
PayerUserID *string `gorm:"column:payer_user_id;size:50" json:"payerUserId,omitempty"`
|
|
|
|
|
|
OrderID *string `gorm:"column:order_id;size:50" json:"orderId,omitempty"`
|
|
|
|
|
|
ExpireAt time.Time `gorm:"column:expire_at" json:"expireAt"`
|
|
|
|
|
|
CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"`
|
|
|
|
|
|
UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (GiftPayRequest) TableName() string { return "gift_pay_requests" }
|