feat(orders): 号主可从自己的列表隐藏已结束订单
只写入隐藏时间,订单和款项仍保留给租客与后台。详情按钮固定对齐,删除跟在后面。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -34,6 +34,7 @@ var (
|
||||
ErrDepositHoldAmountEmpty = errors.New("deposit hold amount empty")
|
||||
ErrOfflineSettlementCannotMark = errors.New("offline settlement cannot mark")
|
||||
ErrInvalidSellerHandoffStatus = errors.New("invalid seller handoff status")
|
||||
ErrOrderCannotHide = errors.New("order cannot hide")
|
||||
)
|
||||
|
||||
const internalOrderHours = 24
|
||||
@@ -63,6 +64,16 @@ func (s *Service) Cancel(ctx context.Context, userID uint64, orderID uint64) err
|
||||
return s.repo.Cancel(ctx, userID, orderID)
|
||||
}
|
||||
|
||||
func (s *Service) HideForOwner(ctx context.Context, userID uint64, orderID uint64) error {
|
||||
if s.repo == nil {
|
||||
return ErrDependencyUnavailable
|
||||
}
|
||||
if orderID == 0 {
|
||||
return ErrOrderCannotHide
|
||||
}
|
||||
return s.repo.HideForOwner(ctx, userID, orderID)
|
||||
}
|
||||
|
||||
func (s *Service) Pay(ctx context.Context, userID uint64, orderID uint64) error {
|
||||
if s.repo == nil {
|
||||
return ErrDependencyUnavailable
|
||||
|
||||
Reference in New Issue
Block a user