- 新建 admin_pickups 表独立于 rental_orders,不污染订单状态机与财务统计口径 - 提号中/已完成/已取消三态:创建锁定账号,完成时给卖家钱包加可用余额并下架 listing,取消解锁账号 - 完成时 listing 置 completed,复用现有 listingLockedForOwnerMutation 拦截再上架 - 管理端提号管理页(列表/创建/完成/取消/可提号账号搜索)+ 卖家端提号记录页 - 财务仪表盘新增线下提号独立统计块,与正常订单口径分离 - 钱包流水 label、状态标签、菜单入口同步补齐 - 优化卖家服务悬浮菜单为一行四个,尺寸与配色对齐买家服务
98 lines
2.8 KiB
Go
98 lines
2.8 KiB
Go
package pickup
|
|
|
|
import (
|
|
"errors"
|
|
"time"
|
|
)
|
|
|
|
// 提号状态
|
|
const (
|
|
StatusPickingUp = "picking_up"
|
|
StatusCompleted = "completed"
|
|
StatusCancelled = "cancelled"
|
|
)
|
|
|
|
var (
|
|
ErrDependencyUnavailable = errors.New("dependency unavailable")
|
|
ErrListingUnavailable = errors.New("listing unavailable")
|
|
ErrPickupNotFound = errors.New("pickup not found")
|
|
ErrPickupNotPickingUp = errors.New("pickup not in picking_up status")
|
|
ErrInvalidAmount = errors.New("invalid amount")
|
|
ErrDuplicatePickup = errors.New("duplicate pickup in progress")
|
|
)
|
|
|
|
type PickupDTO struct {
|
|
ID uint64 `json:"id"`
|
|
PickupNo string `json:"pickup_no"`
|
|
ListingID uint64 `json:"listing_id"`
|
|
ListingNo string `json:"listing_no"`
|
|
AccountID uint64 `json:"account_id"`
|
|
AccountTitle string `json:"account_title"`
|
|
ServerRegion string `json:"server_region"`
|
|
LoginPlatform string `json:"login_platform"`
|
|
OwnerID uint64 `json:"owner_id"`
|
|
OwnerPhone string `json:"owner_phone"`
|
|
AdminID uint64 `json:"admin_id"`
|
|
Platform string `json:"platform"`
|
|
SettleAmountCent int64 `json:"settle_amount_cent"`
|
|
Status string `json:"status"`
|
|
Remark string `json:"remark"`
|
|
CompleteRemark string `json:"complete_remark"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
CompletedAt *time.Time `json:"completed_at,omitempty"`
|
|
CancelledAt *time.Time `json:"cancelled_at,omitempty"`
|
|
}
|
|
|
|
type CreateRequest struct {
|
|
ListingID uint64 `json:"listing_id" binding:"required"`
|
|
Platform string `json:"platform"`
|
|
Remark string `json:"remark"`
|
|
}
|
|
|
|
type CompleteRequest struct {
|
|
SettleAmountCent int64 `json:"settle_amount_cent" binding:"required,min=1"`
|
|
CompleteRemark string `json:"complete_remark"`
|
|
}
|
|
|
|
type CancelRequest struct {
|
|
Reason string `json:"reason" binding:"required"`
|
|
}
|
|
|
|
type AdminPickupQuery struct {
|
|
Page int
|
|
PageSize int
|
|
Keyword string
|
|
Status string
|
|
}
|
|
|
|
type SellerPickupQuery struct {
|
|
Page int
|
|
PageSize int
|
|
Status string
|
|
}
|
|
|
|
type AvailableListingDTO struct {
|
|
ID uint64 `json:"id"`
|
|
ListingNo string `json:"listing_no"`
|
|
AccountID uint64 `json:"account_id"`
|
|
AccountTitle string `json:"account_title"`
|
|
ServerRegion string `json:"server_region"`
|
|
LoginPlatform string `json:"login_platform"`
|
|
OwnerID uint64 `json:"owner_id"`
|
|
OwnerPhone string `json:"owner_phone"`
|
|
}
|
|
|
|
type PaginatedResult struct {
|
|
Items []PickupDTO `json:"items"`
|
|
Total int64 `json:"total"`
|
|
Page int `json:"page"`
|
|
PageSize int `json:"page_size"`
|
|
}
|
|
|
|
type AvailableListingsResult struct {
|
|
Items []AvailableListingDTO `json:"items"`
|
|
Total int64 `json:"total"`
|
|
Page int `json:"page"`
|
|
PageSize int `json:"page_size"`
|
|
}
|