2025-11-24 18:44:06 +08:00
|
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"platform/web/core"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/shopspring/decimal"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// Refund 退款记录表
|
|
|
|
|
|
type Refund struct {
|
|
|
|
|
|
core.Model
|
2025-12-15 14:48:30 +08:00
|
|
|
|
TradeID int32 `json:"trade_id" gorm:"column:trade_id"` // 订单ID
|
|
|
|
|
|
ProductID *int32 `json:"product_id,omitempty" gorm:"column:product_id"` // 产品ID
|
|
|
|
|
|
Amount decimal.Decimal `json:"amount" gorm:"column:amount"` // 退款金额
|
|
|
|
|
|
Reason *string `json:"reason,omitempty" gorm:"column:reason"` // 退款原因
|
|
|
|
|
|
Status RefundStatus `json:"status" gorm:"column:status"` // 退款状态:0-待处理,1-已退款,2-已拒绝
|
2025-11-24 18:44:06 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// RefundStatus 退款状态枚举
|
|
|
|
|
|
type RefundStatus int
|
|
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
|
RefundStatusPending RefundStatus = 0 // 待处理
|
|
|
|
|
|
RefundStatusRefunded RefundStatus = 1 // 已退款
|
|
|
|
|
|
RefundStatusRejected RefundStatus = 2 // 已拒绝
|
|
|
|
|
|
)
|