仲裁结案会把结账单置为终态 settled,但该状态一直是裸字符串;同时 adminfinance 按日结算聚合只按
accepted 过滤,容易被误读成"仲裁单掉出统计"。本次只做卫生与口径固化,不改任何行为:
- order 新增 CheckoutStatus{Submitted,Countered,Accepted,Disputed,Settled},包内沿用非导出别名
- dispute 的仲裁结案与争议取消分支改用常量;distribution 不能反向依赖 order,本地声明同名常量
- adminfinance 聚合里的 oc.status = 'accepted' 改为常量绑定,并注释说明仲裁单不计入是有意口径
- 新增 distribution 结账单退款重算用例(该分支原先无覆盖):accepted/settled 按结账单实际租金,
submitted 不被采用;dashboard 用例补一张 settled 结账单,钉住"不计入已结算订单数"
106 lines
4.1 KiB
Go
106 lines
4.1 KiB
Go
package order
|
||
|
||
import "hfb_sys/backend/internal/model"
|
||
|
||
const (
|
||
orderStatusPendingPayment = "pending_payment"
|
||
orderStatusPendingHandoff = "pending_handoff"
|
||
orderStatusRenting = "renting"
|
||
orderStatusOverdue = "overdue"
|
||
orderStatusPendingCheckoutConfirm = "pending_checkout_confirm"
|
||
orderStatusPendingCheckoutAccept = "pending_checkout_accept"
|
||
orderStatusCheckoutDisputing = "checkout_disputing"
|
||
orderStatusCompleted = "completed"
|
||
orderStatusCancelled = "cancelled"
|
||
orderStatusClosed = "closed"
|
||
orderStatusAbnormal = "abnormal"
|
||
|
||
handoffStatusNone = "none"
|
||
handoffStatusPendingOwner = "pending_owner"
|
||
handoffStatusPendingRenterConfirm = "pending_renter_confirm"
|
||
handoffStatusReceived = "received"
|
||
handoffStatusReturnOverdue = "return_overdue"
|
||
handoffStatusPendingOwnerCheckout = "pending_owner_checkout"
|
||
handoffStatusPendingRenterCheckout = "pending_renter_checkout"
|
||
handoffStatusCheckoutDisputed = "checkout_disputed"
|
||
handoffStatusReturned = "returned"
|
||
handoffStatusOwnerTimeout = "owner_timeout"
|
||
handoffStatusRenterConfirmTimeout = "renter_confirm_timeout"
|
||
handoffStatusOwnerReturnConfirmTimeout = "owner_return_confirm_timeout"
|
||
handoffStatusOwnerCheckoutConfirmTimeout = "owner_checkout_confirm_timeout"
|
||
handoffStatusCancelled = "cancelled"
|
||
handoffStatusAdminClosed = "admin_closed"
|
||
handoffStatusAdminAbnormal = "admin_abnormal"
|
||
|
||
settlementStatusUnsettled = "unsettled"
|
||
settlementStatusPending = "pending"
|
||
settlementStatusSettled = "settled"
|
||
settlementStatusClosed = "closed"
|
||
settlementStatusDisputed = "disputed"
|
||
settlementStatusArbitrated = "arbitrated"
|
||
|
||
handoffModeOwner = "owner"
|
||
handoffModePlatform = "platform"
|
||
|
||
settlementModeOwnerWallet = "owner_wallet"
|
||
settlementModePlatformManaged = "platform_managed"
|
||
|
||
offlineSettlementStatusNone = "none"
|
||
offlineSettlementStatusPending = "pending"
|
||
offlineSettlementStatusSettled = "settled"
|
||
|
||
checkoutStatusSubmitted = "submitted"
|
||
checkoutStatusCountered = "countered"
|
||
checkoutStatusAccepted = "accepted"
|
||
checkoutStatusDisputed = "disputed"
|
||
|
||
// 结账单状态的跨模块导出别名:dispute 仲裁结案写 settled,adminfinance 统计按
|
||
// accepted 过滤,这些跨包位置不应再出现裸字符串。包内沿用上面的非导出名。
|
||
// CheckoutStatusSettled 是仲裁终态(写回实际结算金额后置位),不属于
|
||
// hasOpenCheckout 的"待结"集合——仲裁只发生在 completed 订单上。
|
||
CheckoutStatusSubmitted = checkoutStatusSubmitted
|
||
CheckoutStatusCountered = checkoutStatusCountered
|
||
CheckoutStatusAccepted = checkoutStatusAccepted
|
||
CheckoutStatusDisputed = checkoutStatusDisputed
|
||
CheckoutStatusSettled = "settled"
|
||
|
||
checkoutTurnOwner = "owner"
|
||
checkoutTurnRenter = "renter"
|
||
|
||
// checkoutMaxRounds 结账协商最大提案轮次(含租客首提)
|
||
checkoutMaxRounds = 6
|
||
|
||
refundStatusPending = "pending"
|
||
refundStatusPendingReview = "pending_review"
|
||
refundStatusRefunded = "refunded"
|
||
|
||
listingReviewStatusApproved = "approved"
|
||
|
||
listingStatusPublished = "published"
|
||
listingStatusRented = "rented"
|
||
listingStatusOffline = "offline"
|
||
listingStatusCompleted = "completed"
|
||
listingStatusAbnormal = "abnormal"
|
||
listingStatusSealed = "sealed"
|
||
|
||
accountStatusPublished = "published"
|
||
accountStatusRented = "rented"
|
||
accountStatusOffline = "offline"
|
||
accountStatusAbnormal = "abnormal"
|
||
accountStatusSealed = "sealed"
|
||
|
||
walletBizOwnerIncome = "owner_income"
|
||
walletBizDepositCompensation = "deposit_compensation"
|
||
|
||
refundBizCancel = "cancel_refund"
|
||
refundBizAdminClose = "admin_close_refund"
|
||
refundBizAdminSeal = "admin_seal_refund"
|
||
refundBizAdmin = "admin_refund"
|
||
refundBizCheckout = "checkout_refund"
|
||
refundBizDeposit = "deposit_refund"
|
||
|
||
depositHoldStatusNone = model.DepositHoldStatusNone
|
||
depositHoldStatusHeld = model.DepositHoldStatusHeld
|
||
depositHoldStatusReleased = model.DepositHoldStatusReleased
|
||
)
|