From 28d912281830bee2113fc5c7dd3a29edc4bc9dd8 Mon Sep 17 00:00:00 2001 From: Loretta Date: Sat, 11 Oct 2025 12:52:55 +0200 Subject: [PATCH] improvements, etc --- Mango.Nop.Core/Dtos/MgOrderDto.cs | 29 ++++++++++++++ .../Dtos/{ProductDto.cs => MgProductDto.cs} | 8 ++-- Mango.Nop.Core/Interfaces/IMgOrderDto.cs | 40 +++++++++++++++++++ .../{IProductDto.cs => IMgProductDto.cs} | 2 +- 4 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 Mango.Nop.Core/Dtos/MgOrderDto.cs rename Mango.Nop.Core/Dtos/{ProductDto.cs => MgProductDto.cs} (89%) create mode 100644 Mango.Nop.Core/Interfaces/IMgOrderDto.cs rename Mango.Nop.Core/Interfaces/{IProductDto.cs => IMgProductDto.cs} (78%) diff --git a/Mango.Nop.Core/Dtos/MgOrderDto.cs b/Mango.Nop.Core/Dtos/MgOrderDto.cs new file mode 100644 index 0000000..7bb1d93 --- /dev/null +++ b/Mango.Nop.Core/Dtos/MgOrderDto.cs @@ -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, 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) + { } +} \ No newline at end of file diff --git a/Mango.Nop.Core/Dtos/ProductDto.cs b/Mango.Nop.Core/Dtos/MgProductDto.cs similarity index 89% rename from Mango.Nop.Core/Dtos/ProductDto.cs rename to Mango.Nop.Core/Dtos/MgProductDto.cs index c930c95..ef9db2f 100644 --- a/Mango.Nop.Core/Dtos/ProductDto.cs +++ b/Mango.Nop.Core/Dtos/MgProductDto.cs @@ -5,7 +5,7 @@ using Nop.Core.Domain.Discounts; namespace Mango.Nop.Core.Dtos; -public class ProductDto : ModelDtoBase, IProductDto//, IDiscountSupported +public abstract class MgProductDto : ModelDtoBase, IMgProductDto//, IDiscountSupported { //public int Id { get; set; } public int ProductTypeId { get; set; } @@ -25,11 +25,11 @@ public class ProductDto : ModelDtoBase, 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) diff --git a/Mango.Nop.Core/Interfaces/IMgOrderDto.cs b/Mango.Nop.Core/Interfaces/IMgOrderDto.cs new file mode 100644 index 0000000..7c6a76e --- /dev/null +++ b/Mango.Nop.Core/Interfaces/IMgOrderDto.cs @@ -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; } +} \ No newline at end of file diff --git a/Mango.Nop.Core/Interfaces/IProductDto.cs b/Mango.Nop.Core/Interfaces/IMgProductDto.cs similarity index 78% rename from Mango.Nop.Core/Interfaces/IProductDto.cs rename to Mango.Nop.Core/Interfaces/IMgProductDto.cs index 9036b6f..8f85a29 100644 --- a/Mango.Nop.Core/Interfaces/IProductDto.cs +++ b/Mango.Nop.Core/Interfaces/IMgProductDto.cs @@ -8,7 +8,7 @@ using Nop.Core.Domain.Stores; namespace Mango.Nop.Core.Interfaces; -public interface IProductDto : IEntityInt, ILocalizedEntity, ISlugSupported, IAclSupported, IStoreMappingSupported/*, IDiscountSupported*/, ISoftDeletedEntity +public interface IMgProductDto : IEntityInt, ILocalizedEntity, ISlugSupported, IAclSupported, IStoreMappingSupported/*, IDiscountSupported*/, ISoftDeletedEntity { int ProductTypeId { get; set; } int ParentGroupedProductId { get; set; }