Skip to content

refactor: move rating slice from products to marketing feature#57

Merged
bartstc merged 2 commits into
corefrom
refactor/rating
Apr 18, 2026
Merged

refactor: move rating slice from products to marketing feature#57
bartstc merged 2 commits into
corefrom
refactor/rating

Conversation

@bartstc
Copy link
Copy Markdown
Owner

@bartstc bartstc commented Apr 18, 2026

Summary

Relocates all product rating concerns from the products feature slice into the marketing feature slice, aligning ownership with the domain boundary.

Changes

  • Moved application hooks (use-rate-product.ts, use-rate-product-notifications.ts) to marketing/application/
  • Moved StarRating component and its story to marketing/components/
  • Moved marketing-product.ts model to marketing/models/
  • Moved use-rate-product-mutation.ts provider to marketing/providers/
  • Added use-marketing-product-query.ts provider in marketing/providers/ (previously lived in products/providers/)
  • Added ProductRating component and Storybook story in marketing/components/
  • Updated ProductDetails to delegate rating UI to the new ProductRating component
  • Updated Product page and loader to source data from the marketing slice
  • Updated marketing-product-query.ts in lib/api/ to reflect provider changes
  • Updated i18n translations to support the rating feature

@github-actions
Copy link
Copy Markdown

Summary

Summary
Generated on: 04/18/2026 - 10:21:16
Parser: MultiReport (2x LCov)
Assemblies: 1
Classes: 175
Files: 175
Line coverage: 66.6% (806 of 1210)
Covered lines: 806
Uncovered lines: 404
Coverable lines: 1210
Total lines: 6805
Branch coverage: 49.8% (238 of 477)
Covered branches: 238
Total branches: 477
Method coverage: Feature is only available for sponsors
Tag: 352_24602584125

Coverage

