Commit Graph

489 Commits

Author SHA1 Message Date
a40c88dcea docs: add details modal and log modal patterns to component library
- Add Details Modal (Table Layout) example to components page
  - Shows header with icon and status badge
  - Stats cards grid (imported, updated, errors, total)
  - Key-value table with icon-labeled rows
- Add Log Details Modal example with live demo
  - Level-based coloring (warning=yellow, error=red, critical=purple)
  - Message, exception, and stack trace sections
  - Copy-to-clipboard for stack traces
  - Both error and warning log demo buttons
- Update jinja-macros.md with Details Modal Pattern documentation
  - Document the pattern structure and key features
  - Link to components library for live examples
- Add Alpine.js state variables for new modal demos

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 18:01:21 +01:00
2239522d79 feat: redesign log details modal with improved UI
- Add header with log level icon and colored badge
- Replace grid layout with table for log metadata (timestamp, logger, module)
- Add icons to table rows for better visual hierarchy
- Improve message section with card styling and pre-wrap text
- Enhance exception section with icon and red styling
- Add stack trace section with dark theme, monospace font, and copy button
- Include proper footer with close button
- Support dark mode throughout all new elements

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 17:47:57 +01:00
5670b83eab fix: correct import job modal field names and improve UI
- Fix field name mismatch: use 'imported' and 'updated' instead of
  'imported_count' and 'updated_count' to match API response schema
- Add progress stats cards with color-coded metrics (imported, updated,
  errors, total) for better visual hierarchy
- Replace grid layout with structured table for job details
- Add Language field to display import language
- Add error_message display with icon
- Improve header with icon and subtitle
- Better dark mode support with consistent styling
- Add border and rounded corners to table container

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 17:35:36 +01:00
2ecc2a9785 test: update tests for multi-language translation support
- Update marketplace_product_fixtures to create translations
- Update test_marketplace_product.py for translation-based titles
- Update test_product.py for effective property tests
- Update test_order.py to use get_title() method
- Add comprehensive CSV processor tests for translations
- Update stats service tests for new flat response structure
- Fix product schema tests with required marketplace_product_id field
- Add helper function create_marketplace_product_with_translation()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 17:29:50 +01:00
22c4937779 feat: add proper Pydantic response_model to all stats endpoints
- Create comprehensive stats schemas in models/schema/stats.py:
  - ImportStatsResponse, UserStatsResponse, ProductStatsResponse
  - PlatformStatsResponse, AdminDashboardResponse
  - VendorDashboardStatsResponse with nested models
  - VendorAnalyticsResponse, CodeQualityDashboardStatsResponse
- Move DashboardStatsResponse from code_quality.py to schema file
- Fix get_vendor_statistics() to return pending_vendors field
- Fix get_vendor_stats() to return flat structure matching schema
- Add response_model to all stats endpoints:
  - GET /admin/dashboard -> AdminDashboardResponse
  - GET /admin/dashboard/stats/platform -> PlatformStatsResponse
  - GET /admin/marketplace-import-jobs/stats -> ImportStatsResponse
  - GET /vendor/dashboard/stats -> VendorDashboardStatsResponse
  - GET /vendor/analytics -> VendorAnalyticsResponse
- Enhance API-001 architecture rule with detailed guidance
- Add SVC-007 rule for service/schema compatibility

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 17:29:35 +01:00
f2af3aae29 feat: update CSV import to support multi-language translations
- Add language parameter to import endpoints and background tasks
- Extract translation fields (title, description, short_description)
- Create/update MarketplaceProductTranslation records during import
- Add MarketplaceProductTranslationSchema for API responses
- Map product_type column to product_type_raw to avoid enum conflict
- Parse prices to numeric format (price_numeric, sale_price_numeric)
- Update marketplace product service for translation-based lookups
- Update CSV export to retrieve titles from translations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 17:29:13 +01:00
92a1c0249f feat: implement multi-language translation support for products
- Add database migrations for translation tables and digital product fields
- Create MarketplaceProductTranslation model for localized content
- Create ProductTranslation model for vendor translation overrides
- Add product type enum (physical, digital, service, subscription)
- Add digital delivery method and platform fields
- Add numeric price fields (price_numeric, sale_price_numeric)
- Implement language fallback pattern (requested -> 'en' -> None)
- Add helper methods: get_title(), get_description(), get_translation()
- Add vendor override pattern with effective_* properties
- Move title/description from products to translations table

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 17:28:54 +01:00
2d6410164e docs: add multi-marketplace product architecture documentation
- Add marketplace-integration.md: Full architecture for bidirectional
  marketplace integration (products, orders, fulfillment, inventory sync)
