794 Commits

Author SHA1 Message Date
4672fc537b fix: add TPL-008 check to main validation + fix 4 templates
The TPL-008 rule was only in the single-file validation path,
not in the full project validation. Added it to _validate_templates().

Fixed invalid block names:
- customers.html: page_scripts → extra_scripts
- notifications.html: page_scripts → extra_scripts
- test-vendors-users-migration.html: scripts → extra_scripts
- test-auth-flow.html: scripts → extra_scripts

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 21:55:56 +01:00
acf8988386 fix: use correct block name in messages template + add TPL-008 rule
- Fix messages.html: change {% block page_scripts %} to {% block extra_scripts %}
  (page_scripts doesn't exist in admin/base.html, causing JS not to load)

- Add TPL-008 architecture rule to catch invalid template block names
  This prevents silent failures where content in undefined blocks is ignored

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 21:50:48 +01:00
f2bb64cc10 fix: remove nested Jinja comments in dropdowns.html
Nested {# ... #} comments inside the docstring were breaking
the outer comment block, causing 'dropdown' is undefined error
when rendering the components page.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 21:24:25 +01:00
245040d256 feat: add action_dropdown macro with loading state support
- Create action_dropdown macro in dropdowns.html supporting:
  - Loading/disabled state via loading_var parameter
  - Custom loading label
  - Icon support
  - Primary/secondary variants
- Update code quality dashboard to use new macro
- Add Dropdowns section to components page with examples:
  - Basic dropdown
  - Action dropdown with loading state
  - Context menu (3-dot)
  - Variant showcase (primary, secondary, ghost)

Architecture validation now passes with 0 errors and 0 warnings.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 21:13:08 +01:00
d50b154823 fix: resolve architecture validation errors and warnings
- Move database operations from API to service layer:
  - Add create_pending_scan() method to code_quality_service
  - Add get_running_scans() method to code_quality_service
  - Update API to use service methods instead of direct db queries
- Replace inline SVG spinner with $icon('spinner', ...) helper
- Add comment documenting custom dropdown exception

Validation now passes with 0 errors.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 21:07:18 +01:00
b46740351e refactor: improve admin notification service and add tests
- Minor improvements to admin notification service
- Add unit tests for admin notification service

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 21:01:43 +01:00
0098093287 feat: enhance messaging system with improved API and tests
- Refactor messaging API endpoints for admin, shop, and vendor
- Add message-specific exceptions (ConversationNotFoundException, etc.)
- Enhance messaging service with additional helper methods
- Add comprehensive test fixtures for messaging
- Add integration tests for admin and vendor messaging APIs
- Add unit tests for messaging and attachment services

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 21:01:14 +01:00
3bfe0ad3f8 refactor: extract pagination macro to shared location
- Create reusable pagination macro in shared/macros/pagination.html
- Update customers template to use shared pagination macro
- Reduces code duplication across admin templates

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 21:01:00 +01:00
0c65da0166 fix: use correct page_header_flex macro in messages template
The page_header macro doesn't accept a 'buttons' parameter.
Changed to page_header_flex with caller block for custom button.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 20:59:21 +01:00
26b3dc9e3b feat: add unified code quality dashboard with multiple validators
- Add validator_type field to scans and violations (architecture,
  security, performance)
- Create security validator with SEC-xxx rules
- Create performance validator with PERF-xxx rules
- Add base validator class for shared functionality
- Add validate_all.py script to run all validators
- Update code quality service with validator type filtering
- Add validator type tabs to dashboard UI
- Add validator type filter to violations list
- Update stats response with per-validator breakdown
- Add security and performance rules documentation
- Add chat-bubble icons to icon library

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 20:57:47 +01:00
6a903e16c6 feat: implement background task architecture for code quality scans
- Add status fields to ArchitectureScan model (status, started_at,
  completed_at, error_message, progress_message)
- Create database migration for new status fields
- Create background task function execute_code_quality_scan()
- Update API to return 202 with job IDs and support polling
- Add code quality scans to unified BackgroundTasksService
- Integrate scans into background tasks API and page
- Implement frontend polling with 3-second interval
- Add progress banner showing scan status
- Users can navigate away while scans run in background
- Document the implementation in architecture docs

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 20:57:08 +01:00
9cf0a568c0 feat: add shared utilities and table macros
- Add shared table macros for consistent table styling
- Add shared JavaScript utilities (date formatting, etc.)
- Add admin settings API enhancements
- Add admin schema updates

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 14:12:43 +01:00
a118edced5 feat: enhance Letzshop jobs and order management
- Add job cancellation and retry functionality
- Improve jobs table with better status display
- Add background task improvements
- Update Letzshop order service
- Update documentation

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 14:12:26 +01:00
5c0c92e94b feat: add admin customer management
- Add admin customers API endpoints
- Add AdminCustomerService for customer operations
- Enhance customers.html template with management features
- Add customers.js Alpine component
- Add customer list schemas

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 14:12:02 +01:00
02edea7cb3 feat: add admin notification system
- Add AdminNotificationService for notification operations
- Enhance notifications API with mark-read, mark-all-read endpoints
- Add notifications.html page template
- Add notifications.js Alpine component
- Add implementation documentation

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 14:11:48 +01:00
2f98c4389d feat: add customer messaging interface in shop
- Add shop messages API endpoints (/api/v1/shop/messages)
- Add shop messages page routes (/shop/account/messages)
- Add messages.html template for customer account
- Add Messages card to account dashboard with unread badge
- Customers can view/reply to vendor_customer conversations

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 14:10:38 +01:00
abceffb7b8 feat: add vendor messaging interface
- Add vendor messages API endpoints (/api/v1/vendor/messages)
- Add vendor messages page route (/vendor/{code}/messages)
- Add messages.html template for vendor portal
- Add messages.js Alpine component
- Add Messages link to vendor sidebar under Sales section

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 14:10:22 +01:00
081511ff8a feat: add admin messaging interface
- Add admin messages API endpoints (/api/v1/admin/messages)
- Add admin messages page route (/admin/messages)
- Add messages.html template with split-panel conversation view
- Add messages.js Alpine component for messaging UI
- Add Messages link to admin sidebar under Platform Administration
- Add message icon with unread badge to admin header
- Update init-alpine.js with headerMessages component

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 14:09:48 +01:00
8b7d2fe312 feat: add messaging system database models and core services
- Add Conversation, ConversationParticipant, Message, MessageAttachment models
- Add ConversationType enum (admin_vendor, vendor_customer, admin_customer)
- Add ParticipantType enum (admin, vendor, customer)
- Add Alembic migration for messaging tables
- Add MessagingService for conversation/message operations
- Add MessageAttachmentService for file upload handling
- Add message-related exceptions (ConversationNotFoundException, etc.)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 14:08:31 +01:00
cef80af561 feat: add job details modal for Letzshop jobs tab
- Replace browser alert with proper modal for job details view
- Show job info, status, records, timestamps in modal
- Display export file details (languages, file sizes) for export jobs
- Include error_details in API response for export and order_sync jobs
- Add selectedJobDetails state and showJobDetailsModal flag

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 23:20:16 +01:00
8c12eb1721 fix: export job records display shows files instead of mixed metrics
Previously export jobs showed "3/23" (languages/products) which was confusing.
Now shows "3/3" (files succeeded / files processed) for consistency.

- Updated log_export to track files_processed/succeeded/failed
- Products count stored in error_details for reference
- Updated documentation to explain records column meaning per job type

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 23:01:59 +01:00
b841607a05 feat: add export job tracking to Letzshop jobs tab
- Export operations now create LetzshopSyncLog entries with type 'product_export'
- Added log_export method to LetzshopExportService (follows architecture rules)
- Updated list_letzshop_jobs to include export jobs
- Added export filter option back to jobs dropdown
- Export jobs display with blue badge and cloud-upload icon

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 22:53:53 +01:00
ee690e95c9 fix: Letzshop page improvements - products, jobs, and tabs
1. Products tab now shows Letzshop marketplace products instead of vendor products
   - Uses /admin/products endpoint with marketplace=Letzshop filter
   - Fixed field names (image_link, price_numeric, sku vs vendor_sku)
   - Search now works with title, GTIN, SKU, brand

2. Jobs section moved to a separate tab
   - New "Jobs" tab between Exceptions and Settings
   - Tab watcher reloads data when switching tabs
   - Updated filter dropdown (removed export, added historical_import)

3. Product stats endpoint now accepts marketplace and vendor_name filters

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 22:34:55 +01:00
946417c4d4 refactor: move vendor product schemas to models/schema and add API-002 rule
- Add API-002 architecture rule preventing Pydantic imports in API endpoints
- Move inline Pydantic models from vendor_products.py to models/schema/vendor_product.py
- Update vendor_products.py to import schemas from proper location

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 22:21:39 +01:00
d910c1b0b3 refactor: move LetzshopExportRequest to schema layer
Follows architecture rule: Pydantic schemas belong in models/schema/

- Moved LetzshopExportRequest to models/schema/vendor.py
- Added LetzshopExportFileInfo and LetzshopExportResponse schemas
- Updated API endpoint to use proper response_model
- Removed inline BaseModel import from API file

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 22:17:55 +01:00
f2ed1362a0 fix: add missing BaseModel import for LetzshopExportRequest
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 22:15:28 +01:00
d46b676e77 feat: redesign Letzshop products tab with product listing view
Products Tab Changes:
- Converted to product listing page similar to /admin/marketplace-products
- Added Import/Export buttons in header
- Added product stats cards (total, active, inactive, last sync)
- Added search and filter functionality
- Added product table with pagination
- Import modal for single URL or all languages

Settings Tab Changes:
- Moved batch size setting from products tab
- Moved include inactive checkbox from products tab
- Added export behavior info box

Export Changes:
- New POST endpoint exports all languages (FR, DE, EN)
- CSV files written to exports/letzshop/{vendor_code}/ for scheduler pickup
- Letzshop scheduler can fetch files from this location

API Changes:
- Added vendor_id filter to /admin/vendor-products/stats endpoint
- Added POST /admin/vendors/{id}/export/letzshop for folder export

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 21:44:59 +01:00
6d239c569f fix: rename supplier_cost to cost and add tax/profit fields to product detail API
- Renamed supplier_cost to cost in VendorProductDetail schema
- Added tax_rate_percent, net_price, vat_amount, profit, profit_margin_percent
- Updated vendor_product_service to use new property names

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 21:24:08 +01:00
a19c84ea4e feat: integer cents money handling, order page fixes, and vendor filter persistence
Money Handling Architecture:
- Store all monetary values as integer cents (€105.91 = 10591)
- Add app/utils/money.py with Money class and conversion helpers
- Add static/shared/js/money.js for frontend formatting
- Update all database models to use _cents columns (Product, Order, etc.)
- Update CSV processor to convert prices to cents on import
- Add Alembic migration for Float to Integer conversion
- Create .architecture-rules/money.yaml with 7 validation rules
- Add docs/architecture/money-handling.md documentation

Order Details Page Fixes:
- Fix customer name showing 'undefined undefined' - use flat field names
- Fix vendor info empty - add vendor_name/vendor_code to OrderDetailResponse
- Fix shipping address using wrong nested object structure
- Enrich order detail API response with vendor info

Vendor Filter Persistence Fixes:
- Fix orders.js: restoreSavedVendor now sets selectedVendor and filters
- Fix orders.js: init() only loads orders if no saved vendor to restore
- Fix marketplace-letzshop.js: restoreSavedVendor calls selectVendor()
- Fix marketplace-letzshop.js: clearVendorSelection clears TomSelect dropdown
- Align vendor selector placeholder text between pages

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 20:33:48 +01:00
7f0d32c18d feat: add Exceptions tab to Letzshop management page
Adds a new "Exceptions" tab to the Letzshop marketplace page for managing
unmatched product exceptions from order imports.

Features:
- Exception list with search and status filtering
- Stats cards showing pending/resolved/ignored counts
- Resolve modal with product search
- Bulk resolve option for same GTIN
- Ignore functionality

Files:
- New: letzshop-exceptions-tab.html partial template
- Updated: marketplace-letzshop.html (tab button, panel, resolve modal)
- Updated: marketplace-letzshop.js (exception state, methods)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 14:09:57 +01:00
eb57df3bfb fix: handle order items without GTIN (e.g., vouchers)
Items like vouchers may have no GTIN at all. Previously, the placeholder
product was only created when there were missing GTINs, causing a NOT NULL
constraint violation for items with gtin=None.

Now we also check for items without GTIN and create a placeholder for them.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 14:02:52 +01:00
710fc8926f fix: commit orders immediately after creation during historical import
Orders were being flushed but only committed every 10 orders via the
progress callback. With slow imports (~1.5 min/order), no commits
happened before the first 10 orders, causing data loss if the import
failed or was interrupted.

Changes:
- Add db.commit() after each successful order creation
- Add db.rollback() on order creation failure to prevent corrupt state
- Add db.commit() after order updates

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 13:54:42 +01:00
2edf7bb628 fix: use sqlalchemy.case() instead of func.case() for conditional aggregation
func.case() is not valid SQLAlchemy - case() must be imported directly
from sqlalchemy. This was causing TypeError on /api/v1/admin/background-tasks/tasks/stats.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 13:49:36 +01:00
49523fe6fe fix: add historical import jobs to unified jobs list
Historical import jobs were not appearing in the recent jobs list because
list_letzshop_jobs() only queried marketplace_import_jobs and letzshop_sync_logs.

Changes:
- Add LetzshopHistoricalImportJob query to list_letzshop_jobs()
- Add current_phase and error_message fields to LetzshopJobItem schema
- Fixed stuck job 8 (marked as failed)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 13:18:07 +01:00
d6d658dd85 feat: add order item exception system for graceful product matching
Replaces the "fail on missing product" behavior with graceful handling:
- Orders import even when products aren't found by GTIN
- Unmatched items link to a per-vendor placeholder product
- Exceptions tracked in order_item_exceptions table for QC resolution
- Order confirmation blocked until exceptions are resolved
- Auto-matching when products are imported via catalog sync

New files:
- OrderItemException model and migration
- OrderItemExceptionService with CRUD and resolution logic
- Admin and vendor API endpoints for exception management
- Domain exceptions for error handling

Modified:
- OrderItem: added needs_product_match flag and exception relationship
- OrderService: graceful handling with placeholder products
- MarketplaceProductService: auto-match on product import
- Letzshop confirm endpoints: blocking check for unresolved exceptions

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 13:11:47 +01:00
e0a0da85f8 fix: validate products before creating order to follow architecture rules
Restructured create_letzshop_order to follow the "validate first, then write"
architecture pattern:

Phase 1 (Read-only validation):
- Check if order already exists
- Parse all inventory units and collect GTINs
- Batch query all products by GTIN (single query instead of N queries)
- Validate all products exist - raise ValidationException BEFORE any writes

Phase 2 (Database writes):
- Only after all validation passes, create customer, order, and items

This ensures if validation fails, no database modifications happen, so the
endpoint/task simply doesn't commit - no rollback needed.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 21:59:18 +01:00
d2f1ace21a Revert "fix: add db.rollback() to prevent session state corruption during historical import"
This reverts commit fadc9036a2.
2025-12-19 21:57:31 +01:00
fadc9036a2 fix: add db.rollback() to prevent session state corruption during historical import
When create_letzshop_order raises an exception (e.g., product not found by GTIN)
after flushing the order to the database, the session is left in an inconsistent
state. Without rollback, subsequent database operations fail or hang, causing
the import to get stuck at "0 processed...".

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 21:54:11 +01:00
06fbf8e53c fix: add missing get_vendors_with_orders_admin method
Add the missing method to OrderService that was being called
from the admin orders API endpoint.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 21:49:42 +01:00
2e6f8fdb8a feat: update frontend for unified order model
Update all frontend templates and JavaScript to use new unified Order model:
- Orders tab: use status field, processing/cancelled values, items array
- Order detail: use snapshot fields, items array, tracking_provider
- JavaScript: update API params (status vs sync_status), orderStats fields
- Tracking modal: use tracking_provider instead of tracking_carrier
- Order items modal: use items array with item_state field

All status mappings:
- pending → pending (unconfirmed)
- processing → confirmed (at least one item available)
- cancelled → declined (all items unavailable)
- shipped → shipped (with tracking)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 21:38:02 +01:00
c49b80ce41 feat: complete unified order model integration for Letzshop API
Update API endpoints and schemas to use the unified Order model:
- Update Letzshop order schemas with OrderItem support
- Update API responses to use new field names (external_*, status, etc.)
- Update confirm/reject endpoints to use OrderItem.external_item_id
- Update Letzshop order service for unified Order model queries
- Update documentation to reflect completed implementation

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 21:27:24 +01:00
6a10fbba10 docs: update Letzshop order import documentation
- Update implementation guide with unified order approach
- Add mkdocs navigation entry
- Add background task for order sync
- Add debug script for historical imports

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 21:18:55 +01:00
8e8d1d1ac0 wip: update frontend templates for Letzshop order management
- Add Letzshop order detail page template
- Update orders list template
- Update Letzshop orders tab with improved UI
- Add JavaScript for order confirmation flow

Note: Frontend needs alignment with new unified order schema.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 21:18:48 +01:00
fceaba703e wip: update Letzshop service and API for historical imports
- Add historical order import functionality
- Add order detail page route
- Update API endpoints for order confirmation flow

Note: These files need further updates to use the new unified order model.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 21:18:39 +01:00
cb6656815e feat: create unified order service for all channels
- Add create_letzshop_order() for importing Letzshop orders
- Add find_or_create_customer() for marketplace imports (inactive by default)
- Add set_order_tracking() for shipping updates
- Add update_item_state() for marketplace confirmation flow
- Add get_order_by_external_shipment_id() for Letzshop lookups
- Update all methods to use snapshot fields instead of address FKs
- Products must exist by GTIN - raises error if not found

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 21:17:57 +01:00
3f1f6ad852 feat: add item-level order confirmation/decline support
Per Letzshop API, each inventory unit must be confirmed/declined individually.
This enables partial confirmation (some items confirmed, others declined).

Admin API endpoints:
- POST /vendors/{id}/orders/{id}/confirm - confirm all items
- POST /vendors/{id}/orders/{id}/reject - decline all items
- POST /vendors/{id}/orders/{id}/items/{id}/confirm - confirm single item
- POST /vendors/{id}/orders/{id}/items/{id}/decline - decline single item

Order detail modal now shows:
- Product name, EAN, SKU, MPN, price per item
- Per-item state badge (unconfirmed/confirmed/declined)
- Per-item confirm/decline buttons for pending items
- Bulk confirm/decline all buttons

Order status logic:
- If all items declined -> order is "declined"
- If any item confirmed -> order is "confirmed"
- Partial confirmation supported

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 21:27:56 +01:00
12018fc088 refactor: update terminology from 'rejected' to 'declined'
- Change UI labels to use 'Declined' (matching Letzshop terminology)
- Rename rejectOrder() to declineOrder() in JavaScript
- Add Declined stats card to orders dashboard
- Keep internal sync_status value as 'rejected' for backwards compatibility

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 21:23:26 +01:00
83fcaf84ac fix: correct order sync_status and historical import display
- Fix historical import to also update sync_status when it's out of
  sync with letzshop_state (e.g., confirmed orders showing as pending)
- Fix frontend to read stats from response.statistics nested object
- Orders with matching letzshop_state but wrong sync_status now get fixed

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 21:13:01 +01:00
f3dc143f1d chore: add shared components and update docs
- Add vendor selector component for admin pages
- Add input macros for form handling
- Add truck icon for shipping UI
- Update vendor operations expansion plan
- Update mkdocs configuration
- Update dependencies

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 21:05:50 +01:00
6c6b5d259d feat: add admin orders management
- Add admin API endpoints for order management
- Add orders page with vendor selector and filtering
- Add order schemas for admin operations
- Support order status tracking and management

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 21:05:27 +01:00