Skip to content

Vendor api - #10

Merged
shakibdshy merged 21 commits into
devfrom
vendor-api
Jan 31, 2026
Merged

Vendor api#10
shakibdshy merged 21 commits into
devfrom
vendor-api

Conversation

@shakibdshy

@shakibdshy shakibdshy commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added file upload support via Uploadcare integration (@uploadcare/react-uploader, uuid dependencies).
    • Introduced EntityFormDialog for building declarative, reusable form dialogs with automatic field rendering, validation, and submission handling.
    • Added DatePicker UI component for date selection.
    • Added ConfirmDeleteDialog for standardized delete confirmations with loading states.
    • Added PageSkeleton for loading state UI.
    • Introduced factory-based entity headers (createEntityHeader) and table column builders for consistent admin/vendor entity management.
    • Added server-side data fetching support to data tables via fetcher props.
    • Added mutation state tracking to UI components for better async operation feedback.
    • Added EditShopDialog for in-place shop profile editing.
    • Added AdminErrorComponent for admin-specific error handling.
  • Bug Fixes

    • Removed debug console.log statement from header component.
  • Code Quality

    • Standardized quote style to double quotes across all files for consistency.
    • Refactored entity management patterns to use reusable factory functions and generic components.
    • Introduced consistent action handler naming (onEdit, onDelete, onToggleActive).
    • Replaced hardcoded column definitions with dynamic column builders for reduced duplication.

✏️ Tip: You can customize this high-level summary in your review settings.

…tions

- Add @uploadcare/react-uploader dependency for image uploads
- Update shop types and schema to support real data operations
- Create vendor helper functions for user role and vendor lookup
- Implement comprehensive shop CRUD functions with server-side validation
- Add React Query hooks for shops data fetching and mutations
- Replace mock data with real API calls in my-shops page
- Enhance shop card with edit dialog and image upload capabilities
- Add empty state and shop count badge to vendor dashboard sidebar
- Improve shop form with better validation and file upload integration
- Add admin middleware to protect admin routes and server functions
- Create admin error component for access denied and error handling
- Add admin shop query validator and server function for shop management
- Move hooks to common directory and extract shared CRUD hook
- Fix header console log removal and update import paths
- Add forbidden route for admin access denied scenarios
…a fetching

- Add uuid dependency for category ID generation
- Create category database schema with hierarchical support
- Implement server-side pagination, sorting, and filtering for categories
- Add vendor category management UI with reusable components
- Create shared category validators and query helpers for DRY compliance
- Implement category CRUD operations with TanStack Query mutations
- Add server fetcher factory for consistent data fetching patterns
- Create reusable confirm delete dialog and page skeleton components
- Update sidebar to use real session data for user display
- Fix type definitions and filter column generics for better type safety
- Add brand schema to database and include in drizzle config
- Create server functions for brand operations with auth middleware
- Implement vendor brand management UI with data table and dialogs
- Add form validation using Zod schemas for create/update operations
- Set up TanStack Query for data fetching and mutation state management
- Move Uploadcare CSS import to root layout for global availability
- Remove unused CSS import from add-category-dialog component
…alog

- Replace NormalizedBrand with BrandItem as the single brand type
- Extract shared form logic into EntityFormDialog component
- Add product count validation before brand deletion
- Remove unused product count queries and FIXME comments
This change enforces consistent quote style by updating all single quotes in imports to double quotes, aligning with the project's biome.json configuration. The update improves code consistency and readability without affecting functionality.
- Refactor category table into separate admin and vendor components for better maintainability
- Fix empty string validation in optional field validator to properly handle empty values
- Update category deletion to check actual product count before allowing deletion
- Simplify category query helpers by removing unused product count queries
- Update build scripts to exclude generated route tree file from formatting/linting
- Fix slug auto-generation in entity form dialog to use onChange instead of onBlur
Improve code maintainability by moving inline fields definition to a separate constant. This reduces duplication and makes the component structure clearer.
…operations

