add new processor

This commit is contained in:
2025-11-13 20:43:35 +08:00
parent f00cee7410
commit 00a3f0f1e9
15 changed files with 961 additions and 1 deletions

View File

@@ -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)