fix(admin): commission admin panel polish and validation#1043
Merged
Conversation
…/227/230/231/232)
- Global commission + create rule: remove Code field, switch single-select
type pickers to radio buttons, and require a value ("Please enter a value.").
- Create rule: add title, stores, product types, and categories validation.
- Commission rules list: dedicated empty state, non-badge status cell with
red inactive, and filter by rule scope type instead of percentage/fixed.
- Standardise commission success toasts and the delete confirmation copy.
- Commission rate code is now optional on create and auto-generated when
omitted; add scope_type list filter resolved from each rate's rules.
Refs MER-225, MER-226, MER-227, MER-230, MER-231, MER-232
…ayer Move the scope_type list filter out of the admin route handler and into CommissionModuleService by overriding listCommissionRates and listAndCountCommissionRates (the pattern SellerModuleService already uses). The override strips the virtual scope_type key and rewrites it into a raw() correlated-subquery predicate on commission_rule, so filtering runs in the database instead of in-memory in the route. query.graph delegates to the override, so the route just forwards filters. Refs MER-230
Override CommissionModuleService.createCommissionRates to fill a unique code from the rate name when one is not provided, instead of generating it in the admin route handler. Make CreateCommissionRateDTO.code optional to match. The route now forwards the validated body unchanged. Refs MER-225, MER-226
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.
Summary
Fixes the commission Admin Panel bugs reported in the current cycle, in one PR:
Supporting changes
codeis now optional on create and auto-generated (unique) server-side when omitted, so the Code field could be removed from the UI.scope_typelist filter on/admin/commission-rates, resolved server-side from each rate's linked rules (combos handled with AND semantics).$schema.json.Linear
Test plan
bun run buildbun run lint(no new issues in changed files)bun run test:integration:http -- commission-rates/admin/commission-rates.spec.ts— 24 passed (incl. auto-generated code +scope_typefilter)