From 5d1f78dd33c5c718b210591391e410ef2365ace6 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Mon, 9 Mar 2026 09:25:57 -0300 Subject: [PATCH] fix: remove unused variable in product usecase --- backend/internal/usecase/product_usecase.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/internal/usecase/product_usecase.go b/backend/internal/usecase/product_usecase.go index 100a645..f24469e 100644 --- a/backend/internal/usecase/product_usecase.go +++ b/backend/internal/usecase/product_usecase.go @@ -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 }