improvements, fixes
This commit is contained in:
parent
5a0031f9a4
commit
1953c6d9ba
|
|
@ -52,6 +52,7 @@ public class ProductToAuctionDto : IProductToAuctionDto
|
|||
CurrentPrice = productToAuction.CurrentPrice;
|
||||
ProductAmount = productToAuction.ProductAmount;
|
||||
SortIndex = productToAuction.SortIndex;
|
||||
WinnerCustomerId = productToAuction.WinnerCustomerId;
|
||||
}
|
||||
|
||||
public ProductToAuctionMapping CreateMainEntity()
|
||||
|
|
@ -66,6 +67,7 @@ public class ProductToAuctionDto : IProductToAuctionDto
|
|||
mainEntity.CurrentPrice = CurrentPrice;
|
||||
mainEntity.ProductAmount = ProductAmount;
|
||||
mainEntity.SortIndex = SortIndex;
|
||||
mainEntity.WinnerCustomerId = WinnerCustomerId;
|
||||
|
||||
return mainEntity;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Hubs
|
|||
return;
|
||||
}
|
||||
|
||||
await SetAuctionBidPrice(revertLastBid.BidPrice, productToAuction, product);
|
||||
await SetAuctionBidPrice(revertLastBid.BidPrice, productToAuction, product, revertLastBid.CustomerId);
|
||||
await SendAuctionBidMessageAsync(revertLastBid, productToAuction, product, customer.Id);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
@ -236,7 +236,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Hubs
|
|||
var activeProductAuction = (await auctionService.GetProductToAuctionByAuctionIdAndProductIdAsync(bidRequestMessage.AuctionId, bidRequestMessage.ProductId, true)).FirstOrDefault();
|
||||
if (activeProductAuction is not { IsActiveItem: true } || activeProductAuction.WinnerCustomerId == customer.Id)
|
||||
{
|
||||
logger.Warning($"SignalRMessageHandler.HandleBidRequest(); (activeProductAuction is not {{ IsActiveItem: true }} || activeProductAuction.WinnerCustomerId == customer.Id); AuctionStatus: {activeProductAuction?.AuctionStatus}; WinnerCustomerId: {activeProductAuction?.WinnerCustomerId}", null, customer);
|
||||
logger.Warning($"SignalRMessageHandler.HandleBidRequest(); (activeProductAuction is not {{ IsActiveItem: true }}); AuctionStatus: {activeProductAuction?.AuctionStatus};", null, customer);
|
||||
return; //TODO: - J.
|
||||
}
|
||||
|
||||
|
|
@ -257,7 +257,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Hubs
|
|||
await auctionService.InsertBidAsync(auctionBid);
|
||||
|
||||
activeProductAuction.AuctionStatus = AuctionStatus.Active;
|
||||
if (!await SetAuctionBidPrice(bidRequestMessage.BidPrice, activeProductAuction, product)) return;
|
||||
if (!await SetAuctionBidPrice(bidRequestMessage.BidPrice, activeProductAuction, product, customer.Id)) return;
|
||||
|
||||
await SendAuctionBidMessageAsync(auctionBid, activeProductAuction, product, customer.Id);
|
||||
}
|
||||
|
|
@ -289,7 +289,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Hubs
|
|||
await hubContext.Clients.All.SendAsync("send", bidMessage.ToJson());
|
||||
}
|
||||
|
||||
private async Task<bool> SetAuctionBidPrice(decimal bidPrice, ProductToAuctionMapping productToAuction, Product product)
|
||||
private async Task<bool> SetAuctionBidPrice(decimal bidPrice, ProductToAuctionMapping productToAuction, Product product, int lastBidCustomerId)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -298,6 +298,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Hubs
|
|||
|
||||
//activeProductAuction.StartingPrice = product.OldPrice; //TODO: ez biztosan kezelve van mikor összerendeljük? - J.
|
||||
productToAuction.CurrentPrice = product.Price;
|
||||
productToAuction.WinnerCustomerId = lastBidCustomerId;
|
||||
await auctionService.UpdateProductToAuctionMappingAsync(productToAuction);
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -394,14 +394,14 @@
|
|||
signalRResetItemButton: true,
|
||||
},
|
||||
[AuctionStatus.Pause]: {
|
||||
signalRBidButton: true,
|
||||
signalRFirstWarningButton: true,
|
||||
signalRSecondWarningButton: true,
|
||||
signalROpenItemButton: false,
|
||||
signalRCloseItemButton: true,
|
||||
signalRPauseItemButton: true,
|
||||
signalRRevertBidButton: true,
|
||||
signalRResetItemButton: true,
|
||||
signalRBidButton: true,
|
||||
signalRFirstWarningButton: true,
|
||||
signalRSecondWarningButton: true,
|
||||
signalROpenItemButton: false,
|
||||
signalRCloseItemButton: true,
|
||||
signalRPauseItemButton: true,
|
||||
signalRRevertBidButton: false,
|
||||
signalRResetItemButton: false,
|
||||
},
|
||||
[AuctionStatus.Sold]: {
|
||||
signalRBidButton: true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue