From de5b8ddad760ee742c71cafbfece586f95549d58 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Mon, 20 Mar 2023 17:44:53 +0100 Subject: [PATCH] update --- src/internal/app/ui/product.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/internal/app/ui/product.go b/src/internal/app/ui/product.go index c8977f4..67dfdfa 100644 --- a/src/internal/app/ui/product.go +++ b/src/internal/app/ui/product.go @@ -2,7 +2,6 @@ package ui import ( "context" - "fmt" "strconv" "time" @@ -22,17 +21,16 @@ func GetProductPrice(srv *service.PriceService, prodID int) (*def.ProductPriceRe if err != nil { return res, err } + res.Price = price - // CalculateProductPrice(srv, prodID, res.Price) - fmt.Printf("SAving to cache: %s", key) srv.SaveToCache(ctx, key, res.Price, 30*time.Second) // FIXME refactor as cache service sth } return res, nil } +// CalculateProductPrice mock func CalculateProductPrice(srv *service.PriceService, prodID int, price float64) (float64, error) { - // customer := srv.GetCustomer(customerID) // customerPromo := srv.GetCustomerPromotions(customer) // customerDiscount := srv.GetCustomerDiscounts(customer)