Skip to content

Dashboard, Orders and Transactions - #13

Merged
shakibdshy merged 23 commits into
devfrom
vendor-api
Feb 15, 2026
Merged

Dashboard, Orders and Transactions#13
shakibdshy merged 23 commits into
devfrom
vendor-api

Conversation

@shakibdshy

@shakibdshy shakibdshy commented Feb 15, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Stripe payment processing with secure checkout flow
    • Launched product review system with helpful vote tracking and vendor responses
    • Introduced wishlist functionality for saving favorite products
    • Implemented coupon/discount system with per-shop validation
    • Added comprehensive address management for checkout
    • Enhanced shipping method selection with dynamic availability
    • Added order tracking and confirmation emails
    • Introduced vendor dashboard with sales analytics and order management
    • Added Stripe Connect integration for vendor payouts
  • Improvements

    • Streamlined checkout experience with address auto-fill
    • Improved cart synchronization and item management
    • Enhanced product details with related products and verified purchase badges
    • Better error handling and user feedback throughout checkout flow

Add .agents to .gitignore to exclude agent-related files from version control.
Use optional chaining when accessing product images array to prevent runtime errors when images is null or undefined.
- Replace mock product data with API calls for product listing and details
- Add new store product types and transformation utilities
- Implement React Query hooks for data fetching and caching
- Update UI components to use real data with proper loading states
- Add skeleton loading components for better UX
- Update validators and query helpers for store-specific product queries
Implement infinite query with configurable page sizes for improved UX.
Introduce new constant for pagination sizes and update default limit.
- Add store-specific category types, validators, and query hooks
- Create server functions for fetching categories with proper filtering
- Replace mock data with real API calls in category templates
- Implement category tree building for hierarchical navigation
- Connect product grid to actual product data with loading states
- Add TanStack Query prefetching in route loaders for better UX
…API data

- Add shared SortOption type and product sorting utilities
- Create React Query hooks for store products, categories, and brands
- Implement infinite scrolling with "Load More" button in product grid
- Replace mock data with real API calls using server functions
- Update filter sidebar to use dynamic categories and brands
- Add product listing page loader for data prefetching
- Enhance product card with loading states and list view variant
- Update mobile filter drawer to accept dynamic filter data
- Replace mock store data with real API calls using TanStack Query
- Add server functions for fetching stores with filtering, sorting, and pagination
- Implement infinite scroll for store listing with intersection observer
- Add query hooks and types for store shops data
- Update store list component to accept props instead of using global store
- Prefetch store data on route load for better performance
- Add TanStack Query prefetching in route loader for store data
- Replace mock products with real API calls using shop slug
- Implement loading states and error handling for store page
- Transform API response to match frontend store type
- Update product sorting to work with real data
- Add cart database schema with sessions and items tables
- Create server functions for cart operations (add, update, remove, clear, merge)
- Implement useCart hook with React Query for state management
- Add optional auth middleware for guest/user cart sessions
- Update UI components to use server-side cart instead of local storage
- Add cart validators and helper functions for data fetching
- Integrate cart functionality across product cards, collection, and cart pages
- Maintain optimistic updates and loading states for better UX
- Create database schema and validators for customer addresses
- Implement server functions for CRUD operations with authentication
- Add address book UI with real-time data fetching and mutations
- Enhance entity form dialog with scrollable content support
- Update profile page to use session data and auth middleware
- Add address type support (billing/shipping) with default address handling
- Create wishlist database schema with user and product relations
- Implement server functions for wishlist CRUD operations with auth
- Add client-side hooks for wishlist state management with TanStack Query
- Integrate wishlist toggle in product details page
- Replace mock data with real wishlist data in account page
- Add auth middleware to wishlist route
Add database schema, API endpoints, and UI components for shipping methods management in vendor dashboard. Includes:
- Shipping schema with relations to shops
- CRUD server functions with validation and authorization
- React hooks for data fetching and mutations using TanStack Query
- Reusable UI components (table, form, header) following entity pattern
- Shipping page integration with shop navigation
- Support for pagination, filtering, and sorting
… flow

