add new processor
This commit is contained in:
@@ -290,6 +290,10 @@ func (s *ProductManagementService) ValidateProduct(product *entities.Product) er
|
||||
return errors.New("产品价格不能为负数")
|
||||
}
|
||||
|
||||
if product.CostPrice.IsNegative() {
|
||||
return errors.New("成本价不能为负数")
|
||||
}
|
||||
|
||||
// 验证分类是否存在
|
||||
if product.CategoryID != "" {
|
||||
category, err := s.categoryRepo.GetByID(context.Background(), product.CategoryID)
|
||||
|
||||
Reference in New Issue
Block a user