Files
hfb_sys/backend/internal/model/order_checkout.go
T
yml2213 3631e70321 实现结账流程:替换旧归还逻辑为完整结账-修正-争议流程
- 新增 order_checkouts 表,支持结账明细(消耗/押金扣除/退回/号主入账)
- 租客发起结账 → 号主确认 → 已完成(正常路径)
- 号主修改结账 → 租客确认修正 → 已完成(修正路径)
- 结账阶段任一方发起争议 → 后台仲裁 → 已完成/已关闭/异常(争议路径)
- 争议模块适配结账争议类型,仲裁结果新增 mark_abnormal
- 超时任务适配新的 pending_checkout_confirm 状态
- 前端结账明细面板、发起结账/确认/修正/拒绝表单全部实现
- 移除旧的 SubmitReturn/ConfirmReturn 接口
2026-05-24 02:17:36 +08:00

35 lines
1.8 KiB
Go

package model
import (
"time"
"gorm.io/datatypes"
)
type OrderCheckout struct {
ID uint64 `gorm:"primaryKey" json:"id"`
OrderID uint64 `gorm:"not null;index" json:"order_id"`
InitiatedBy uint64 `gorm:"not null" json:"initiated_by"`
Status string `gorm:"size:32;not null;default:'submitted'" json:"status"`
RentAmount float64 `gorm:"type:decimal(12,2);not null;default:0" json:"rent_amount"`
DepositAmount float64 `gorm:"type:decimal(12,2);not null;default:0" json:"deposit_amount"`
ConsumableAmount float64 `gorm:"type:decimal(12,2);not null;default:0" json:"consumable_amount"`
CoinConsumedM float64 `gorm:"type:decimal(12,2);not null;default:0" json:"coin_consumed_m"`
OtherAmount float64 `gorm:"type:decimal(12,2);not null;default:0" json:"other_amount"`
DepositDeductAmount float64 `gorm:"type:decimal(12,2);not null;default:0" json:"deposit_deduct_amount"`
RenterRefundAmount float64 `gorm:"type:decimal(12,2);not null;default:0" json:"renter_refund_amount"`
OwnerIncomeAmount float64 `gorm:"type:decimal(12,2);not null;default:0" json:"owner_income_amount"`
Content string `json:"content"`
EvidenceURLS datatypes.JSON `json:"evidence_urls"`
OwnerAdjustmentReason string `json:"owner_adjustment_reason"`
OwnerAdjustedAt *time.Time `json:"owner_adjusted_at"`
RenterConfirmedAt *time.Time `json:"renter_confirmed_at"`
RenterRejectedAt *time.Time `json:"renter_rejected_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (OrderCheckout) TableName() string {
return "order_checkouts"
}