Default - 66.6%
Name Line Branch
Default 66.6% 49.8%
src/app/App.tsx 0% 0%
src/app/design/ColorModeProvider.tsx 100%
src/app/design/DesignProvider.tsx 100%
src/app/Providers.tsx 0%
src/features/auth/application/auth-store.ts 71.8% 71.4%
src/features/auth/application/AuthProvider.tsx 0%
src/features/auth/application/RequireAuth.tsx 33.3% 0%
src/features/auth/application/RequirePub.tsx 33.3% 0%
src/features/auth/application/with-require-auth.tsx 50%
src/features/auth/application/with-require-pub.tsx 50%
src/features/auth/components/SignInForm.tsx 90.9%
src/features/auth/components/use-sign-in-notifications.ts 100%
src/features/authv2/application/auth-context.tsx 0% 0%
src/features/authv2/application/auth-machine.ts 88.8% 50%
src/features/authv2/application/AuthProvider.tsx 0% 0%
src/features/authv2/application/storage-machine.ts 0% 0%
src/features/authv2/application/use-authorized-context-selector.ts 0%
src/features/authv2/models/permissions.ts 100%
src/features/authv2/models/user-roles.ts 100%
src/features/authv2/providers/get-roles.ts 0%
src/features/carts/application/use-add-to-cart-notifications.ts 71.4%
src/features/carts/application/use-add-to-cart.ts 59% 16.6%
src/features/carts/application/use-clear-cart-notifications.ts 87.5%
src/features/carts/application/use-clear-cart.ts 84.6% 50%
src/features/carts/application/use-product-added-dialog-store.ts 100%
src/features/carts/application/use-purchase-notifications.ts 87.5%
src/features/carts/application/use-purchase.ts 81.8%
src/features/carts/components/AddToCartButton/AddToCartButton.tsx 100% 100%
src/features/carts/components/AddToCartButton/ProductAddedDialog.tsx 72.7% 0%
src/features/carts/components/CartItem.tsx 77.7%
src/features/carts/components/CartsList.tsx 90%
src/features/carts/components/CheckoutButton/CheckoutButton.tsx 100%
src/features/carts/components/CheckoutButton/CheckoutDialog.tsx 80% 0%
src/features/carts/components/CheckoutButton/use-purchase-dialog-store.ts 100%
src/features/carts/components/CheckoutForm.tsx 100% 50%
src/features/carts/components/ClearCartButton/ClearCartButton.tsx 100%
src/features/carts/components/ClearCartButton/ConfirmClearCartDialog.tsx 87.5% 25%
src/features/carts/components/ClearCartButton/use-confirm-clear-cart-dialog
-store.ts
100%
src/features/carts/providers/use-cart-products-query.ts 50%
src/features/demo/application/use-counter.ts 100%
src/features/demo/components/Demo.tsx 83.3%
src/features/marketing/application/use-rate-product-notifications.ts 70%
src/features/marketing/application/use-rate-product.ts 46.6% 0%
src/features/marketing/components/FeatureSection.tsx 28.5%
src/features/marketing/components/HeroSection.tsx 40%
src/features/marketing/components/PricingSection.tsx 28.5%
src/features/marketing/components/ProductRating.tsx 100% 100%
src/features/marketing/components/StarRating.tsx 75% 60%
src/features/marketing/providers/use-marketing-product-query.ts 100%
src/features/products/components/ProductCard.tsx 71.4%
src/features/products/components/ProductDetails.tsx 100%
src/features/products/components/ProductNotFoundResult.tsx 80%
src/features/products/components/ProductsList.tsx 100% 100%
src/features/products/components/use-category-label.ts 100% 50%
src/features/products/providers/product-query.ts 50%
src/features/products/providers/products-query.ts 100%
src/lib/api/auth/login/login-mutation.ts 100%
src/lib/api/auth/users/{user-id}/user-query.ts 100%
src/lib/api/carts/{cart-id}/add-to-cart-mutation.ts 41.1% 0%
src/lib/api/carts/{cart-id}/cart-products-query.ts 50% 0%
src/lib/api/carts/{cart-id}/cart-query.ts 0%
src/lib/api/carts/{cart-id}/clear-cart-mutation.ts 80%
src/lib/api/carts/{cart-id}/purchase-mutation.ts 100%
src/lib/api/carts/cart-query-keys.ts 80%
src/lib/api/marketing/{product-id}/marketing-product-query.ts 100%
src/lib/api/marketing/{product-id}/use-rate-product-mutation.ts 23.8% 0%
src/lib/api/marketing/marketing-query-keys.ts 100%
src/lib/api/products/{product-id}/product-dto.ts 100%
src/lib/api/products/{product-id}/product-query.ts 100%
src/lib/api/products/products-list/products-list-query.ts 100% 50%
src/lib/api/products/products-query-keys.ts 100%
src/lib/assert-value.ts 100% 100%
src/lib/build-url.ts 75% 50%
src/lib/components/ErrorBoundary/ErrorBoundary.tsx 40% 16.6%
src/lib/components/ErrorBoundary/with-error-boundary.tsx 0%
src/lib/components/Form/conditional-rendering.ts 81.2% 50%
src/lib/components/Form/configuration.ts 57.1% 80%
src/lib/components/Form/fields/MoneyInput.tsx 100% 88.8%
src/lib/components/Form/fields/NumberInput.tsx 100% 77.7%
src/lib/components/Form/fields/SelectInput.tsx 100% 100%
src/lib/components/Form/fields/TextareaInput.tsx 100% 100%
src/lib/components/Form/fields/TextInput.tsx 100% 100%
src/lib/components/Form/fields/use-error-message.ts 100%
src/lib/components/Form/fields/utils.ts 100% 50%
src/lib/components/Form/form-context.ts 83.3% 50%
src/lib/components/Form/FormProvider.tsx 100%
src/lib/components/Form/map-grid-props.ts 40% 10%
src/lib/components/Form/presentation/CurrencyInput.tsx 100% 50%
src/lib/components/Form/presentation/FormField.tsx 100% 42.8%
src/lib/components/Form/presentation/NumberInput.tsx 100%
src/lib/components/Form/presentation/SelectInput.tsx 80% 61.7%
src/lib/components/Form/use-form.ts 100%
src/lib/components/Icon/Icon.tsx 0% 0%
src/lib/components/Layout/Footer/index.tsx 100%
src/lib/components/Layout/Footer/Logo.tsx 100%
src/lib/components/Layout/Layout.tsx 0%
src/lib/components/Layout/Navbar/DesktopNav.tsx 100% 75%
src/lib/components/Layout/Navbar/index.tsx 95.8% 87.5%
src/lib/components/Layout/Navbar/LoaderBar.tsx 80% 50%
src/lib/components/Layout/Navbar/MobileNav.tsx 100% 87.5%
src/lib/components/Layout/Navbar/use-nav-items.ts 100% 100%
src/lib/components/Layout/Page.tsx 100% 100%
src/lib/components/Layout/PageHeader.tsx 100% 100%
src/lib/components/Layout/ToggleModeButton.tsx 100% 100%
src/lib/components/Modal/create-modal-store.ts 100% 100%
src/lib/components/Result/Buttons/ContactUsButton.tsx 100%
src/lib/components/Result/Buttons/ResetFiltersButton.tsx 100%
src/lib/components/Result/EmptyStateResult.tsx 100%
src/lib/components/Result/ErrorPageStrategy.tsx 0% 0%
src/lib/components/Result/Icons/ErrorIcon.tsx 100%
src/lib/components/Result/Icons/InfoIcon.tsx 0%
src/lib/components/Result/Icons/SuccessIcon.tsx 0%
src/lib/components/Result/Icons/WarningIcon.tsx 100%
src/lib/components/Result/InternalErrorResult.tsx 100%
src/lib/components/Result/InternalServerErrorResult.tsx 100%
src/lib/components/Result/NotFoundResult.tsx 100%
src/lib/components/Result/Result.tsx 100%
src/lib/components/Suspense/with-suspense.tsx 0%
src/lib/components/Toast/Toaster.tsx 100% 87.5%
src/lib/components/Toast/use-not-implemented-yet-toast.ts 80%
src/lib/components/Toast/use-toast.ts 100% 100%
src/lib/components/Tooltip/Tooltip.tsx 50% 0%
src/lib/compose.ts 0%
src/lib/date/date.ts 91.3% 85.7%
src/lib/date/use-format-date-time.ts 100% 100%
src/lib/date/use-format-date.ts 100% 100%
src/lib/date/use-relative-time.ts 100% 100%
src/lib/debounce.ts 100% 100%
src/lib/format/money.ts 88.8% 75%
src/lib/format/number.ts 87.5% 75%
src/lib/get.ts 100%
src/lib/http/ajax-error.ts 0% 0%
src/lib/http/exceptions/internal-server-exception.ts 0%
src/lib/http/exceptions/resource-not-found-exception.ts 0% 0%
src/lib/http/http-service.ts 62.5%
src/lib/http/index.ts 100%
src/lib/http/ky-client.ts 63.6% 28.5%
src/lib/i18n/i18n.ts 68.4% 37.5%
src/lib/i18n/use-transations.ts 100%
src/lib/is-empty.ts 100%
src/lib/is-guid.ts 100% 100%
src/lib/logger/console-logger.ts 33.3% 10%
src/lib/logger/index.ts 47.6% 41.6%
src/lib/logger/logger-types.ts 100%
src/lib/logger/mock-logger.ts 0%
src/lib/logger/storybook-logger.ts 0%
src/lib/machine/replace.ts 0% 0%
src/lib/machine/union-context-selector.ts 0% 0%
src/lib/machine/use-actor-ref.ts 0% 0%
src/lib/permissions/use-has-permission.ts 0% 0%
src/lib/permissions/when-permitted-to.tsx 0% 0%
src/lib/query.ts 100%
src/lib/router/handle-lazy-import-error.ts 0% 0%
src/lib/router/index.ts 100% 50%
src/lib/router/routes.ts 100%
src/lib/router/use-route-error.ts 50%
src/lib/sleep.ts 100%
src/lib/theme/theme.ts 100%
src/lib/theme/use-brand-color.ts 100%
src/lib/theme/use-color-mode.ts 83.3% 25%
src/lib/theme/use-secondary-text-color.ts 100%
src/lib/to-kebab-case.ts 100%
src/lib/types/unauthorized-error.ts 0%
src/lib/types/unknown-error.ts 0%
src/main.tsx 0%
src/pages/Cart/index.tsx 33.3%
src/pages/Cart/loader.ts 100%
src/pages/Home/index.tsx 33.3% 0%
src/pages/Home/loader.ts 100%
src/pages/Product/index.tsx 21.4% 0%
src/pages/Product/loader.ts 100%
src/pages/Products/index.tsx 90.9% 50%
src/pages/Products/loader.ts 100%
src/pages/router.tsx 0%
src/pages/SignIn/index.tsx 100%

@bartstc bartstc merged commit c3b77d4 into core Apr 18, 2026
8 checks passed
@bartstc bartstc deleted the refactor/rating branch April 18, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant