Add ShippingController to Grand.Web.Store and StoreId support to Admin Shipping for delivery dates, warehouses, pickup points, shipping methods, and restrictions#702
Conversation
…ses, and pickup points per store Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/6f46e96f-0a47-461a-b122-306c82c07139 Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/6f46e96f-0a47-461a-b122-306c82c07139 Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
…add storeId filter to GetAllWarehouses/GetAllDeliveryDates Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/7619c4f6-ba72-4fd8-94d2-76228b83d336 Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
…oller pickup points section Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/7619c4f6-ba72-4fd8-94d2-76228b83d336 Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
…up point in Store area; store owners see only their own data Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/3cbffee5-4776-46b3-9e36-9f2c6fb8a13c Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
…ix WarehouseId validation span in pickup point partial Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/3cbffee5-4776-46b3-9e36-9f2c6fb8a13c Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
|
@copilot remove cache from: |
Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Done — cache removed from |
|
…ore ToList; add pagination to all three GetAll methods Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Done in
|
|
@copilot Grand.Web.Admin - Add support for StoreId to Warehouse/DeliveryDate/PickupPoint in Shipping |
…ing views Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Done in the latest commit. Here's what was changed:
|
… LINQ best practices Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Done. Cache removed from |
…tro' of https://github.com/grandnode/grandnode2 into copilot/add-delivery-dates-warehouses-pickup-points-contro
There was a problem hiding this comment.
Pull request overview
This PR adds store-scoped shipping management (CRUD + settings/providers) to the Store area and extends Admin shipping management with StoreId support so shipping entities can be isolated per store (with optional global/shared records).
Changes:
- Added a Store-area
ShippingControllerand Razor views for managing warehouses, delivery dates, pickup points, shipping methods, plus per-store shipping settings and provider activation. - Extended shipping domain/models and service APIs to support
StoreIdfiltering and paging (IPagedList<T>), and updated consumers/tests accordingly. - Updated Admin shipping UI to display/store
StoreId(dropdown + “Store” column), and adjusted installer sitemap permissions.
Reviewed changes
Copilot reviewed 49 out of 50 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Web/Grand.Web.Store/Controllers/ShippingController.cs | New Store-area controller for shipping CRUD, provider toggles, and per-store settings. |
| src/Web/Grand.Web.Store/Controllers/ProductController.cs | Sets StoreId during product creation via object initializer. |
| src/Web/Grand.Web.Store/Controllers/HomeController.cs | Adds store-area GetStatesByCountryId endpoint (parity with Admin/Vendor). |
| src/Web/Grand.Web.Store/Areas/Store/Views/Shipping/Warehouses.cshtml | Store-area warehouses list grid. |
| src/Web/Grand.Web.Store/Areas/Store/Views/Shipping/Settings.cshtml | Store-scoped shipping settings UI. |
| src/Web/Grand.Web.Store/Areas/Store/Views/Shipping/Providers.cshtml | Store-scoped shipping provider activation grid. |
| src/Web/Grand.Web.Store/Areas/Store/Views/Shipping/PickupPoints.cshtml | Store-area pickup points list grid. |
| src/Web/Grand.Web.Store/Areas/Store/Views/Shipping/Partials/CreateOrUpdateWarehouse.cshtml | Store-area warehouse create/edit partial. |
| src/Web/Grand.Web.Store/Areas/Store/Views/Shipping/Partials/CreateOrUpdatePickupPoint.cshtml | Store-area pickup point create/edit partial. |
| src/Web/Grand.Web.Store/Areas/Store/Views/Shipping/Partials/CreateOrUpdateMethod.cshtml | Store-area shipping method create/edit partial (localized). |
| src/Web/Grand.Web.Store/Areas/Store/Views/Shipping/Partials/CreateOrUpdateDeliveryDate.cshtml | Store-area delivery date create/edit partial (localized). |
| src/Web/Grand.Web.Store/Areas/Store/Views/Shipping/Methods.cshtml | Store-area shipping methods list grid. |
| src/Web/Grand.Web.Store/Areas/Store/Views/Shipping/EditWarehouse.cshtml | Store-area warehouse edit page. |
| src/Web/Grand.Web.Store/Areas/Store/Views/Shipping/EditPickupPoint.cshtml | Store-area pickup point edit page. |
| src/Web/Grand.Web.Store/Areas/Store/Views/Shipping/EditMethod.cshtml | Store-area shipping method edit page. |
| src/Web/Grand.Web.Store/Areas/Store/Views/Shipping/EditDeliveryDate.cshtml | Store-area delivery date edit page. |
| src/Web/Grand.Web.Store/Areas/Store/Views/Shipping/DeliveryDates.cshtml | Store-area delivery dates list grid. |
| src/Web/Grand.Web.Store/Areas/Store/Views/Shipping/CreateWarehouse.cshtml | Store-area warehouse create page. |
| src/Web/Grand.Web.Store/Areas/Store/Views/Shipping/CreatePickupPoint.cshtml | Store-area pickup point create page. |
| src/Web/Grand.Web.Store/Areas/Store/Views/Shipping/CreateMethod.cshtml | Store-area shipping method create page. |
| src/Web/Grand.Web.Store/Areas/Store/Views/Shipping/CreateDeliveryDate.cshtml | Store-area delivery date create page. |
| src/Web/Grand.Web.Store/Areas/Store/Views/Setting/Partials/GeneralCommon.TabStoreInformationSettings.cshtml | Removes “premium themes” remote JSON loading block. |
| src/Web/Grand.Web.Store/Areas/Store/Views/_ViewImports.cshtml | Imports AdminShared Shipping models into Store-area views. |
| src/Web/Grand.Web.AdminShared/Services/ProductViewModelService.cs | Updates delivery date/warehouse retrieval to use store-scoped service signatures. |
| src/Web/Grand.Web.AdminShared/Models/Shipping/WarehouseModel.cs | Adds store fields (StoreId, StoreName, AvailableStores). |
| src/Web/Grand.Web.AdminShared/Models/Shipping/ShippingMethodModel.cs | Adds store fields (StoreId, AvailableStores). |
| src/Web/Grand.Web.AdminShared/Models/Shipping/PickupPointModel.cs | Adds StoreName for admin grid display. |
| src/Web/Grand.Web.AdminShared/Models/Shipping/DeliveryDateModel.cs | Adds store fields (StoreId, StoreName, AvailableStores). |
| src/Web/Grand.Web.AdminShared/Mapper/ShippingMethodProfile.cs | Updates mappings to ignore store dropdown + restricted groups. |
| src/Web/Grand.Web.Admin/Controllers/ShippingController.cs | Adds store dropdown preparation + store name in list grids. |
| src/Web/Grand.Web.Admin/Areas/Admin/Views/Shipping/Warehouses.cshtml | Adds “Store” column in admin warehouses grid. |
| src/Web/Grand.Web.Admin/Areas/Admin/Views/Shipping/PickupPoints.cshtml | Adds “Store” column in admin pickup points grid. |
| src/Web/Grand.Web.Admin/Areas/Admin/Views/Shipping/Partials/CreateOrUpdateWarehouse.cshtml | Adds store selector to admin warehouse edit/create partial. |
| src/Web/Grand.Web.Admin/Areas/Admin/Views/Shipping/Partials/CreateOrUpdateMethod.cshtml | Adds store selector to admin shipping method edit/create partial. |
| src/Web/Grand.Web.Admin/Areas/Admin/Views/Shipping/Partials/CreateOrUpdateDeliveryDate.cshtml | Adds store selector to admin delivery date edit/create partial. |
| src/Web/Grand.Web.Admin/Areas/Admin/Views/Shipping/DeliveryDates.cshtml | Adds “Store” column in admin delivery dates grid. |
| src/Tests/Grand.Business.Catalog.Tests/Services/ExportImport/ProductImportDataObjectTests.cs | Updates mocks to new paged store-scoped service signatures. |
| src/Modules/Grand.Module.Installer/Utilities/StandardAdminSiteMap.cs | Adjusts admin sitemap permissions for restrictions nodes. |
| src/Core/Grand.Domain/Shipping/Warehouse.cs | Adds StoreId to warehouse domain entity. |
| src/Core/Grand.Domain/Shipping/ShippingMethod.cs | Adds StoreId to shipping method domain entity. |
| src/Core/Grand.Domain/Shipping/DeliveryDate.cs | Adds StoreId to delivery date domain entity. |
| src/Business/Grand.Business.Core/Interfaces/Checkout/Shipping/IWarehouseService.cs | Updates GetAllWarehouses to store-scoped paged signature. |
| src/Business/Grand.Business.Core/Interfaces/Checkout/Shipping/IShippingMethodService.cs | Adds storeId parameter to GetAllShippingMethods. |
| src/Business/Grand.Business.Core/Interfaces/Checkout/Shipping/IPickupPointService.cs | Updates GetAllPickupPoints to store-scoped paged signature. |
| src/Business/Grand.Business.Core/Interfaces/Checkout/Shipping/IDeliveryDateService.cs | Updates GetAllDeliveryDates to store-scoped paged signature. |
| src/Business/Grand.Business.Checkout/Services/Shipping/WarehouseService.cs | Implements store filtering + paging (cache removed). |
| src/Business/Grand.Business.Checkout/Services/Shipping/ShippingMethodService.cs | Adds store filtering (cache removed) and keeps in-memory restrictions filtering. |
| src/Business/Grand.Business.Checkout/Services/Shipping/PickupPointService.cs | Implements store filtering + paging (cache removed). |
| src/Business/Grand.Business.Checkout/Services/Shipping/DeliveryDateService.cs | Implements store filtering + paging (cache removed). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot Grand.Web.Admin - shipping methods, list, add new column storeName |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
… Admin and Store Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
…ricted helpers in Store Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Done.
Done. Changes in the latest commits: Admin (
Store (
|
|
@copilot Grand.Web.Store - add Shipping Restrictions but only for the shipping method from Store owner |
Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Done. Both |
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…tro' of https://github.com/grandnode/grandnode2 into copilot/add-delivery-dates-warehouses-pickup-points-contro
Adds full CRUD support for warehouses, delivery dates, pickup points, and shipping methods in
Grand.Web.Store, with store-owner data isolation so each store owner only sees and manages their own records. Also addsStoreIdsupport to the existingGrand.Web.Adminshipping management for all four entities. Adds shipping settings, provider management, and shipping restrictions toGrand.Web.Store, all scoped to the current store.Service Layer Changes
IDeliveryDateService.GetAllDeliveryDates,IWarehouseService.GetAllWarehouses, andIPickupPointService.GetAllPickupPointsupdated withstoreIdparameter,pageIndex/pageSizepagination parameters, andIPagedList<T>return typeGetAll*methods — each now queries the repository directly with filtering applied to theIQueryablebefore pagination (no in-memory filtering)PagedList<T>.Create(query, pageIndex, pageSize)following the existingShipmentServicepatternIShippingMethodService.GetAllShippingMethods; the method now queries the repository directly, applies thestoreIdfilter on theIQueryablebefore materialization, and performs country/customer-group restriction filters in-memory after fetchingController & Views (Grand.Web.Store)
ShippingControllerwith full CRUD (list, create, edit, delete) for warehouses, delivery dates, pickup points, and shipping methodsSettings()GET and POST actions added to the StoreShippingController, loading and savingShippingSettingsscoped exclusively toCurrentStoreIdSettings.cshtmlview mirrors the admin shipping settings view but targetsAreaStoreand omits the global store-scope selectorProviders()GET/POST andProviderUpdatePOST actions added to the StoreShippingController, loadingShippingProviderSettingsscoped toCurrentStoreIdand toggling provider active/inactive state per storeProviders.cshtmlview mirrors the admin providers view but targetsAreaStoreand omits the global store-scope selectorRestrictions()GET andRestrictionSave()POST actions added to the StoreShippingController, scoped toCurrentStoreId— only the current store's shipping methods appear in the country and customer-group restriction matricesRestrictions.cshtmland partials (Restrictions.TabCountry.cshtml,Restrictions.TabGroup.cshtml) mirror the admin restrictions view but targetAreaStoreStoreId == CurrentStoreId_ViewImports.cshtmlupdated withGrand.Web.AdminShared.Models.ShippingnamespaceAdmin (Grand.Web.Admin) — StoreId Support
WarehouseModel,DeliveryDateModel, andShippingMethodModelextended withStoreId,AvailableStores, andStoreNamepropertiesShippingController(Admin) updated: newPrepareDeliveryDateModel,PrepareShippingMethodModelhelpers and updatedPrepareAddressWarehouseModelnow populate the store dropdown for create/edit formsDeliveryDates,Warehouses,PickupPoints, andMethodslist actions populateStoreNamevia O(1) dictionary lookup and return it in the grid dataCreateOrUpdateWarehouse.cshtml,CreateOrUpdateDeliveryDate.cshtml, andCreateOrUpdateMethod.cshtmlpartial views now render a store selector dropdown (label correctly bound toStoreId)DeliveryDates.cshtml,Warehouses.cshtml,PickupPoints.cshtml, andMethods.cshtmllist views now display a "Store" columnRestrictions()GET accepts an optionalstoreIdquery parameter — passes it toGetAllShippingMethods(storeId)so the restriction matrix shows only methods for the selected store; a store selector dropdown reloads the page on changeRestrictionSave()POST scopes saves to the selected store and preserves it in the redirectShippingMethodRestrictionModelextended withStoreIdandAvailableStorespropertiesAdmin.Configuration.Shipping.Warehouses.Fields.Store,Admin.Configuration.Shipping.Warehouses.SelectStore,Admin.Configuration.Shipping.DeliveryDates.Fields.Store,Admin.Configuration.Shipping.DeliveryDates.SelectStore,Admin.Configuration.Shipping.Methods.Fields.Store,Admin.Configuration.Shipping.Methods.SelectStoreCleanup
StoreDeliveryDateModel,StoreWarehouseModel,StorePickupPointModelProductImportDataObjectTestsupdated to match new signatures andIPagedList<T>return types