Automatic open next item; Impelement BidsCount to AuctionToProductMapping; Add AuctionRequestMode; improvements, fixes, etc..
This commit is contained in:
parent
f940fa9ded
commit
2a3fc24632
|
|
@ -40,6 +40,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Areas.Admin.Controllers
|
|||
public AnnouncementController(
|
||||
IAnnouncementService announcementService,
|
||||
IHubContext<AuctionHub> announcementHubContext,
|
||||
AuctionService auctionService,
|
||||
ILogger logger)
|
||||
{
|
||||
_announcementService = announcementService;
|
||||
|
|
@ -97,7 +98,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Areas.Admin.Controllers
|
|||
var viewModel = new BidNotificationViewModel();
|
||||
viewModel.ProductName = "Picasso - Önarckép";
|
||||
viewModel.BidPrice = 200000;
|
||||
viewModel.NextStepAmount = 50000;
|
||||
viewModel.NextStepAmount = AuctionService.GetStepAmount(viewModel.BidPrice);
|
||||
return View("~/Plugins/Misc.AuctionPlugin/Areas/Admin/Views/BidNotification.cshtml", viewModel);
|
||||
|
||||
}
|
||||
|
|
@ -122,7 +123,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Areas.Admin.Controllers
|
|||
ProductName = viewModel.ProductName,
|
||||
CurrentPrice = viewModel.BidPrice,
|
||||
NextStepAmount = viewModel.NextStepAmount,
|
||||
NextBidPrice = viewModel.BidPrice + viewModel.NextStepAmount
|
||||
//NextBidPrice = AuctionService.GetNextBidPrice(viewModel.BidPrice, startingPrice, viewModel.NextStepAmount)
|
||||
}.ToJson()
|
||||
};
|
||||
var jsonMessage = JsonConvert.SerializeObject(bid, Formatting.Indented,
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class AuctionPublicViewComponent : NopViewComponent
|
|||
IWorkContext workContext,
|
||||
IStoreContext storeContext,
|
||||
ICurrencyService currencyService,
|
||||
AuctionService auctionService,
|
||||
AuctionService auctionService,
|
||||
//AuctionSettings auctionSettings,
|
||||
ICustomerService customerService,
|
||||
IWebHelper webHelper,
|
||||
|
|
@ -198,14 +198,14 @@ public class AuctionPublicViewComponent : NopViewComponent
|
|||
productBidBoxViewModel.AuctionStatus = status;
|
||||
productBidBoxViewModel.WidgetZone = widgetZone;
|
||||
//comes in WORKINGCURRENCY
|
||||
productBidBoxViewModel.BasePrice = productDetailsModel.ProductPrice.OldPriceValue;
|
||||
productBidBoxViewModel.BasePrice = productToAuction.StartingPrice;
|
||||
//comes in WORKINGCURRENCY
|
||||
productBidBoxViewModel.CurrentPrice = productDetailsModel.ProductPrice.PriceValue;
|
||||
productBidBoxViewModel.CurrentPrice = productToAuction.CurrentPrice;
|
||||
//productBidBoxViewModel.ProductToAuctionId = productToAuctionId.FirstOrDefault().Id;
|
||||
//productBidBoxViewModel.AuctionId = auctionId;
|
||||
productBidBoxViewModel.CustomerId = customer.Id;
|
||||
productBidBoxViewModel.WorkingCurrency = currency;
|
||||
productBidBoxViewModel.ProductId = productDetailsModel.Id;
|
||||
productBidBoxViewModel.ProductId = productToAuction.ProductId;
|
||||
//productBidBoxViewModel.NextProductUrl = Url.RouteUrl("Product", productDetailsModel.SeName);
|
||||
productBidBoxViewModel.NextProductUrl = nextUrl;
|
||||
productBidBoxViewModel.LastProductUrl = lastUrl;
|
||||
|
|
@ -216,9 +216,9 @@ public class AuctionPublicViewComponent : NopViewComponent
|
|||
//comes in HUF
|
||||
productBidBoxViewModel.LicitStep = AuctionService.GetStepAmount(productToAuction.CurrentPrice); //add calculation
|
||||
//comes IN HUF
|
||||
productBidBoxViewModel.LicitStepInWorkingCurrency = AuctionService.GetStepAmount(productToAuction.CurrentPrice) * currency.Rate;
|
||||
productBidBoxViewModel.LicitStepInWorkingCurrency = productBidBoxViewModel.LicitStep * currency.Rate;
|
||||
//comes in HUF
|
||||
productBidBoxViewModel.NextBidPrice = AuctionService.GetNextBidPrice(productToAuction.CurrentPrice, productBidBoxViewModel.LicitStep);
|
||||
productBidBoxViewModel.NextBidPrice = AuctionService.GetNextBidPrice(productToAuction.CurrentPrice, productBidBoxViewModel.LicitStep, productToAuction.BidsCount > 0);
|
||||
productBidBoxViewModel.NextBidPriceInWorkingCurrency = productBidBoxViewModel.NextBidPrice * currency.Rate;
|
||||
if(productBidBoxViewModel.BasePrice != null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ using Nop.Data;
|
|||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Enums;
|
||||
using Nop.Plugin.Misc.AuctionPlugin.Hubs;
|
||||
using Nop.Plugin.Misc.AuctionPlugin.Services;
|
||||
using Nop.Services.Events;
|
||||
using Nop.Services.Logging;
|
||||
|
||||
|
|
@ -44,6 +45,16 @@ public class ProductToAuctionDbTable : MgDbTableBase<ProductToAuctionMapping>
|
|||
(!activeProductOnly || x.AuctionStatus == AuctionStatus.Active || x.AuctionStatus == AuctionStatus.FirstWarning || x.AuctionStatus == AuctionStatus.SecondWarning /*HasActiveAuctionStatus(x.AuctionStatus)*/));
|
||||
}
|
||||
|
||||
public IQueryable<ProductToAuctionMapping> GetNotClosedItemsByAuctionId(int auctionId)
|
||||
{
|
||||
return Table.Where(x => x.AuctionId == auctionId && x.AuctionStatus != AuctionStatus.Sold && x.AuctionStatus != AuctionStatus.NotSold);
|
||||
}
|
||||
|
||||
public Task<ProductToAuctionMapping> GetNextItemByAuctionIdAsync(int auctionId)
|
||||
{
|
||||
return GetNotClosedItemsByAuctionId(auctionId).OrderBy(x => x.SortIndex).FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public async Task ResetByProductIdAsync(int productId, decimal basePrice) => await ResetAsync(await GetByProductId(productId).FirstOrDefaultAsync(), basePrice);
|
||||
public async Task ResetByIdAsync(int productToAuctionId, decimal basePrice) => await ResetAsync(await GetByIdAsync(productToAuctionId), basePrice);
|
||||
public async Task ResetAsync(ProductToAuctionMapping productToAuction, decimal basePrice)
|
||||
|
|
@ -63,6 +74,8 @@ public class ProductToAuctionDbTable : MgDbTableBase<ProductToAuctionMapping>
|
|||
productToAuction.OrderItemId = 0;
|
||||
productToAuction.OrderId = 0;
|
||||
productToAuction.AuctionStatus = AuctionStatus.None;
|
||||
productToAuction.BiddingNumber = null;
|
||||
productToAuction.BidsCount = 0;
|
||||
|
||||
await UpdateAsync(productToAuction);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,4 +18,6 @@ public interface IProductToAuctionDtoBase : IMgModelDtoBase
|
|||
public int ProductAmount { get; set; }
|
||||
|
||||
public int SortIndex { get; set; }
|
||||
public int? BiddingNumber { get; set; }
|
||||
public int BidsCount { get; set; }
|
||||
}
|
||||
|
|
@ -18,6 +18,8 @@ public class ProductToAuctionDto : IProductToAuctionDto
|
|||
public decimal CurrentPrice { get; set; }
|
||||
public int ProductAmount { get; set; }
|
||||
public int SortIndex { get; set; }
|
||||
public int? BiddingNumber { get; set; }
|
||||
public int BidsCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// EGYELŐRE NE HASZNÁLD!!! - J.
|
||||
|
|
@ -28,7 +30,7 @@ public class ProductToAuctionDto : IProductToAuctionDto
|
|||
|
||||
public bool IsActiveItem => AuctionStatus is AuctionStatus.Active or AuctionStatus.FirstWarning or AuctionStatus.SecondWarning;
|
||||
|
||||
public decimal BidPrice { get; set; }
|
||||
//public decimal BidPrice { get; set; } //TODO: ez mire kell? - J.
|
||||
|
||||
public ProductToAuctionDto()
|
||||
{
|
||||
|
|
@ -60,6 +62,8 @@ public class ProductToAuctionDto : IProductToAuctionDto
|
|||
ProductAmount = productToAuction.ProductAmount;
|
||||
SortIndex = productToAuction.SortIndex;
|
||||
WinnerCustomerId = productToAuction.WinnerCustomerId;
|
||||
BidsCount = productToAuction.BidsCount;
|
||||
BiddingNumber = productToAuction.BiddingNumber;
|
||||
}
|
||||
|
||||
public ProductToAuctionMapping CreateMainEntity()
|
||||
|
|
@ -75,6 +79,8 @@ public class ProductToAuctionDto : IProductToAuctionDto
|
|||
mainEntity.ProductAmount = ProductAmount;
|
||||
mainEntity.SortIndex = SortIndex;
|
||||
mainEntity.WinnerCustomerId = WinnerCustomerId;
|
||||
mainEntity.BidsCount = BidsCount;
|
||||
mainEntity.BiddingNumber = BiddingNumber;
|
||||
|
||||
return mainEntity;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Domains.Entities.Interfaces;
|
|||
|
||||
public interface IProductToAuctionMapping : IProductToAuctionDtoBase, ITimeStampInfo //, ISoftRemoveEntityInt
|
||||
{
|
||||
public int? BiddingNumber { get; set; }
|
||||
|
||||
public int OrderId { get; set; }
|
||||
public int OrderId { get; set; }
|
||||
public int OrderItemId { get; set; }
|
||||
}
|
||||
|
|
@ -18,6 +18,7 @@ public partial class ProductToAuctionMapping : MgEntityBase, IProductToAuctionMa
|
|||
public int OrderItemId { get; set; }
|
||||
public int WinnerCustomerId { get; set; }
|
||||
public int? BiddingNumber { get; set; }
|
||||
public int BidsCount { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
[NotColumn]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
namespace Nop.Plugin.Misc.AuctionPlugin.Domains.Enums;
|
||||
|
||||
public enum AuctionRequestMode : byte
|
||||
{
|
||||
Normal = 0,
|
||||
Edit = 5
|
||||
}
|
||||
|
|
@ -48,6 +48,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Hubs
|
|||
return;
|
||||
}
|
||||
|
||||
//TODO: az összes request-et egy base-ből származtatni és beletenni az AuctionRequestMode-ot! - J.
|
||||
using (_handleMessageMutex.UseWaitOne())
|
||||
{
|
||||
try
|
||||
|
|
@ -110,7 +111,11 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Hubs
|
|||
var revertLastBid = await auctionService.RevertAuctionBidByProductToAuctionIdAsync(productToAuction.Id);
|
||||
|
||||
if (revertLastBid == null) await ResetProductToAuction(productToAuction);
|
||||
else await SetAuctionBidPrice(revertLastBid.BidPrice, productToAuction, product, revertLastBid.CustomerId);
|
||||
else
|
||||
{
|
||||
productToAuction.BidsCount = await auctionService.GetBidsCountByProductToAuctionIdAsync(productToAuction.Id);
|
||||
await SetAuctionBidPrice(revertLastBid.BidPrice, productToAuction, product, revertLastBid.CustomerId);
|
||||
}
|
||||
|
||||
await SendAuctionBidMessageAsync(productToAuction, product, customer.Id);
|
||||
}
|
||||
|
|
@ -206,13 +211,12 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Hubs
|
|||
SenderId = customer.Id,
|
||||
Data = new ProductToAuctionStatusNotification(await auctionService.GetAuctionDtoByProductToAuctionIdAsync(productToAuction.Id, true), bidsCount, "EMPTY").ToJson()
|
||||
};
|
||||
|
||||
|
||||
await hubContext.Clients.All.SendAsync("send", productToauctionChangedNotification.ToJson());
|
||||
|
||||
//if (productToAuction.AuctionStatus is AuctionStatus.FirstWarning or AuctionStatus.SecondWarning or AuctionStatus.Pause) return;
|
||||
|
||||
//var isFeaturedProduct = productToAuction.IsActiveItem || productToAuction.AuctionStatus == AuctionStatus.Pause;
|
||||
//await UpdateProductCategoryIsFeaturedAsync(isFeaturedProduct, auction.CategoryId, productToAuction.ProductId);
|
||||
//TODO: gond van ha az Admin valamit módosít és újrazár egy régi ProductToAuction-t!!!! AuctionRequestMode.Normal...- J.
|
||||
if (/*AuctionRequestMode.Normal &&*/ auction.AuctionType == AuctionType.AutomaticNext && productToAuction.AuctionStatus is AuctionStatus.Sold or AuctionStatus.NotSold)
|
||||
await StepNextProductToAuctionAsync(customer, productToAuction, auctionProductStatusRequest);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -220,6 +224,25 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Hubs
|
|||
}
|
||||
}
|
||||
|
||||
private async Task StepNextProductToAuctionAsync(Customer customer, ProductToAuctionMapping productToAuction, AuctionProductStatusRequest auctionProductStatusRequest)
|
||||
{
|
||||
var nextProductToAuction = await auctionService.GetNextProductToAuctionByAuctionIdAsync(productToAuction.AuctionId);
|
||||
if (nextProductToAuction == null) return;
|
||||
|
||||
await logger.InformationAsync($"SignalRMessageHandler.StepNextProductToAuctionAsync(); NextProductToAuctionId: {nextProductToAuction.Id};", null, customer);
|
||||
|
||||
if (nextProductToAuction.AuctionStatus != AuctionStatus.None)
|
||||
{
|
||||
await logger.WarningAsync($"SignalRMessageHandler.StepNextProductToAuctionAsync(); (nextProductToAuction.AuctionStatus != AuctionStatus.None); NextProductToAuctionId: {nextProductToAuction.Id}; Status: {nextProductToAuction.AuctionStatus}({(int)nextProductToAuction.AuctionStatus})", null, customer);
|
||||
return; //TODO: Ilyenkor mi legyen?! - J.
|
||||
}
|
||||
|
||||
auctionProductStatusRequest.AuctionStatus = AuctionStatus.Active;
|
||||
auctionProductStatusRequest.ProductToAuctionId = nextProductToAuction.Id;
|
||||
|
||||
await HandleProductToAuctionStatusChangedRequest(customer, auctionProductStatusRequest);
|
||||
}
|
||||
|
||||
private async Task HandleBidRequest(Customer customer, AuctionBidRequest bidRequestMessage)
|
||||
{
|
||||
if (bidRequestMessage == null)
|
||||
|
|
@ -249,12 +272,13 @@ 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(activeProductAuction.CurrentPrice, bidRequestMessage.BidPrice, activeProductAuction.BidsCount > 0, customer)) return;
|
||||
|
||||
var auctionBid = bidRequestMessage.CreateMainEntity();
|
||||
auctionBid.ProductAuctionMappingId = activeProductAuction.Id;
|
||||
|
||||
await auctionService.InsertBidAsync(auctionBid);
|
||||
activeProductAuction.BidsCount++;
|
||||
|
||||
activeProductAuction.AuctionStatus = AuctionStatus.Active;
|
||||
if (!await SetAuctionBidPrice(auctionBid.BidPrice, activeProductAuction, product, customer.Id)) return;
|
||||
|
|
@ -275,7 +299,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Hubs
|
|||
await productService.UpdateProductAsync(product);
|
||||
|
||||
//activeProductAuction.StartingPrice = product.OldPrice; //TODO: ez biztosan kezelve van mikor összerendeljük? - J.
|
||||
productToAuction.CurrentPrice = product.Price;
|
||||
productToAuction.CurrentPrice = bidPrice;
|
||||
productToAuction.WinnerCustomerId = lastBidCustomerId;
|
||||
await auctionService.UpdateProductToAuctionMappingAsync(productToAuction);
|
||||
|
||||
|
|
@ -291,10 +315,11 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Hubs
|
|||
|
||||
private async Task SendAuctionBidMessageAsync(ProductToAuctionMapping productToAuction, Product product, int customerId)
|
||||
{
|
||||
var stepAmount = GetStepAmount(productToAuction.CurrentPrice);
|
||||
var nextBidPrice = GetNextBidPrice(productToAuction.CurrentPrice, stepAmount);
|
||||
var bidsCount = productToAuction.BidsCount;//await auctionService.GetBidsCountByProductToAuctionIdAsync(productToAuction.Id);
|
||||
|
||||
var stepAmount = GetStepAmount(productToAuction.CurrentPrice);
|
||||
var nextBidPrice = GetNextBidPrice(productToAuction.CurrentPrice, stepAmount, bidsCount > 0);
|
||||
|
||||
var bidsCount = await auctionService.GetBidsCountByProductToAuctionIdAsync(productToAuction.Id);
|
||||
var bidMessage = new MessageWrapper
|
||||
{
|
||||
MessageType = "bidNotification",
|
||||
|
|
@ -341,20 +366,21 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Hubs
|
|||
}
|
||||
}
|
||||
|
||||
private bool IsValidBidPrice(decimal productPrice, decimal productToAuctionCurrentPrice, decimal bidRequestPrice, Customer customer = null)
|
||||
private bool IsValidBidPrice(decimal productToAuctionCurrentPrice, decimal bidRequestPrice, bool hasAuctionBidInDb, Customer customer = null)
|
||||
{
|
||||
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 false;
|
||||
}
|
||||
var nextBidPrice = GetNextBidPrice(productToAuctionCurrentPrice, hasAuctionBidInDb);
|
||||
if (bidRequestPrice != nextBidPrice)
|
||||
{
|
||||
logger.Warning($"SignalRMessageHandler.IsValidBidPrice(); (bidRequestPrice != nextBidPrice); productToAuctionCurrentPrice: {productToAuctionCurrentPrice}; bidRequestPrice: {bidRequestPrice}; hasAuctionBidInDb: {hasAuctionBidInDb}", null, customer);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
private static decimal GetStepAmount(decimal currentBidPrice) => AuctionService.GetStepAmount(currentBidPrice);
|
||||
private static decimal GetNextBidPrice(decimal currentBidPrice) => AuctionService.GetNextBidPrice(currentBidPrice, GetStepAmount(currentBidPrice));
|
||||
private static decimal GetNextBidPrice(decimal currentBidPrice, decimal stepAmount) => AuctionService.GetNextBidPrice(currentBidPrice, stepAmount);
|
||||
private static decimal GetNextBidPrice(decimal currentBidPrice, bool hasAuctionBidInDb) => GetNextBidPrice(currentBidPrice, GetStepAmount(currentBidPrice), hasAuctionBidInDb);
|
||||
private static decimal GetNextBidPrice(decimal currentBidPrice, decimal stepAmount, bool hasAuctionBidInDb) => AuctionService.GetNextBidPrice(currentBidPrice, stepAmount, hasAuctionBidInDb);
|
||||
|
||||
private static bool IsValidRequestAuctionStatus(AuctionStatus newStatus, AuctionStatus oldStatus)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -85,10 +85,13 @@ public class AuctionService(
|
|||
//200 000 000 Ft fölött 20 000 000 Ft-tal
|
||||
}
|
||||
|
||||
public static decimal GetNextBidPrice(decimal currentBidPrice) => GetNextBidPrice(currentBidPrice, GetStepAmount(currentBidPrice));
|
||||
public static decimal GetNextBidPrice(decimal currentBidPrice, decimal stepAmount)
|
||||
public async Task<decimal> GetNextBidPrice(decimal currentBidPrice, int productToAuctionId) => GetNextBidPrice(currentBidPrice, GetStepAmount(currentBidPrice), await HasBidByProductToAuctionIdAsync(productToAuctionId));
|
||||
|
||||
public static decimal GetNextBidPrice(decimal currentBidPrice, bool hasAuctionBidInDb) => GetNextBidPrice(currentBidPrice, GetStepAmount(currentBidPrice), hasAuctionBidInDb);
|
||||
|
||||
public static decimal GetNextBidPrice(decimal currentBidPrice, decimal stepAmount, bool hasAuctionBidInDb)
|
||||
{
|
||||
return currentBidPrice + stepAmount;
|
||||
return hasAuctionBidInDb ? currentBidPrice + stepAmount : currentBidPrice;
|
||||
}
|
||||
|
||||
public async Task ResetProductToAuctionByProductId(int productId)
|
||||
|
|
@ -106,6 +109,9 @@ public class AuctionService(
|
|||
public Task<int> GetBidsCountByProductToAuctionIdAsync(int productToAuctionId)
|
||||
=> ctx.GetBidsCountByProductToAuctionIdAsync(productToAuctionId);
|
||||
|
||||
public Task<bool> HasBidByProductToAuctionIdAsync(int productToAuctionId)
|
||||
=> ctx.HasBidByProductToAuctionIdAsync(productToAuctionId);
|
||||
|
||||
public Task<AuctionBid> RevertAuctionBidByProductToAuctionIdAsync(int productToAuctionId)
|
||||
=> ctx.RevertAuctionBidByProductToAuctionId(productToAuctionId);
|
||||
|
||||
|
|
@ -396,9 +402,14 @@ public class AuctionService(
|
|||
}
|
||||
|
||||
public async Task<List<ProductToAuctionMapping>> GetProductToAuctionsByAuctionIdAsync(int auctionId, bool onlyActiveItems)
|
||||
{
|
||||
return await ctx.ProductToAuctions.GetProductToAuctionsByAuctionId(auctionId, onlyActiveItems).ToListAsync();
|
||||
}
|
||||
=> await ctx.ProductToAuctions.GetProductToAuctionsByAuctionId(auctionId, onlyActiveItems).OrderBy(x => x.SortIndex).ToListAsync();
|
||||
|
||||
public Task<ProductToAuctionMapping> GetNextProductToAuctionByAuctionIdAsync(int auctionId)
|
||||
=> ctx.ProductToAuctions.GetNextItemByAuctionIdAsync(auctionId);
|
||||
|
||||
public Task<List<ProductToAuctionMapping>> GetNotClosedProductToAuctionsByAuctionId(int auctionId)
|
||||
=> ctx.ProductToAuctions.GetNotClosedItemsByAuctionId(auctionId).OrderBy(x => x.SortIndex).ToListAsync();
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ public interface IAuctionService
|
|||
Task<IPagedList<AuctionBid>> GetAllBidsAsync(int customerId = 0, int pageIndex = 0, int pageSize = int.MaxValue);
|
||||
|
||||
Task<int> GetBidsCountByProductToAuctionIdAsync(int productToAuctionId);
|
||||
Task<bool> HasBidByProductToAuctionIdAsync(int productToAuctionId);
|
||||
Task<AuctionBid> GetBidByIdAsync(int bidId);
|
||||
|
||||
Task InsertBidAsync(AuctionBid auctionBid);
|
||||
|
|
@ -44,11 +45,13 @@ public interface IAuctionService
|
|||
|
||||
Task<AuctionDto> GetAuctionDtoWithAuctionBids(int auctionId, bool activeProductOnly, int maxBidsCount);
|
||||
Task<List<ProductToAuctionMapping>> GetProductToAuctionsByAuctionIdAsync(int auctionId, bool onlyActiveItems);
|
||||
Task<ProductToAuctionMapping> GetNextProductToAuctionByAuctionIdAsync(int auctionId);
|
||||
Task<List<ProductToAuctionMapping>> GetNotClosedProductToAuctionsByAuctionId(int auctionId);
|
||||
|
||||
Task<Auction> GetAuctionByIdAsync(int auctionId);
|
||||
Task<AuctionDto> GetAuctionDtoByIdAsync(int auctionId, bool widthProducts, bool activeProductOnly);
|
||||
Task<List<ProductToAuctionDto>> GetProductToAuctionDtosByAuctionId(int auctionId, bool activeProductOnly);
|
||||
|
||||
Task<List<ProductToAuctionDto>> GetProductToAuctionDtosByProductIdAsync(int productId);
|
||||
|
||||
Task<AuctionDto> GetAuctionDtoWithProductByIdAsync(int auctionId, int productId, bool activeProductOnly);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue