Skip to content

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.

Plan fix: make PrepareBulkEditProductModel vendor-scoping a hard Task 11 prerequisite

KrzysztofPajaka8def835a395
diff --git a/docs/superpowers/plans/2026-08-16-arch001-product-consolidation-phase1.md b/docs/superpowers/plans/2026-08-16-arch001-product-consolidation-phase1.md
index aae10312a..ed91f3533 100644
--- a/docs/superpowers/plans/2026-08-16-arch001-product-consolidation-phase1.md
+++ b/docs/superpowers/plans/2026-08-16-arch001-product-consolidation-phase1.md
@@ -1256,6 +1256,7 @@ Same per-row discipline as Task 8: one method (or tightly-coupled small group, e
- [ ] `PrepareRecommendedProductModel(storeId)` — drop `storeId`
- [ ] `PrepareAssociatedProductModel(storeId)` — drop `storeId`
- [ ] `PrepareBulkEditListModel(storeId)` — drop `storeId`
+- [ ] `PrepareBulkEditProductModel` — **hard prerequisite, not optional:** Vendor's original implementation (`src/Web/Grand.Web.Vendor/Services/ProductViewModelService.cs`) passes `vendorId: contextAccessor.WorkContext.CurrentVendor.Id` into the underlying `SearchProducts` call, vendor-scoping the bulk-edit grid; AdminShared's version and `BulkEditListModel` have no vendor-id field/parameter at all. `BaseProductController.BulkEditSelect` (Task 8 row 15, already migrated) routes to AdminShared's unfiltered version — this is fine today only because Vendor is not yet subclassed onto `BaseProductController`. **Task 11 must not wire Vendor's `ProductController` onto `BaseProductController` until this method gains vendor-scoped filtering** (e.g. via `scope.ApplyScope` on the underlying query, or an injected filter callback) — doing so first would silently let any vendor see every vendor's products in the bulk-edit grid. Flag this row's completion as blocking Task 11, not merely a nice-to-have cleanup.
- [ ] `PrepareTierPriceModel(Product, storeId)` — drop `storeId`
- [ ] `PrepareBidMode`
- [ ] `PrepareProductAttributeMappingModel` (4 overloads at lines 1365/1379/1392/1526 — AdminShared has one more overload than Vendor per the interface diff; confirm which one and whether Vendor needs it)
@@ -1289,6 +1290,8 @@ Expected: no matches (or only local variables inside method bodies that read `sc
## Task 11: Convert the three host `ProductController`s to thin subclasses
+**Blocking prerequisite (added after Task 8 row 15's review):** do not subclass Vendor's `ProductController` onto `BaseProductController` until Task 10's `PrepareBulkEditProductModel` row is done and confirmed to preserve vendor-scoped filtering on the bulk-edit grid — see that row's note. Wiring Vendor on first would silently expose every vendor's products in `BulkEditSelect`'s grid to every other vendor. Admin and Store have no equivalent gap and can be subclassed independently of this prerequisite.
+
**Files:**
- Modify (rewrite, shrink): `src/Web/Grand.Web.Admin/Controllers/ProductController.cs`
- Modify (rewrite, shrink): `src/Web/Grand.Web.Store/Controllers/ProductController.cs`