fix: remove unused variable in product usecase

This commit is contained in:
Tiago Ribeiro 2026-03-09 09:25:57 -03:00
parent 742a93ddfc
commit 5d1f78dd33

View file

@ -117,11 +117,9 @@ func (s *Service) SearchProducts(ctx context.Context, filter domain.ProductSearc
// Adjust displayed stock by subtracting reservations
// In production, the Repo query itself would handle this for better performance
for i := range products {
// This is a simplified adjustment.
// Ideally, SearchProducts Repo method should do:
// stock = (SUM(i.stock_quantity) - (SELECT SUM(quantity) FROM stock_reservations WHERE product_id = p.id AND status='active'))
}
// for i := range products {
// // This is a simplified adjustment.
// }
return &domain.ProductSearchPage{Products: products, Total: total, Page: page, PageSize: pageSize}, nil
}