- Add multi-marketplace-product-architecture.md: Detailed product data
  model with translations and vendor override pattern
- Add product-migration-database-changes.md: Database migration plan
  with SQL scripts and model updates
- Update mkdocs.yml with new documentation entries

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 05:52:50 +01:00
e98a3efe57 fix: correct failing unit tests for product and import job services
- test_create_import_job_database_error: Monkeypatch db.flush instead
  of db.commit since service uses flush() per architecture rules
- test_create_product_already_exists: Store product_id before exception
  and rollback session to clear PendingRollbackError state
- test_delete_product_success: Add db.flush() to delete_product service
  method to ensure deletion is applied before verification

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 18:28:59 +01:00
ddc419353e chore: add shared tailwind.css to gitignore
Generated CSS files are already tracked in domain-specific directories.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 18:18:21 +01:00
15bb9a6bda chore: rebuild Tailwind CSS and update gitignore
- Rebuild admin and shop Tailwind CSS with new component styles
- Add tailadmin template directory to gitignore

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 18:17:58 +01:00
00857752cd docs: update UI components reference with Priority 4 and 5
Add documentation for all new e-commerce macros:

Priority 4 - Navigation & Discovery:
- Category Navigation: category_nav, mega_menu, mobile_category_drawer
- Breadcrumbs: breadcrumbs with variants and schema.org markup
- Search Bar: search_bar, search_autocomplete, mobile_search
- Filter Sidebar: filter_sidebar, price_filter, rating_filter, sort_dropdown

Priority 5 - Social Proof & Trust:
- Star Rating: star_rating, rating_input, rating_summary, compact_rating
- Reviews: review_card, review_list, review_form, review_summary_section
- Trust Badges: trust_badges, trust_banner, payment_icons, guarantee_badge,
  security_seals, checkout_trust_section

Also adds Alpine.js state variables for reviews and ratings.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 18:17:49 +01:00
7f4fcb1a8c docs: add architecture rules FE-017 to FE-023 for e-commerce macros
Add frontend architecture rules for Priority 4 and 5 components:

Priority 4 - Navigation & Discovery:
- FE-017: Use category_nav macros for category navigation
- FE-018: Use breadcrumbs macros for breadcrumb navigation
- FE-019: Use search_bar macros for search functionality
- FE-020: Use filter_sidebar macros for product filtering

Priority 5 - Social Proof & Trust:
- FE-021: Use star_rating macros for rating displays
- FE-022: Use review macros for review displays
- FE-023: Use trust_badges macros for trust signals

Each rule documents available macros, features, and usage examples.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 18:17:39 +01:00
8fe1315cac feat: add Priority 4 and 5 demos to components showcase page
Add interactive demos for all new e-commerce macros:

Priority 4 - Navigation & Discovery:
- Category navigation with mega menu
- Breadcrumb variants
- Search bar with autocomplete
- Filter sidebar with all filter types
- Sort dropdown

Priority 5 - Social Proof & Trust:
- Star ratings (static, dynamic, sizes)
- Compact ratings for lists
- Interactive rating input
- Rating summary with distribution
- Review cards with helpful voting
- Review form
- Trust badges grid
- Trust banner variants
- Payment method icons
- Guarantee badges
- Security seals
- Checkout trust section

Demo state includes sample data for categories, filters,
reviews, and ratings to showcase all component features.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 18:17:30 +01:00
43896a8644 feat: add icons for Priority 4 and 5 e-commerce components
Add new icons to support navigation and social proof components:

Priority 4 (Navigation):
- trending-up: For trending/popular search suggestions

Priority 5 (Social Proof & Trust):
- camera: For review image uploads
- pencil: For edit/write review actions
- cash: For money-back guarantee badges
- support: For 24/7 support trust badges
- emoji-happy: For satisfaction guarantee badges

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 18:17:19 +01:00
11bb39a804 feat: add Priority 5 Social Proof & Trust e-commerce macros
Add social proof and trust signal components for shop templates:

- star-rating.html: Star rating display with half-star/exact precision,
  interactive rating input, rating summary with distribution bars,
  compact rating for lists
- reviews.html: Review cards with verified badges, helpful voting,
  image attachments, review forms, sortable review lists
- trust-badges.html: Trust badges grid, trust banners (3 variants),
  payment method icons, guarantee badges, security seals,
  checkout trust sections

All macros support:
- Alpine.js reactive bindings
- Dark mode via Tailwind dark: prefix
- Multiple size variants
- Flexible layouts (grid, inline, vertical)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 18:17:09 +01:00
10b69d2f29 feat: add Priority 4 Navigation & Discovery e-commerce macros
Add navigation and discovery components for shop templates:

- category-nav.html: Category navigation with mega menu, mobile drawer,
  featured categories, and breadcrumb integration
- breadcrumbs.html: Breadcrumb navigation with schema.org markup,
  multiple variants (default, simple, with-home)
- search-bar.html: Search with autocomplete, recent/popular suggestions,
  mobile-optimized search drawer
- filter-sidebar.html: Product filtering with price range, rating filter,
  color/size selectors, sort dropdown, mobile filter drawer

All macros support:
- Alpine.js reactive bindings
- Dark mode via Tailwind dark: prefix
- Mobile-responsive layouts
- Accessibility features

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 18:16:59 +01:00
65e06c90ef docs: add architecture rules for Priority 3 e-commerce components
Add rules FE-013 through FE-016:
- FE-013: Use product_gallery macro for image galleries
- FE-014: Use variant_selector macros for product options
- FE-015: Use product_info macros for product details
- FE-016: Use product_tabs macro for product content tabs

Update ui-components-quick-reference.md with:
- Product Gallery usage and features
- Variant Selector macros
- Product Info macros
- Product Tabs configuration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 17:14:52 +01:00
ecd12b8667 feat: add Priority 3 demos to components showcase page
Add live demos for:
- Product Gallery with image navigation and thumbnails
- Variant Selector with size buttons and color swatches
- Product Info with title, price, rating, stock status
- Product Tabs with description, specifications, reviews

Add demoProductDetail state with full product data including
images, sizes, colors, specifications, and sample reviews.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 17:14:43 +01:00
f6fc74acef feat: add navigation and feedback icons for e-commerce
Add icons: chevron-left, chevron-up, zoom-in, zoom-out, arrows-expand,
chat-alt-2, thumb-up, thumb-down

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 17:14:35 +01:00
487bbc562a feat: add Priority 3 product detail e-commerce macros
New macros in shared/macros/shop/:
- product-gallery.html: Image gallery with thumbnails, zoom, lightbox
- variant-selector.html: Size buttons, color swatches, multi-variant
- product-info.html: Product details with price, rating, stock, badges
- product-tabs.html: Tabbed content (description, specs, reviews)

All components support:
- Dark mode via Tailwind dark: classes
- Alpine.js integration for reactivity
- Responsive design
- Accessible markup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 17:14:27 +01:00
353da1581a chore: rebuild Tailwind CSS with new component styles
Rebuild all frontend CSS files to include styles for:
- Number stepper component
- Tab components
- E-commerce shop components

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 17:04:56 +01:00
021ef3576c feat: add missing icons for macros and components
Add icons: template, view-boards, menu-alt-2, trash (alias for delete)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 17:04:49 +01:00
bb2e5fd260 refactor: standardize admin templates with shared macros
Migrate all admin templates to use standardized components:
- Use tabs macros (tabs_nav, tab_button) for tab navigation
- Use number_stepper for quantity/numeric inputs
- Use headers macros for consistent page layouts
- Use modals macros for dialog components

Affected pages: dashboard, settings, logs, content-pages, companies,
vendors, users, imports, marketplace, code-quality, and more.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 17:04:43 +01:00
2ec150e8a5 feat: enhance headers and modals shared macros
- headers.html: Add new header layout macros
- modals.html: Improve modal component styling and functionality

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 17:04:34 +01:00
95a8ffc645 docs: add architecture rules and docs for e-commerce components
Architecture rules added:
- FE-008: Use number_stepper macro for quantity inputs
- FE-009: Use product_card macro for product displays
- FE-010: Use product_grid macro for product listings
- FE-011: Use add_to_cart macros for cart interactions
- FE-012: Use mini_cart macro for cart dropdown

Documentation:
- Update ui-components-quick-reference.md with e-commerce section
- Add component-standards.md for standardization guidelines
- Add ecommerce-components-proposal.md with full 20-component roadmap
- Update validate_architecture.py with FE-008 detection

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 17:04:28 +01:00
c903248846 feat: add e-commerce section to components showcase page
- Add E-commerce section with live demos for all shop macros
- Add demo products and cart state to components.js
- Add demo methods: demoAddToCart, demoToggleWishlist, demoRemoveFromCart
- Showcase product cards, mini cart, add-to-cart functionality
- Add Macros section navigation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 17:04:19 +01:00
2f64dba155 feat: add Priority 1 e-commerce shop macros
New macros in shared/macros/shop/:
- product-card.html: Product cards with badges, ratings, wishlist,
  quick-add, size variants (sm/md/lg)