- Add product-shipping method relations to enable product-specific shipping restrictions
- Implement shipping method validation for cart items based on product restrictions
- Enhance checkout UI with address management, shipping method selection, and order summary
- Update cart store to support shipping address and dynamic shipping methods
- Add street field to shipping address validation and form
- Refactor shipping table variable names for consistency
- Add handlers in wishlist-list to call cart and wishlist mutations
- Pass handlers and loading states to wishlist-item-card
- Show loading spinners on buttons during async operations
- Update Stripe documentation formatting (minor visual fixes)
- Add order, payment, notification, and email delivery schemas
- Implement Stripe Connect for vendor payment onboarding and dashboard
- Create checkout flow with Stripe Elements payment integration
- Add vendor settings page for managing Stripe Connect status
- Extend user and vendor schemas with order-related fields
- Add order notification system for vendors
- Implement order summary with coupon support in checkout
- Add order tracking page with timeline visualization
- Implement invoice download functionality with Stripe integration
- Update order confirmation page to support multiple orders
- Add tracking data type definitions and search validation
- Integrate invoice download button in order details
- Add product reviews schema with order item verification
- Create user review management page with edit/delete functionality
- Implement product review display with sorting and helpful voting
- Add store reviews section to storefront pages
- Enable review eligibility checking for verified purchases
- Add review form with order item selection for verified customers
- Update product page to use real review data instead of mock
- Add review-related hooks and server functions
Add .agents to .gitignore to exclude agent-related files from version control.
- Add vendor transaction types and server functions for fetching transactions and stats
- Create vendor-specific transaction table component with filtering and sorting
- Replace mock data with real server-side paginated data in transactions page
- Add transaction stats cards showing earnings, fees, and transaction counts
- Implement utility function for currency formatting
- Add vendor order types, hooks, and server functions for fetching and updating orders
- Create vendor-specific order table component with server-side pagination and filtering
- Implement vendor order details page with status updates and invoice download
- Add order statistics dashboard showing order counts and revenue metrics
- Integrate authentication and shop access control for vendor order operations
- Add useShopDashboard hook with React Query for fetching aggregated dashboard data
- Create server function getShopDashboardData with parallel database queries
- Add dashboard utility functions for formatting currency, percentages, and dates
- Update dashboard components (SalesOverview, RecentOrders, TopProducts, CustomerInsights) to use real data
- Replace placeholder stats with calculated metrics from database
- Remove simulated loader and use proper suspense with skeleton
@coderabbitai

coderabbitai Bot commented Feb 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This pull request introduces a comprehensive e-commerce feature set, including customer checkout and payment processing via Stripe, product reviews system, cart and wishlist management, order tracking, address management, vendor shipping methods, transaction handling, and a vendor dashboard. It adds database schemas for orders, payments, reviews, addresses, shipping, notifications, wishlist items, and cart management, alongside extensive server-side APIs, React Query hooks, and UI components across customer and vendor flows.

Changes

