diff --git a/Mango.Nop.Core/Dtos/MgOrderDto.cs b/Mango.Nop.Core/Dtos/MgOrderDto.cs index 4f426a8..dec7292 100644 --- a/Mango.Nop.Core/Dtos/MgOrderDto.cs +++ b/Mango.Nop.Core/Dtos/MgOrderDto.cs @@ -2,12 +2,14 @@ using LinqToDB.Mapping; using Mango.Nop.Core.Entities; using Mango.Nop.Core.Interfaces; +using Newtonsoft.Json; using Nop.Core; using Nop.Core.Domain.Common; using Nop.Core.Domain.Customers; using Nop.Core.Domain.Orders; using Nop.Core.Domain.Payments; using Nop.Core.Domain.Shipping; +using System.Linq.Expressions; namespace Mango.Nop.Core.Dtos; @@ -34,6 +36,9 @@ public abstract class MgOrderDto : MgEntityBase, IMo [Association(ThisKey = nameof(Id), OtherKey = nameof(OrderItem.OrderId), CanBeNull = true)] public List OrderItemDtos { get; set; } + [Association(ThisKey = nameof(Id), OtherKey = nameof(OrderNote.OrderId), CanBeNull = true)] + public List OrderNotes { get; set; } + public OrderStatus OrderStatus { get => (OrderStatus)OrderStatusId; diff --git a/Mango.Nop.Core/Interfaces/IMgOrderDto.cs b/Mango.Nop.Core/Interfaces/IMgOrderDto.cs index 6246c8d..a834b06 100644 --- a/Mango.Nop.Core/Interfaces/IMgOrderDto.cs +++ b/Mango.Nop.Core/Interfaces/IMgOrderDto.cs @@ -34,6 +34,7 @@ public interface IMgOrderDto : IEntityInt, ISoftDele public Customer Customer { get; } //TODO: CustomerDto!!! - J. public List OrderItemDtos { get; } + public List OrderNotes { get; } void InitializeOrderItemDtos(List orderItemDtos); void CopyEntityValuesToDto(Order entity, List orderItemDtos); diff --git a/Mango.Nop.Core/NopDependencies/Catalogs/OrderNote.cs b/Mango.Nop.Core/NopDependencies/Catalogs/OrderNote.cs new file mode 100644 index 0000000..4228e77 --- /dev/null +++ b/Mango.Nop.Core/NopDependencies/Catalogs/OrderNote.cs @@ -0,0 +1,32 @@ +namespace Nop.Core.Domain.Orders; + +/// +/// Represents an order note +/// +public partial class OrderNote : BaseEntity +{ + /// + /// Gets or sets the order identifier + /// + public int OrderId { get; set; } + + /// + /// Gets or sets the note + /// + public string Note { get; set; } + + /// + /// Gets or sets the attached file (download) identifier + /// + public int DownloadId { get; set; } + + /// + /// Gets or sets a value indicating whether a customer can see a note + /// + public bool DisplayToCustomer { get; set; } + + /// + /// Gets or sets the date and time of order note creation + /// + public DateTime CreatedOnUtc { get; set; } +} \ No newline at end of file