- product-grid.html: Responsive grid with loading skeletons, empty state
- add-to-cart.html: Add to cart button/form, buy now, quantity selector
- mini-cart.html: Cart icon with badge, dropdown, items, summary

All components support:
- Dark mode via Tailwind dark: classes
- Vendor theming via CSS variables
- Alpine.js integration
- Accessible markup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 17:04:12 +01:00
d863a26e6b feat: add number_stepper and tabs macro components
- inputs.html: number_stepper macro with +/- buttons, size variants
  (sm/md/lg), min/max validation, dark mode support
- tabs.html: tabs_nav, tabs_inline, tab_button macros with icon and
  count badge support, custom click handlers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 17:04:05 +01:00
4c5c851e3f feat: add FE-003 to FE-007 macro validation rules
New architecture validation rules for Jinja macros:

- FE-003: Inline loading/error states → use alerts.html macro
  Detects: x-show="loading" with py-12, bg-red-100 error boxes

- FE-004: Inline modals → use modals.html macro
  Detects: fixed inset-0 z-50 with role="dialog" or backdrop

- FE-005: Inline table wrappers → use tables.html macro
  Detects: overflow-hidden rounded-lg shadow-xs with <table>

- FE-006: Inline dropdowns → use dropdowns.html macro
  Detects: @click.outside with absolute positioning menu

- FE-007: Inline page headers → use headers.html macro
  Detects: flex justify-between with h2 text-2xl