- Add attribute database schema with tables for attributes and attribute values
- Implement vendor attribute CRUD operations with server functions and validation
- Create attribute management UI components with data table integration
- Add attribute query helpers for optimized batch fetching and normalization
- Integrate attribute management into vendor shop dashboard
…CRUD operations

- Add tags database schema with shop-scoped table and relations
- Create shared tag query validators and helper functions for data fetching
- Implement vendor tag CRUD server functions with proper authorization
- Add vendor tags page with data table, filtering, and mutation handling
- Create reusable tag components (header, table, dialog) for vendor interface
- Refactor brand and category validators to use shared query schemas
- Integrate tags into vendor entity fetchers for consistent data fetching patterns
- Add database schema for tax rates with shop scoping and regional support
- Create comprehensive tax rate CRUD operations with validation
- Implement vendor tax rate management UI with data table integration
- Add server functions for tax rate queries, creation, updates, and deletion
- Create reusable tax rate form dialog and table column components
- Integrate tax rate management into vendor shop routes
- Update types and hooks to support new tax rate functionality
- Set Toaster theme to dark for consistent UI appearance
- Replace AddAttributeDialog with inline form in EntityFormDialog for better UX
- Add proper validation and dynamic form fields for attribute values
- Fix type safety in data table components with generic FilterableColumn
- Ensure default values for attribute values array to prevent runtime errors
- Update attribute header to use simple button instead of dialog trigger
- Update BrandFormValues, TagFormValues, and TaxRateFormValues interfaces to make non-essential fields optional for flexible form handling
- Add missing TaxPermissions and Taxes interfaces to complete tax type definitions
- Extend mock data to include all required fields from updated BrandItem and TagItem interfaces
- Refactor admin components to use proper form value types and pass full objects to delete handlers
- Consolidate table components by removing separate permission props in favor of mode-based rendering
…h button

- Remove internal dialog state and AddTagDialog component
- Replace with a simple button that triggers parent-provided onAddTag callback
- Update description text to be more concise
- Simplify props interface by removing TagFormValues dependency
- Replace individual header components (TagHeader, TaxHeader, etc.) with a factory function
- Unify prop naming from onAdd{Entity} to consistent onAdd callback
- Reduce code duplication and improve maintainability
- Update all template files to use the new prop naming convention
…ports

Consolidate the shared entity header factory function into the base/common directory to improve code organization and maintainability. Update all component imports to use the new location instead of relative paths.
…t types

Move type definitions from hook to shared validator file to centralize type definitions and improve maintainability.
…pagination

- Add product database schema with relations to categories, brands, tags, and attributes
- Create server-side pagination fetcher for vendor products with filtering and sorting
- Replace mock product table with TanStack Query-based data fetching and mutations
- Implement product CRUD operations with proper error handling and loading states
- Add product form dialog with image upload support and attribute selection
- Migrate products route to use real data instead of mock data
- Update entity header component for reusable product headers
- Add product table columns with action dropdown for edit/delete/toggle
- Integrate with existing vendor entity fetchers pattern
…gination

- Add coupon database schema with product/category restrictions and usage tracking
- Create vendor coupon management pages with server-side data fetching
- Implement shared coupon table components for admin and vendor dashboards
- Add coupon validation and mutation hooks with TanStack Query integration
- Replace mock data with real API calls for coupon CRUD operations
- Introduce date picker component for coupon validity period selection
- Refactor coupon types and validators into centralized modules
Prevents form validation errors by ensuring the applicableTo select field has a default value of "all" when the dialog opens.
…tion

Extract coupon data creation into a shared object to eliminate repetitive code in create and update operations. This improves maintainability by having a single source of truth for the coupon data structure.
@coderabbitai

coderabbitai Bot commented Jan 31, 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.

  • ✅ Full review completed - (🔄 Check again to review again)
✨ 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 60a961a into dev Jan 31, 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