Vendor api - #10
Merged
Merged
Conversation
…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.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
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 by CodeRabbit
New Features
Bug Fixes
Code Quality
✏️ Tip: You can customize this high-level summary in your review settings.