All rules support noqa comments (e.g., {# noqa: FE-003 #})

Current violations found: 62 (all warnings)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 20:24:51 +01:00
74e8620fc7 refactor: standardize pagination across all admin pages
Migrated marketplace.js, imports.js, and logs.js to use the same
pagination pattern as companies.js, users.js, and vendors.js:

- pagination: { page, per_page, total, pages }
- Computed getters: totalPages, startIndex, endIndex, pageNumbers
- Methods: previousPage(), nextPage(), goToPage()

Updated templates to use the shared pagination macro:
- marketplace.html
- imports.html
- logs.html

All admin pages now use consistent pagination behavior and styling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 20:15:41 +01:00
00538e643e refactor: migrate templates to use pagination macro
Migrated templates to use shared pagination macro:
- companies.html, users.html, vendors.html, code-quality-violations.html

Added noqa comments for templates with custom pagination variables:
- marketplace.html (page/limit/totalJobs)
- imports.html (page/limit/totalJobs)
- logs.html (filters.skip/limit/totalLogs)
- login.html (inline spinner SVG for loading state)

Also updated validate_architecture.py to:
- Support noqa: FE-001 comments for custom pagination
- Support noqa: FE-002 comments for intentional inline SVGs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 20:08:22 +01:00
91c5539d1f fix: include FE-001/FE-002 checks in bulk template validation
The _validate_templates() function was only checking TPL-001 (extends base).
FE-001 (pagination macro) and FE-002 ($icon helper) checks were only run
in single-file mode via _validate_html_file().

Now bulk validation also catches:
- Inline pagination that should use shared/macros/pagination.html
- Inline SVGs that should use $icon() helper

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 20:02:42 +01:00
0bfdf331d6 refactor: remove legacy user registration from auth_service
- Remove unused register_user() method and helper methods
- Remove legacy UserRegister schema (customer registration uses CustomerService)
- Remove wrapper methods that just delegated to auth_manager
- Simplify auth_service to focus on login and vendor access control
- Clean up tests to match simplified service

The only registration path is now /api/v1/shop/auth/register for customers,
which uses CustomerService.register_customer().

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 19:55:23 +01:00
b31fd41423 fix: align auth_service with transaction management pattern
Change register_user() to use db.flush() instead of db.commit()
and remove db.rollback() to follow the established architecture:
- Services use flush() for database operations
- Endpoints handle transaction commit
- Exception handlers manage rollback

This resolves SVC-006 architecture violation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 19:41:01 +01:00
fbd3a45c38 feat: complete TailAdmin parity with remaining macro features
Add missing features identified in TailAdmin gap analysis:

cards.html:
- stat_card_with_trend: Stats card with up/down trend indicator and percentage
- card_with_menu: Card with dropdown menu in header
- card_with_menu_simple: Simplified version with menu_items parameter

tables.html:
- sortable_table_header: Table header with sortable columns, sort indicators,
  and Alpine.js integration for sort state management

forms.html:
- searchable_select: Dropdown with search/filter functionality
- multi_select: Multi-select dropdown with tag display

This completes feature parity with TailAdmin free template.
The tailadmin-free-tailwind-dashboard-template folder can now be deleted.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 19:32:42 +01:00
c0e44c2751 fix: escape Jinja syntax in copyCode examples on components page
Wrap Jinja template code examples inside copyCode() JavaScript calls
with {% raw %}{% endraw %} blocks to prevent Jinja from evaluating
them during template rendering.

Affected sections:
- Macros overview copy button
- Full pagination copy button
- Simple pagination copy button

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 19:19:41 +01:00
dad0989948 docs: add comprehensive Jinja macros documentation
New documentation:
- docs/frontend/shared/jinja-macros.md: Complete reference for all 94 macros
  - Alerts, Avatars, Badges, Buttons, Cards, Charts, Datepicker
  - Dropdowns, Forms, Headers, Modals, Pagination, Tables
  - Usage examples and parameter documentation
  - Complete page example showing all macros together

Updated documentation:
- docs/frontend/cdn-fallback-strategy.md:
  - Add Chart.js (v4.4.1) and Flatpickr (v4.6.13) sections
  - Document optional-libs.html loader macros
  - Update file structure and deployment checklist

- docs/frontend/shared/ui-components.md:
  - Add tip box recommending Jinja macros for new development
  - Update related documentation links

- mkdocs.yml:
  - Add Jinja Macros Library to navigation (top of Shared Components)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 19:15:27 +01:00
ffa15aee2b feat: add Chart.js and Flatpickr with CDN fallback strategy
Add optional libraries with local fallback for offline development:

Vendor files added:
- static/shared/js/vendor/chart.umd.min.js (Chart.js 4.4.1)
- static/shared/js/vendor/flatpickr.min.js (Flatpickr 4.6.13)
- static/shared/css/vendor/flatpickr.min.css

Template updates:
- admin/base.html: Add optional blocks for chartjs_script, flatpickr_script, flatpickr_css
- shared/includes/optional-libs.html: CDN fallback loaders for both libraries

Usage in page templates:
  {% block flatpickr_css %}
    {% from 'shared/includes/optional-libs.html' import flatpickr_css_loader %}
    {{ flatpickr_css_loader() }}
  {% endblock %}

  {% block chartjs_script %}
    {% from 'shared/includes/optional-libs.html' import chartjs_loader %}
    {{ chartjs_loader() }}
  {% endblock %}

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 19:09:06 +01:00
b0db4d26d8 feat: add advanced UI component macros
Add new macro files for comprehensive UI coverage:

- modals.html: modal, confirm_modal, form_modal, slide_over
- dropdowns.html: dropdown, context_menu, dropdown_item, select_dropdown
- avatars.html: avatar, avatar_with_status, avatar_initials, avatar_group, user_avatar_card
- charts.html: chart_card, line_chart, bar_chart, doughnut_chart (Chart.js)
- datepicker.html: datepicker, daterange_picker, datetime_picker, time_picker (Flatpickr)

Update forms.html with:
- password_input: Password field with show/hide toggle and strength indicator
- input_with_icon: Input with left/right icon support
- file_input: Drag & drop file upload zone

Tech stack: Jinja2 + Alpine.js + Tailwind CSS
External libs: Chart.js (optional), Flatpickr (optional)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 19:05:13 +01:00
990ca322f3 docs: add macros and pagination sections to components page
Update admin components page with documentation for:

- New Macros section listing all available shared macros with imports
- Pagination section with live interactive examples
- Copy-to-clipboard functionality for code snippets
- Dark mode support for all new sections

This serves as a living style guide for developers implementing
new admin pages using the shared component library.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 18:35:52 +01:00
8766e63120 refactor: migrate code-quality-violations pagination to standard pattern
Update pagination in code-quality-violations to match companies/vendors:

- Add numbered page buttons with ellipsis for large page counts
- Add startIndex and endIndex computed properties
- Add goToPage(pageNum) method for direct page navigation
- Use consistent grid layout (col-span-3, col-span-9)

This standardizes pagination UI across all admin tables.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 18:35:34 +01:00
979ae93b17 feat: add frontend architecture rules FE-001 to FE-004
Add rules to enforce consistent frontend component usage:

- FE-001 (warning): Use pagination macro instead of inline HTML
- FE-002 (warning): Use $icon() helper instead of inline SVGs
- FE-003 (info): Use table macros for consistent styling
- FE-004 (info): Use form macros for consistent styling

Update validate_architecture.py to check FE-001 and FE-002
anti-patterns in templates, with exceptions for macro definitions
and the components showcase page.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 18:35:17 +01:00
64ab9031d2 feat: add shared Jinja macros for reusable UI components
Add comprehensive macro library in app/templates/shared/macros/:

- pagination.html: pagination(), pagination_simple()
- alerts.html: loading_state(), error_state(), alert(), toast()
- badges.html: badge(), status_badge(), role_badge(), severity_badge()
- buttons.html: btn(), btn_primary(), btn_danger(), action_button()
- forms.html: form_input(), form_select(), form_textarea(), form_toggle()
- tables.html: table_wrapper(), table_header(), table_empty_state()
- cards.html: stat_card(), card(), info_card(), filter_card()
- headers.html: page_header(), section_header(), breadcrumbs()

These macros standardize TailAdmin styling with Alpine.js integration
and dark mode support, reducing code duplication across templates.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 18:34:59 +01:00
3520bcb069 refactor: move transaction management from services to API endpoints
- Services now use db.flush() instead of db.commit() for database operations
- API endpoints handle transaction commit after service calls
- Remove db.rollback() from services (let exception handlers manage this)
- Ensures consistent transaction boundaries at API layer

This pattern gives API endpoints full control over when to commit,
allowing for better error handling and potential multi-operation transactions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 18:34:41 +01:00
5d40551d98 refactor: fix architecture violations in admin marketplace endpoint
Move database queries to service layer and use proper Pydantic responses:

Schema changes (models/schema/marketplace_import_job.py):
- Add AdminMarketplaceImportJobResponse with extra fields (id, error_details,
  created_by_name)
- Add AdminMarketplaceImportJobListResponse with items/total/page/limit format

Service changes (app/services/marketplace_import_job_service.py):
- Add convert_to_admin_response_model() for admin-specific response
- Add get_all_import_jobs_paginated() for admin listing
- Add get_import_job_by_id_admin() without access control

API changes (app/api/v1/admin/marketplace.py):
- Use service methods instead of direct DB queries
- Use proper Pydantic response models instead of dicts
- All business logic now in service layer

Cleanup:
- Remove duplicate methods from admin_service.py

Architecture validation now passes with 0 violations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 22:14:25 +01:00
1fcbaa922e refactor: clean up admin marketplace endpoint
Improvements:
- Extract _job_to_dict() helper to eliminate code duplication
- Move all imports to top of file (removed local imports)
- Remove unused vendor_name query parameter
- Use service layer consistently (convert_to_response_model for POST)
- Cleaner, more readable code structure

The endpoint now follows better practices while maintaining
the same functionality and frontend compatibility.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 22:05:48 +01:00
8d879fe390 fix: align admin import endpoint with vendor pattern
Changes to match the working vendor marketplace import:
1. Make POST endpoint async (was sync)
2. Use positional args for background task (was keyword args)
3. Import process_marketplace_import at top of file (was inside function)
4. Fix route order: /stats now defined BEFORE /{job_id}
   to avoid FastAPI route conflicts
5. Remove unused admin_service import

These changes align the admin endpoint with the vendor endpoint
pattern that was already working correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 22:03:38 +01:00
b39dd1251c fix: use consistent optional chaining for selectedJob in templates
Fix JavaScript TypeError "can't access property 'error_details',
selectedJob is null" by using optional chaining consistently.

Changed in all three templates:
- x-show="selectedJob?.error_details?.length > 0" (was missing ?. before length)
- x-text="JSON.stringify(selectedJob?.error_details, ...)" (was missing ?.)

Affected templates:
- app/templates/admin/marketplace.html
- app/templates/admin/imports.html
- app/templates/vendor/marketplace.html

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 21:59:32 +01:00
c040d62d3f fix: admin import jobs API response format and background processing
Issues fixed:
1. GET endpoint now returns {items, total, page, limit} format
   instead of plain list (frontend expects this format)
2. Add GET /{job_id} endpoint for viewing single job details
3. Add 'id' field alongside 'job_id' for frontend compatibility
4. Add 'error_details' and 'created_by_name' fields to response
5. Trigger background processing when creating import job
   (jobs were created but never processed)

The import jobs will now actually process the CSV files and
import products into the database.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 21:55:53 +01:00