Cohort / File(s) Summary
Configuration & Dependencies
.gitignore, package.json, src/lib/auth.ts
Added Stripe packages and three new .gitignore entries; extended auth user config with role and orderEmailsEnabled fields.
Database Schema - Core Tables
src/lib/db/index.ts, src/lib/db/schema/auth-schema.ts, src/lib/db/schema/order-schema.ts, src/lib/db/schema/payment-schema.ts, src/lib/db/schema/review-schema.ts
Added comprehensive order, payment, and review tables with enums for statuses; extended auth schema with role and email preferences; schemas include relationships for multi-vendor orders and verified purchases.
Database Schema - User & Shop Data
src/lib/db/schema/address-schema.ts, src/lib/db/schema/cart-schema.ts, src/lib/db/schema/email-schema.ts, src/lib/db/schema/notification-schema.ts, src/lib/db/schema/shop-schema.ts, src/lib/db/schema/shipping-schema.ts, src/lib/db/schema/wishlist-schema.ts
New schemas for customer addresses, cart sessions/items, email deliveries, shop notifications, wishlist items, shipping methods; added Stripe Connect fields to vendors table.
Database Schema - Product Relationships
src/lib/db/schema/products-schema.ts
Added productShippingMethods junction table linking products to applicable shipping methods.
Server Functions - Store/Cart
src/lib/functions/store/cart.ts, src/lib/functions/store/address.ts, src/lib/functions/store/shipping.ts
Implemented cart CRUD (getCart, addToCart, updateQuantity, removeItem, clearCart, mergeCarts), address management (create/update/delete/setDefault), and shipping method fetching with stock validation and session handling.
Server Functions - Orders & Payments
src/lib/functions/store/order.ts, src/lib/functions/store/coupon.ts, src/lib/functions/store/invoice.ts
Implemented checkout session creation with per-shop order handling, payment confirmation, order retrieval, cancellation, coupon validation with discount computation, and invoice URL fetching via Stripe.
Server Functions - Products & Categories
src/lib/functions/store/products.ts, src/lib/functions/store/categories.ts, src/lib/functions/store/brands.ts, src/lib/functions/store/shop.ts
Implemented store-facing product, category, brand, and shop listing with filtering, pagination, search, tree building, and shop-scoped queries.
Server Functions - Reviews & Wishlist
src/lib/functions/store/review.ts, src/lib/functions/store/wishlist.ts
Implemented review CRUD (create/update/delete), eligibility checks, helpful vote tracking, shop and product review fetching, plus wishlist toggle and status checking.
Server Functions - Vendor Operations
src/lib/functions/shipping.ts, src/lib/functions/vendor.ts, src/lib/functions/vendor/dashboard.ts
Implemented vendor shipping method management (create/update/delete/list), order notification creation, and multi-metric dashboard data aggregation.
React Query Hooks - Cart & Checkout
src/hooks/store/use-cart.tsx, src/hooks/store/use-checkout.tsx
Implemented useCart hook with optimistic updates, useCheckout for session/payment operations, order queries, and guest session persistence.
React Query Hooks - User Data
src/hooks/store/use-address.tsx, src/hooks/store/use-reviews.tsx, src/hooks/store/use-wishlist.ts
Implemented address CRUD mutations with invalidation, review queries/mutations with helpful voting, and wishlist toggle with status caching.
React Query Hooks - Product Catalog
src/hooks/store/use-store-product.tsx, src/hooks/store/use-store-categories.tsx, src/hooks/store/use-store-shops.tsx, src/hooks/store/use-store-brands.tsx, src/hooks/store/use-product-filters.tsx
Implemented product and infinite product queries, category tree and featured queries, shop listing with infinite scroll, brand queries, and combined product filter hook with client-side refinement.
React Query Hooks - Vendor
src/hooks/vendors/use-shop-dashboard.tsx, src/hooks/vendors/use-vendor-orders.tsx, src/hooks/vendors/use-vendor-transactions.tsx, src/hooks/vendors/use-vendor-stripe-connect.tsx, src/hooks/vendors/use-vendor-entity-fetchers.ts, src/hooks/common/use-shipping.tsx
Implemented vendor dashboard data query, order CRUD with status mutations, transaction stats queries, Stripe onboarding/dashboard/disconnect mutations, and fetcher factories for orders and transactions.
Components - Cart & Checkout
src/components/base/store/cart/cart-item.tsx, src/components/containers/store/cart/cart-items-list.tsx, src/components/containers/store/cart/cart-sheet.tsx, src/components/containers/store/cart/cart-summary.tsx, src/components/containers/store/checkout/checkout-address-section.tsx, src/components/containers/store/checkout/checkout-order-summary.tsx, src/components/containers/store/checkout/shipping-address-fields.tsx, src/components/containers/store/checkout/shipping-method-selector.tsx, src/components/base/store/checkout/stripe-payment-dialog.tsx
Updated cart components with server-driven state and callbacks; added address and shipping method selection; implemented coupon per-shop system with free shipping handling; added Stripe Elements payment dialog.
Components - Orders & Payments
src/components/base/store/order/order-details-card.tsx, src/components/containers/vendors/order-details/order-actions.tsx
Added order number/payment intent display with invoice download; implemented vendor order status dropdown with notes and payment status handling.
Components - Reviews
src/components/base/products/details/review/edit-review-dialog.tsx, src/components/base/products/details/review/my-review-card.tsx, src/components/base/products/details/review/review-card.tsx, src/components/base/products/details/review/review-form-cta.tsx, src/components/containers/store/product-details/review-form-dialog.tsx, src/components/containers/store/product-details/product-reviews-tab.tsx, src/components/containers/store/accounts/my-reviews/my-reviews-list.tsx
Added review creation/editing/deletion with star rating and comment; implemented helpful vote UI; added eligibility checking (purchased products only); created my reviews list with edit/delete actions.
Components - Product Display Updates
src/components/base/products/product-card.tsx, src/components/base/products/details/product-card-horizontal.tsx, src/components/base/products/details/store-info-card.tsx
Updated to DisplayProduct/StoreProduct types; added variant prop for grid/list layout; async add-to-cart with loading states and cart sheet opening.
Components - Wishlist
src/components/base/store/accounts/wishlist-item-card.tsx, src/components/containers/store/accounts/wishlist/wishlist-list.tsx
Added callbacks for add-to-cart and remove; implemented real data fetching with loading/empty states.
Components - Shipping & Transactions
src/components/base/skeleton/category-skeleton.tsx, src/components/containers/shared/shipping/..., src/components/containers/shared/orders/..., src/components/containers/shared/transactions/..., src/components/containers/shared/coupons/...
Added skeleton loader; implemented shipping, order, transaction, and coupon table column factories with actions and filtering; created data table components for admin/vendor views.
Components - Product Browsing
src/components/containers/store/collection-container.tsx, src/components/containers/store/product-list/product-grid.tsx, src/components/containers/store/product-details/details-tabs.tsx, src/components/containers/store/product-details/main-section.tsx, src/components/containers/store/product-details/similar-products-section.tsx, src/components/templates/store/product-page/filter-sidebar.tsx, src/components/templates/store/product-page/mobile-filter-drawer.tsx, src/components/templates/store/product-page/product-listing-template.tsx
Updated to use StoreProduct type; added category filtering and pagination; enhanced wishlist and cart integration; added dynamic filter sidebar with available categories/brands; implemented infinite scroll with load more.
Templates - Checkout & Orders
src/components/templates/store/checkout/checkout-template.tsx, src/components/templates/store/order/order-confirmation-template.tsx, src/components/templates/store/order/order-tracking-template.tsx
Implemented full checkout flow with guest/user address handling, coupon system per shop, Stripe payment integration; added order confirmation with multiple order support; added tracking template with data-driven state.
Templates - Product & Store
src/components/templates/store/product-details-template.tsx, src/components/templates/store/category/category-detail-template.tsx, src/components/templates/store/category/category-template.tsx, src/components/templates/store/homepage/collections.tsx, src/components/templates/store/storefront/store-page-template.tsx, src/components/templates/store/storefront/stores-listing-template.tsx
Replaced static data with React Query; added loading/error states; implemented dynamic breadcrumbs; added infinite scroll for stores; dynamic category tabs with filtering.
Templates - Customer Account
src/components/templates/store/accounts/my-reviews-template.tsx, src/components/templates/store/accounts/profile/address-book.tsx, src/components/templates/store/accounts/profile/address-dialog.tsx, src/components/templates/store/accounts/profile/profile-form.tsx, src/components/containers/store/accounts/account-sidebar.tsx, src/components/containers/store/accounts/security-settings.tsx
Added my reviews page; refactored address book with mutation-driven add/edit/delete; added address dialog with EntityFormDialog; updated profile form with session-based data; added sidebar menu item for reviews.
Templates - Cart
src/components/templates/store/cart/cart-template.tsx
Updated to useCart hook with loading skeleton and improved empty state.
Templates - Vendor Dashboard & Settings
src/components/templates/vendor/shop-dashboard-template.tsx, src/components/templates/vendor/shop-order-details-template.tsx, src/components/templates/vendor/shop-orders-template.tsx, src/components/templates/vendor/shop-shipping-template.tsx, src/components/templates/vendor/shop-transactions-template.tsx, src/components/templates/vendor/shop-settings-template.tsx
Refactored dashboard with aggregated data structure; added order detail with timeline and actions; replaced local data with fetcher pattern; added stats KPI cards; implemented Stripe Connect setup flow with onboarding, dashboard access, and disconnection.
Constants & Utilities
src/lib/constants/store-products.ts, src/lib/constants/vendors.routes.ts
Added PRODUCTS_PAGE_SIZE constant; added Shipping Methods and Settings nav items.
Email Templates
src/lib/emails/order-confirmation-email.tsx, src/lib/emails/vendor-new-order-email.tsx
Implemented order confirmation and vendor order notification email components with React Email.
Type Updates
src/components/base/common/collection-item.tsx, src/components/base/products/sort-dropdown.tsx
Added id prop to collection items; moved SortOption type import.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Poem

