fix: remove unused variable in product usecase
This commit is contained in:
parent
742a93ddfc
commit
5d1f78dd33
1 changed files with 3 additions and 5 deletions
|
|
@ -117,11 +117,9 @@ func (s *Service) SearchProducts(ctx context.Context, filter domain.ProductSearc
|
||||||
|
|
||||||
// Adjust displayed stock by subtracting reservations
|
// Adjust displayed stock by subtracting reservations
|
||||||
// In production, the Repo query itself would handle this for better performance
|
// In production, the Repo query itself would handle this for better performance
|
||||||
for i := range products {
|
// for i := range products {
|
||||||
// This is a simplified adjustment.
|
// // 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'))
|
|
||||||
}
|
|
||||||
|
|
||||||
return &domain.ProductSearchPage{Products: products, Total: total, Page: page, PageSize: pageSize}, nil
|
return &domain.ProductSearchPage{Products: products, Total: total, Page: page, PageSize: pageSize}, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue