This commit is contained in:
2026-05-13 22:30:55 +07:00
parent 4130cb66df
commit 3b62504798
3 changed files with 30 additions and 7 deletions
@@ -2,6 +2,7 @@ package validator
import (
"errors"
"fmt"
"apskel-pos-be/internal/constants"
"apskel-pos-be/internal/contract"
@@ -71,8 +72,7 @@ func (v *ProductOutletPriceValidatorImpl) ValidateBulkCreateRequest(req *contrac
return errors.New("outlet_id is required for each price entry"), constants.MissingFieldErrorCode
}
if p.Price < 0 {
_ = i
return errors.New("price must be non-negative for each price entry"), constants.MalformedFieldErrorCode
return fmt.Errorf("price at index %d must be non-negative", i), constants.MalformedFieldErrorCode
}
}