🐰 Hops of joy through checkout flows,
Reviews bloom where feedback grows,
Carts and coupons, orders trace,
Stripe's magic, Stripe's embrace!
A marketplace complete at last,
From past to future, steady fast! 🛒✨

🚥 Pre-merge checks | ✅ 1 | ❌ 3
❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 4.44% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (17 files):

⚔️ src/components/containers/vendors/shop/customer-insights.tsx (content)
⚔️ src/components/containers/vendors/shop/recent-orders.tsx (content)
⚔️ src/components/containers/vendors/shop/sales-overview.tsx (content)
⚔️ src/components/containers/vendors/shop/top-products.tsx (content)
⚔️ src/components/templates/vendor/shop-dashboard-template.tsx (content)
⚔️ src/components/templates/vendor/shop-order-details-template.tsx (content)
⚔️ src/components/templates/vendor/shop-orders-template.tsx (content)
⚔️ src/components/templates/vendor/shop-transactions-template.tsx (content)
⚔️ src/hooks/vendors/use-vendor-entity-fetchers.ts (content)
⚔️ src/lib/helper/order-helpers.ts (content)
⚔️ src/lib/utils.ts (content)
⚔️ src/routes/(vendor)/shop/$slug/index.tsx (content)
⚔️ src/routes/(vendor)/shop/$slug/orders/$orderId.tsx (content)
⚔️ src/routes/(vendor)/shop/$slug/orders/index.tsx (content)
⚔️ src/routes/(vendor)/shop/$slug/transactions.tsx (content)
⚔️ src/types/orders.ts (content)
⚔️ src/types/transaction.ts (content)

These conflicts must be resolved before merging into dev.
Resolve conflicts locally and push changes to this branch.
Title check ❓ Inconclusive The PR title 'Dashboard, Orders and Transactions' is vague and generic, using non-descriptive terms that don't convey meaningful information about the changeset's primary focus or intent. Revise the title to be more specific and descriptive, such as 'Add vendor dashboard, order management, and transaction tracking features' or 'Implement order and transaction APIs with shop dashboard data aggregation'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch vendor-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@shakibdshy
shakibdshy merged commit 7f8a60b into dev Feb 15, 2026
1 check passed
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