优化线下提号利润修改
This commit is contained in:
@@ -40,6 +40,19 @@ func (s *Service) Complete(ctx context.Context, pickupID uint64, req CompleteReq
|
||||
return s.repo.Complete(ctx, pickupID, req, adminID, meta)
|
||||
}
|
||||
|
||||
func (s *Service) UpdateProfit(ctx context.Context, pickupID uint64, req UpdateProfitRequest, adminID uint64, meta auditlog.Meta) (*PickupDTO, error) {
|
||||
if s.repo == nil {
|
||||
return nil, ErrDependencyUnavailable
|
||||
}
|
||||
if pickupID == 0 {
|
||||
return nil, ErrPickupNotFound
|
||||
}
|
||||
if req.ProfitAmountCent < 0 {
|
||||
return nil, ErrInvalidProfit
|
||||
}
|
||||
return s.repo.UpdateProfit(ctx, pickupID, req, adminID, meta)
|
||||
}
|
||||
|
||||
func (s *Service) Cancel(ctx context.Context, pickupID uint64, reason string, adminID uint64, meta auditlog.Meta) error {
|
||||
if s.repo == nil {
|
||||
return ErrDependencyUnavailable
|
||||
|
||||
Reference in New Issue
Block a user