Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
refactor(arch001): move Vendor's lighter Shipment models into AdminShared, fix _ViewImports
KrzysztofPajaka236bc50a38a
diff --git a/src/Web/Grand.Web.Vendor/Models/Shipment/ShipmentAdminCommentModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/ShipmentAdminCommentModel.cssimilarity index 53%rename from src/Web/Grand.Web.Vendor/Models/Shipment/ShipmentAdminCommentModel.csrename to src/Web/Grand.Web.AdminShared/Models/Orders/ShipmentAdminCommentModel.csindex 0d620da92..040b69f0e 100644--- a/src/Web/Grand.Web.Vendor/Models/Shipment/ShipmentAdminCommentModel.cs+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/ShipmentAdminCommentModel.cs@@ -1,3 +1,3 @@-namespace Grand.Web.Vendor.Models.Shipment;+namespace Grand.Web.AdminShared.Models.Orders;-public record ShipmentAdminCommentModel(string Id, string AdminComment);\ No newline at end of file+public record ShipmentAdminCommentModel(string Id, string AdminComment);diff --git a/src/Web/Grand.Web.Vendor/Models/Shipment/ShipmentDeliveryDateModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/ShipmentDeliveryDateModel.cssimilarity index 52%rename from src/Web/Grand.Web.Vendor/Models/Shipment/ShipmentDeliveryDateModel.csrename to src/Web/Grand.Web.AdminShared/Models/Orders/ShipmentDeliveryDateModel.csindex 32b5543ea..4dd6411a2 100644--- a/src/Web/Grand.Web.Vendor/Models/Shipment/ShipmentDeliveryDateModel.cs+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/ShipmentDeliveryDateModel.cs@@ -1,3 +1,3 @@-namespace Grand.Web.Vendor.Models.Shipment;+namespace Grand.Web.AdminShared.Models.Orders;-public record ShipmentDeliveryDateModel(string Id, DateTime? DeliveryDate);\ No newline at end of file+public record ShipmentDeliveryDateModel(string Id, DateTime? DeliveryDate);diff --git a/src/Web/Grand.Web.Vendor/Models/Shipment/ShipmentShippedDateModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/ShipmentShippedDateModel.cssimilarity index 53%rename from src/Web/Grand.Web.Vendor/Models/Shipment/ShipmentShippedDateModel.csrename to src/Web/Grand.Web.AdminShared/Models/Orders/ShipmentShippedDateModel.csindex 041d6888c..cb8328436 100644--- a/src/Web/Grand.Web.Vendor/Models/Shipment/ShipmentShippedDateModel.cs+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/ShipmentShippedDateModel.cs@@ -1,3 +1,3 @@-namespace Grand.Web.Vendor.Models.Shipment;+namespace Grand.Web.AdminShared.Models.Orders;-public record ShipmentShippedDateModel(string Id, DateTime? ShippedDate);\ No newline at end of file+public record ShipmentShippedDateModel(string Id, DateTime? ShippedDate);diff --git a/src/Web/Grand.Web.Vendor/Models/Shipment/ShipmentTrackingModel.cs b/src/Web/Grand.Web.AdminShared/Models/Orders/ShipmentTrackingModel.cssimilarity index 54%rename from src/Web/Grand.Web.Vendor/Models/Shipment/ShipmentTrackingModel.csrename to src/Web/Grand.Web.AdminShared/Models/Orders/ShipmentTrackingModel.csindex a29d76995..6641075cc 100644--- a/src/Web/Grand.Web.Vendor/Models/Shipment/ShipmentTrackingModel.cs+++ b/src/Web/Grand.Web.AdminShared/Models/Orders/ShipmentTrackingModel.cs@@ -1,3 +1,3 @@-namespace Grand.Web.Vendor.Models.Shipment;+namespace Grand.Web.AdminShared.Models.Orders;-public record ShipmentTrackingModel(string Id, string TrackingNumber);\ No newline at end of file+public record ShipmentTrackingModel(string Id, string TrackingNumber);diff --git a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/_ViewImports.cshtml b/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/_ViewImports.cshtmlindex 7459fba57..65a6de0cc 100644--- a/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/_ViewImports.cshtml+++ b/src/Web/Grand.Web.Vendor/Areas/Vendor/Views/_ViewImports.cshtml@@ -30,17 +30,23 @@Grand.Web.Vendor.Models.Catalog's own ProductModel etc. are no longer used by any controller/viewand importing both would make bare "ProductModel" ambiguous. *@@using Grand.Web.AdminShared.Models.Catalog;-@* Order views bind to Grand.Web.AdminShared's OrderModel/OrderListModel (ARCH-001 Phase 5 Order- consolidation) - Grand.Web.Vendor.Models.Orders's own OrderModel/OrderListModel are no longer- used by any controller/view. Unlike the ProductModel case above, this can't be a blanket- "@using Grand.Web.AdminShared.Models.Orders" - that namespace also holds ShipmentModel,- MerchandiseReturnModel, *ReportModel etc., which Vendor's Shipment/MerchandiseReturn/Reports- views still bind to their own Grand.Web.Vendor.Models.* equivalents (not yet consolidated), so- a wildcard import here would make those bare names ambiguous instead. Alias just the two types- that are actually consolidated. *@+@* Order and Shipment views bind to Grand.Web.AdminShared's Order/Shipment model families+ (ARCH-001 Phase 5 Order, Phase 6 Shipment consolidation) - Grand.Web.Vendor.Models.Orders's own+ OrderModel/OrderListModel and Grand.Web.Vendor.Models.Shipment (the whole namespace) are no+ longer used by any controller/view. This can't be a blanket+ "@using Grand.Web.AdminShared.Models.Orders" - that namespace also holds MerchandiseReturnModel/+ *ReportModel etc., which Vendor's MerchandiseReturn/Reports views still bind to their own+ Grand.Web.Vendor.Models.* equivalents (not yet consolidated), so a wildcard import here would+ make those bare names ambiguous instead. Alias just the types that are actually consolidated. *@@using OrderModel = Grand.Web.AdminShared.Models.Orders.OrderModel;@using OrderListModel = Grand.Web.AdminShared.Models.Orders.OrderListModel;-@using Grand.Web.Vendor.Models.Shipment;+@using ShipmentModel = Grand.Web.AdminShared.Models.Orders.ShipmentModel;+@using ShipmentListModel = Grand.Web.AdminShared.Models.Orders.ShipmentListModel;+@using AddShipmentModel = Grand.Web.AdminShared.Models.Orders.AddShipmentModel;+@using ShipmentTrackingModel = Grand.Web.AdminShared.Models.Orders.ShipmentTrackingModel;+@using ShipmentAdminCommentModel = Grand.Web.AdminShared.Models.Orders.ShipmentAdminCommentModel;+@using ShipmentDeliveryDateModel = Grand.Web.AdminShared.Models.Orders.ShipmentDeliveryDateModel;+@using ShipmentShippedDateModel = Grand.Web.AdminShared.Models.Orders.ShipmentShippedDateModel;@using Grand.Web.Vendor.Models.MerchandiseReturn;@using Grand.Web.Vendor.Models.Vendor;@using Grand.Web.Vendor.Models.VendorReview;diff --git a/src/Web/Grand.Web.Vendor/Models/Shipment/AddShipmentModel.cs b/src/Web/Grand.Web.Vendor/Models/Shipment/AddShipmentModel.csdeleted file mode 100644index 53aeee068..000000000--- a/src/Web/Grand.Web.Vendor/Models/Shipment/AddShipmentModel.cs+++ /dev/null@@ -1,19 +0,0 @@-using Grand.Infrastructure.Validators;-namespace Grand.Web.Vendor.Models.Shipment;--public class AddShipmentModel-{- public string OrderId { get; set; }- public string TrackingNumber { get; set; }- [NoHtml]- public string AdminComment { get; set; }-- public IList<ShipmentItemModel> Items { get; set; } = new List<ShipmentItemModel>();-- public class ShipmentItemModel- {- public string OrderItemId { get; set; }- public int QuantityToAdd { get; set; }- public string WarehouseId { get; set; }- }-}\ No newline at end of filediff --git a/src/Web/Grand.Web.Vendor/Models/Shipment/ShipmentListModel.cs b/src/Web/Grand.Web.Vendor/Models/Shipment/ShipmentListModel.csdeleted file mode 100644index b99871d9d..000000000--- a/src/Web/Grand.Web.Vendor/Models/Shipment/ShipmentListModel.cs+++ /dev/null@@ -1,35 +0,0 @@-using Grand.Infrastructure.ModelBinding;-using Grand.Infrastructure.Models;-using Microsoft.AspNetCore.Mvc.Rendering;-using System.ComponentModel.DataAnnotations;--namespace Grand.Web.Vendor.Models.Shipment;--public class ShipmentListModel : BaseModel-{- [GrandResourceDisplayName("Vendor.Orders.Shipments.List.StartDate")]- [UIHint("DateNullable")]- public DateTime? StartDate { get; set; }-- [GrandResourceDisplayName("Vendor.Orders.Shipments.List.EndDate")]- [UIHint("DateNullable")]- public DateTime? EndDate { get; set; }-- [GrandResourceDisplayName("Vendor.Orders.Shipments.List.TrackingNumber")]-- public string TrackingNumber { get; set; }--- [GrandResourceDisplayName("Vendor.Orders.Shipments.List.City")]-- public string City { get; set; }-- [GrandResourceDisplayName("Vendor.Orders.Shipments.List.LoadNotShipped")]- public bool LoadNotShipped { get; set; }--- [GrandResourceDisplayName("Vendor.Orders.Shipments.List.Warehouse")]- public string WarehouseId { get; set; }-- public IList<SelectListItem> AvailableWarehouses { get; set; } = new List<SelectListItem>();-}\ No newline at end of filediff --git a/src/Web/Grand.Web.Vendor/Models/Shipment/ShipmentModel.cs b/src/Web/Grand.Web.Vendor/Models/Shipment/ShipmentModel.csdeleted file mode 100644index 837a37be7..000000000--- a/src/Web/Grand.Web.Vendor/Models/Shipment/ShipmentModel.cs+++ /dev/null@@ -1,134 +0,0 @@-using Grand.Infrastructure.ModelBinding;-using Grand.Infrastructure.Models;-using Grand.Infrastructure.Validators;--namespace Grand.Web.Vendor.Models.Shipment;--public class ShipmentModel : BaseEntityModel-{- [GrandResourceDisplayName("Vendor.Orders.Shipments.ID")]- public override string Id { get; set; }-- public int ShipmentNumber { get; set; }-- [GrandResourceDisplayName("Vendor.Orders.Shipments.OrderID")]- public string OrderId { get; set; }-- public int OrderNumber { get; set; }- public string OrderCode { get; set; }-- [GrandResourceDisplayName("Vendor.Orders.Shipments.TotalWeight")]- public string TotalWeight { get; set; }-- [GrandResourceDisplayName("Vendor.Orders.Shipments.TrackingNumber")]- public string TrackingNumber { get; set; }-- public string TrackingNumberUrl { get; set; }-- [GrandResourceDisplayName("Vendor.Orders.Shipments.ShippedDate")]- public DateTime? ShippedDate { get; set; }-- public bool CanShip { get; set; }- public DateTime? ShippedDateUtc { get; set; }-- [GrandResourceDisplayName("Vendor.Orders.Shipments.DeliveryDate")]- public DateTime? DeliveryDate { get; set; }-- public bool CanDeliver { get; set; }- public DateTime? DeliveryDateUtc { get; set; }-- [NoHtml]- [GrandResourceDisplayName("Vendor.Orders.Shipments.AdminComment")]- public string AdminComment { get; set; }-- public List<ShipmentItemModel> Items { get; set; } = new();-- public IList<ShipmentStatusEventModel> ShipmentStatusEvents { get; set; } = new List<ShipmentStatusEventModel>();-- //shipment notes- [GrandResourceDisplayName("Vendor.Orders.Shipments.ShipmentNotes.Fields.DisplayToCustomer")]- public bool AddShipmentNoteDisplayToCustomer { get; set; }-- [GrandResourceDisplayName("Vendor.Orders.Shipments.ShipmentNotes.Fields.Note")]- [NoHtml]- public string AddShipmentNoteMessage { get; set; }--- #region Nested classes-- public class ShipmentItemModel : BaseEntityModel- {- public string OrderItemId { get; set; }- public string ProductId { get; set; }-- [GrandResourceDisplayName("Vendor.Orders.Shipments.Products.ProductName")]- public string ProductName { get; set; }-- public string Sku { get; set; }- public string AttributeInfo { get; set; }- public string RentalInfo { get; set; }- public bool ShipSeparately { get; set; }-- //weight of one item (product)- [GrandResourceDisplayName("Vendor.Orders.Shipments.Products.ItemWeight")]- public string ItemWeight { get; set; }-- [GrandResourceDisplayName("Vendor.Orders.Shipments.Products.ItemDimensions")]- public string ItemDimensions { get; set; }-- public int QuantityToAdd { get; set; }- public int QuantityOrdered { get; set; }-- [GrandResourceDisplayName("Vendor.Orders.Shipments.Products.QtyShipped")]- public int QuantityInThisShipment { get; set; }-- public int QuantityInAllShipments { get; set; }-- public string ShippedFromWarehouse { get; set; }-- public bool AllowToChooseWarehouse { get; set; }-- //used before a shipment is created- public List<WarehouseInfo> AvailableWarehouses { get; set; } = new();- public string WarehouseId { get; set; }-- #region Nested Classes-- public class WarehouseInfo : BaseModel- {- public string WarehouseId { get; set; }- public string WarehouseCode { get; set; }- public string WarehouseName { get; set; }- public int StockQuantity { get; set; }- public int ReservedQuantity { get; set; }- }-- #endregion- }-- public class ShipmentNote : BaseEntityModel- {- public string ShipmentId { get; set; }-- [GrandResourceDisplayName("Vendor.Orders.Shipments.ShipmentNotes.Fields.DisplayToCustomer")]- public bool DisplayToCustomer { get; set; }-- [GrandResourceDisplayName("Vendor.Orders.Shipments.ShipmentNotes.Fields.Note")]- public string Note { get; set; }-- [GrandResourceDisplayName("Vendor.Orders.Shipments.ShipmentNotes.Fields.CreatedOn")]- public DateTime CreatedOn { get; set; }-- [GrandResourceDisplayName("Vendor.Orders.Shipments.ShipmentNotes.Fields.CreatedByCustomer")]- public bool CreatedByCustomer { get; set; }- }-- public class ShipmentStatusEventModel : BaseModel- {- public string EventName { get; set; }- public string Location { get; set; }- public DateTime? Date { get; set; }- }-- #endregion-}\ No newline at end of file