Compare commits

..

2 Commits

Author SHA1 Message Date
Loretta 9777d3dd53 fix 2024-11-29 07:12:08 +01:00
Loretta 191119c427 improvements 2024-11-29 07:06:17 +01:00
5 changed files with 18 additions and 4 deletions

View File

@ -9,6 +9,7 @@ public interface IProductToAuctionDtoBase : IMgModelDtoBase
public int AuctionId { get; set; }
public int WinnerCustomerId { get; set; }
public AuctionStatus AuctionStatus { get; set; }
public decimal StartingPrice { get; set; }

View File

@ -12,6 +12,7 @@ public class ProductToAuctionDto : IProductToAuctionDto
public int ProductId { get; set; }
public int AuctionId { get; set; }
public int WinnerCustomerId { get; set; }
public AuctionStatus AuctionStatus { get; set; }
public decimal StartingPrice { get; set; }
public decimal CurrentPrice { get; set; }
@ -22,14 +23,20 @@ public class ProductToAuctionDto : IProductToAuctionDto
/// EGYELŐRE NE HASZNÁLD!!! - J.
/// </summary>
public decimal StepAmount { get; set; }
public List<AuctionBidDto> AuctionBidDtos { get; } = [];
public bool IsActiveItem => AuctionStatus is AuctionStatus.Active or AuctionStatus.FirstWarning or AuctionStatus.SecondWarning;
public decimal BidPrice { get; set; }
public ProductToAuctionDto() { }
public ProductToAuctionDto(ProductToAuctionMapping productToAuction) : this(productToAuction, 0/*AuctionService.GetStepAmount(productToAuction.BidPrice)*/) { }
public ProductToAuctionDto()
{
}
public ProductToAuctionDto(ProductToAuctionMapping productToAuction) : this(productToAuction, 0 /*AuctionService.GetStepAmount(productToAuction.BidPrice)*/)
{
}
/// <summary>
///

View File

@ -5,6 +5,8 @@ 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 Guid? OrderGuid { get; set; }
}

View File

@ -17,6 +17,7 @@ public partial class ProductToAuctionMapping : MgEntityBase, IProductToAuctionMa
public int OrderId { get; set; }
public Guid? OrderGuid { get; set; }
public int WinnerCustomerId { get; set; }
public int? BiddingNumber { get; set; }
[NotMapped]
[NotColumn]

View File

@ -15,6 +15,7 @@ using Nop.Core.Domain.Common;
using Nop.Services.Common;
using Nop.Services.Customers;
using Nop.Services.Shipping;
using NUglify.Helpers;
namespace Nop.Plugin.Misc.AuctionPlugin.Services;
@ -255,7 +256,9 @@ public class AuctionService(
CustomerId = productToAuction.WinnerCustomerId,
OrderTotal = productToAuction.CurrentPrice,
};
processPaymentRequest.CustomValues.Add("ProductToAuctionMappingId", productToAuction.Id);
processPaymentRequest.CustomValues.Add("TÉTEL: ", $"#{productToAuction.SortIndex}");
if (productToAuction.BiddingNumber != null) processPaymentRequest.CustomValues.Add("BIDNUM", $"#{productToAuction.BiddingNumber}");
processPaymentRequest.CustomValues.Add("PTAID", $"#{productToAuction.Id}");
var product = await productService.GetProductByIdAsync(productToAuction.ProductId);
product.DisableBuyButton = false; //TODO: ezt automatikusan kéne false-ra állítani, mikor Assign-oljuk a ProductToAuctionItem-hez! vagy valami hasonló... - J.