Feature/store portal discount management - #1
Open
DrShoker wants to merge 14 commits into
Open
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…untController - Fix 1: CategoryAddPopup POST now checks per-category store ownership before applying discounts, mirroring the ProductAddPopup pattern - Fix 2: CouponCodeList, ProductList, CategoryList, CouponCodeInsert, and CouponCodeDelete now require LimitedToStores=true to prevent store users from enumerating sub-resources of global or multi-store discounts - Fix 3: Add [HttpPost] to CouponCodeInsert and CouponCodeDelete Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Create.cshtml and Edit.cshtml wrapper views for the Discount controller with: - Proper model binding to DiscountModel - IsReadOnly support for global discounts (hides Save/Delete buttons) - Tabstrip structure with four tabs (Info, CouponCodes, Products, Categories) - Delete confirmation tag helper for Edit view - Added Grand.Web.AdminShared.Models.Discounts to _ViewImports.cshtml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add !discount.LimitedToStores guard to ProductAddPopup POST, ProductDelete, and CategoryDelete (Fix 1) - Add coupon.DiscountId != discountId ownership check in CouponCodeDelete (Fix 2) - Add storeId: CurrentStoreId to CategoryAddPopupList to prevent cross-store category leakage (Fix 3) - Remove unused [FromServices] IProductService parameter from ProductAddPopup GET (Fix 4) - Inject IDateTimeService and use discount.ToModel(dateTimeService) in Edit GET for correct date conversion (Fix 5) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add CLAUDE.md with architecture overview, build/test instructions, key directories, and a guide table pointing to per-layer docs - Add docs/guides/ with seven guides covering core layer, business layer, web layer, modules, plugins, testing patterns, and Aspire orchestration - Add docs/superpowers/plans/ with Store portal Discount Management implementation plan Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title:
feat: Discount Management in Store Portal
Body:
Summary
Adds full Discount Management to the Store portal (
Grand.Web.Store), following the same pattern as MessageTemplate and Page management (PRs grandnode#693, grandnode#694).Store staff can now create and manage store-scoped discounts without needing Admin access.
Changes
New: Store Portal Discount Management
Architecture
DiscountControllerinGrand.Web.Store— inheritsBaseStoreController, reuses the existingIDiscountViewModelServicefromGrand.Web.AdminShared(no new service class, no DI changes)CurrentStoreId = contextAccessor.WorkContext.CurrentCustomer.StaffStoreIdmodel.Stores = [CurrentStoreId]before every insert/update; AutoMapper setsLimitedToStores = trueautomaticallyDocumentation
CLAUDE.md— project guide for build, test, architecture, and key directoriesdocs/guides/— seven per-layer guides (core, business, web, modules, plugins, testing, Aspire)Files Changed
Grand.Web.Store/Controllers/DiscountController.csGrand.Web.Store/Areas/Store/Views/Discount/List.cshtmlGrand.Web.Store/Areas/Store/Views/Discount/Create.cshtmlGrand.Web.Store/Areas/Store/Views/Discount/Edit.cshtmlGrand.Web.Store/Areas/Store/Views/Discount/Partials/_TabInfo.cshtmlGrand.Web.Store/Areas/Store/Views/Discount/Partials/_TabCouponCodes.cshtmlFiles Changed
|
Grand.Web.Store/Areas/Store/Views/Discount/Partials/_TabProducts.cshtml| New ||
Grand.Web.Store/Areas/Store/Views/Discount/Partials/_TabCategories.cshtml| New ||
Grand.Web.Store/Areas/Store/Views/Discount/ProductAddPopup.cshtml| New ||
Grand.Web.Store/Areas/Store/Views/Discount/CategoryAddPopup.cshtml| New ||
Grand.Web.Store/Areas/Store/Views/_ViewImports.cshtml| Updated ||
CLAUDE.md| New ||
docs/guides/*.md| New (7 files) |Test Plan
StaffStoreIdset)