IsValidBidPrice fix

This commit is contained in:
Loretta 2024-11-30 12:58:25 +01:00
parent 2f2049230b
commit d0c6e71b0c
1 changed files with 3 additions and 3 deletions

View File

@ -245,7 +245,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Hubs
var product = await auctionService.GetProductById(bidRequestMessage.ProductId);
if (product == null) return;
if (IsValidBidPrice(product.Price, activeProductAuction.CurrentPrice, bidRequestMessage.BidPrice, customer)) return;
if (!IsValidBidPrice(product.Price, activeProductAuction.CurrentPrice, bidRequestMessage.BidPrice, customer)) return;
var auctionBid = bidRequestMessage.CreateMainEntity();
auctionBid.ProductAuctionMappingId = activeProductAuction.Id;
@ -318,10 +318,10 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Hubs
if (productPrice >= bidRequestPrice || productToAuctionCurrentPrice >= bidRequestPrice || bidRequestPrice != GetNextBidPrice(productToAuctionCurrentPrice))
{
logger.Warning($"SignalRMessageHandler.IsValidBidPrice(); (productPrice >= bidRequestPrice || productToAuctionCurrentPrice >= bidRequestPrice || bidRequestPrice != GetNextBidPrice(productToAuctionCurrentPrice)); productPrice: {productPrice}; productToAuctionCurrentPrice: {productToAuctionCurrentPrice}; bidRequestPrice: {bidRequestPrice}", null, customer);
return true;
return false;
}
return false;
return true;
}
private static decimal GetStepAmount(decimal currentBidPrice) => AuctionService.GetStepAmount(currentBidPrice);