Compare commits

...

2 Commits

Author SHA1 Message Date
Loretta cefb19584d product event fixex; etc... 2025-10-11 17:51:30 +02:00
Loretta 28d9122818 improvements, etc 2025-10-11 12:52:55 +02:00
5 changed files with 84 additions and 16 deletions

View File

@ -0,0 +1,29 @@
using Mango.Nop.Core.Interfaces;
using Nop.Core.Domain.Catalog;
using Nop.Core.Domain.Orders;
namespace Mango.Nop.Core.Dtos;
public abstract class MgOrderDto : ModelDtoBase<Order>, IMgOrderDto
{
public Guid OrderGuid { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public int StoreId { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public int CustomerId { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public int OrderStatusId { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public int ShippingStatusId { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public decimal OrderDiscount { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public decimal OrderTotal { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public DateTime CreatedOnUtc { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public DateTime? PaidDateUtc { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public string ShippingMethod { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public string CustomOrderNumber { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public string CustomValuesXml { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public bool Deleted { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
protected MgOrderDto() :base()
{ }
protected MgOrderDto(int orderId) : base(orderId)
{ }
protected MgOrderDto(Order order) : base(order)
{ }
}

View File

@ -5,7 +5,7 @@ using Nop.Core.Domain.Discounts;
namespace Mango.Nop.Core.Dtos;
public class ProductDto : ModelDtoBase<Product>, IProductDto//, IDiscountSupported<DiscountProductMapping>
public abstract class MgProductDto : ModelDtoBase<Product>, IMgProductDto//, IDiscountSupported<DiscountProductMapping>
{
//public int Id { get; set; }
public int ProductTypeId { get; set; }
@ -25,11 +25,11 @@ public class ProductDto : ModelDtoBase<Product>, IProductDto//, IDiscountSupport
public bool Deleted { get; set; }
public ProductDto() :base()
protected MgProductDto() :base()
{ }
public ProductDto(int productId) : base(productId)
protected MgProductDto(int productId) : base(productId)
{ }
public ProductDto(Product product) : base(product)
protected MgProductDto(Product product) : base(product)
{ }
public override void CopyDtoValuesToEntity(Product entity)

View File

@ -0,0 +1,40 @@
using AyCode.Interfaces.Entities;
using Nop.Core.Domain.Common;
namespace Mango.Nop.Core.Interfaces;
public interface IMgOrderDto : IEntityInt, ISoftDeletedEntity
{
public Guid OrderGuid { get; set; }
public int StoreId { get; set; }
public int CustomerId { get; set; }
public int OrderStatusId { get; set; }
//public OrderStatus OrderStatus
//{
// get => (OrderStatus)OrderStatusId;
// set => OrderStatusId = (int)value;
//}
public int ShippingStatusId { get; set; }
//public ShippingStatus ShippingStatus
//{
// get => (ShippingStatus)ShippingStatusId;
// set => ShippingStatusId = (int)value;
//}
public decimal OrderDiscount { get; set; }
public decimal OrderTotal { get; set; }
public DateTime CreatedOnUtc { get; set; }
public DateTime? PaidDateUtc { get; set; }
public string ShippingMethod { get; set; }
public string CustomOrderNumber { get; set; }
public string CustomValuesXml { get; set; }
public bool Deleted { get; set; }
}

View File

@ -8,7 +8,7 @@ using Nop.Core.Domain.Stores;
namespace Mango.Nop.Core.Interfaces;
public interface IProductDto : IEntityInt, ILocalizedEntity, ISlugSupported, IAclSupported, IStoreMappingSupported/*, IDiscountSupported<DiscountProductMapping>*/, ISoftDeletedEntity
public interface IMgProductDto : IEntityInt, ILocalizedEntity, ISlugSupported, IAclSupported, IStoreMappingSupported/*, IDiscountSupported<DiscountProductMapping>*/, ISoftDeletedEntity
{
int ProductTypeId { get; set; }
int ParentGroupedProductId { get; set; }

View File

@ -15,6 +15,7 @@ namespace Mango.Nop.Services;
/// </summary>
public class MgEventConsumer(IHttpContextAccessor httpContextAccessor, IEnumerable<IAcLogWriterBase> logWriters) :
IConsumer<EntityUpdatedEvent<Product>>,
IConsumer<EntityInsertedEvent<Product>>,
IConsumer<CustomerRegisteredEvent>,
IConsumer<OrderPlacedEvent>,
IConsumer<PageRenderingEvent>,
@ -26,27 +27,25 @@ public class MgEventConsumer(IHttpContextAccessor httpContextAccessor, IEnumerab
#region Fields
protected ILogger Logger { get; } = new Logger<MgEventConsumer>(logWriters.ToArray());
private readonly IHttpContextAccessor _httpContextAccessor = httpContextAccessor;
protected readonly IHttpContextAccessor HttpContextAccessor = httpContextAccessor;
#endregion
public virtual async Task HandleEventAsync(EntityUpdatedEvent<Product> eventMessage)
{
}
{ }
public virtual async Task HandleEventAsync(EntityInsertedEvent<Product> eventMessage)
{ }
public virtual async Task HandleEventAsync(CustomerRegisteredEvent eventMessage)
{
}
{ }
public virtual async Task HandleEventAsync(OrderPlacedEvent eventMessage)
{
}
{ }
public virtual async Task HandleEventAsync(PageRenderingEvent eventMessage)
{
}
{ }
public virtual async Task HandleEventAsync(ProductSearchEvent eventMessage)
{
}
{ }
}