Vendor Operations Expansion Migration Plan
Overview
Objective: Expand the admin "Vendor Operations" section to provide comprehensive vendor storefront management capabilities, allowing administrators to manage vendor operations on their behalf.
Scope: Products, Inventory, Orders, Shipping, and Customers management from the admin panel.
Status: In Progress
Current State
The admin sidebar has a "Vendor Operations" section (formerly "Product Catalog") with:
| Feature |
Status |
Description |
| Marketplace Products |
✅ Complete |
View/manage products from marketplace imports |
| Vendor Products |
✅ Complete |
View/manage vendor-specific products |
| Customers |
✅ Complete |
Customer management (moved from Platform Admin) |
| Inventory |
🔲 Planned |
Stock levels, adjustments, low-stock alerts |
| Orders |
🔲 Planned |
Order management, status updates, fulfillment |
| Shipping |
🔲 Planned |
Tracking, carriers, shipping rules |
Target Architecture
Design Principles
- Vendor Selection Pattern: All pages should support vendor filtering/selection
- Bulk Operations: Admin should be able to perform bulk actions across vendors
- Audit Trail: All admin actions on behalf of vendors should be logged
- Permission Granularity: Future support for role-based access to specific features
Phase 1: Foundation (Completed)
1.2 Files Modified
| File |
Changes |
app/templates/admin/partials/sidebar.html |
Section rename, Customers move |
static/admin/js/init-alpine.js |
Section key update, page mapping |
Phase 2: Inventory Management (Planned)
2.1 Features
| Feature |
Priority |
Description |
| Stock Overview |
High |
Dashboard showing stock levels across vendors |
| Stock Adjustments |
High |
Manual stock adjustments with reason codes |
| Low Stock Alerts |
Medium |
Configurable thresholds and notifications |
| Stock History |
Medium |
Audit trail of all stock changes |
| Bulk Import/Export |
Low |
CSV import/export for stock levels |
2.2 Database Changes
2.3 API Endpoints
| Method |
Endpoint |
Description |
| GET |
/api/v1/admin/inventory |
List inventory across vendors |
| GET |
/api/v1/admin/inventory/vendors/{id} |
Vendor-specific inventory |
| POST |
/api/v1/admin/inventory/adjust |
Create stock adjustment |
| GET |
/api/v1/admin/inventory/low-stock |
Low stock alerts |
| PATCH |
/api/v1/admin/inventory/thresholds |
Update alert thresholds |
2.4 Frontend Components
| Component |
Description |
inventory.html |
Main inventory page with vendor selector |
inventory.js |
Alpine.js controller |
inventory-table.html |
Stock levels table partial |
adjustment-modal.html |
Stock adjustment form modal |
Phase 3: Order Management (Planned)
3.1 Features
| Feature |
Priority |
Description |
| Order List |
High |
View all orders across vendors |
| Order Details |
High |
Full order information and history |
| Status Updates |
High |
Change order status on behalf of vendor |
| Order Notes |
Medium |
Internal notes for admin/vendor communication |
| Refund Processing |
Medium |
Handle refunds and cancellations |
| Order Export |
Low |
Export orders to CSV/Excel |
3.2 Database Changes
3.3 API Endpoints
| Method |
Endpoint |
Description |
| GET |
/api/v1/admin/orders |
List all orders with filters |
| GET |
/api/v1/admin/orders/{id} |
Order details |
| PATCH |
/api/v1/admin/orders/{id}/status |
Update order status |
| POST |
/api/v1/admin/orders/{id}/notes |
Add admin note |
| POST |
/api/v1/admin/orders/{id}/refund |
Process refund |
Phase 4: Shipping Management (Planned)
4.1 Features
| Feature |
Priority |
Description |
| Shipment Tracking |
High |
Track shipments across carriers |
| Carrier Management |
Medium |
Configure available carriers per vendor |
| Shipping Rules |
Medium |
Weight-based, zone-based pricing rules |
| Label Generation |
Low |
Integration with carrier APIs |
| Delivery Reports |
Low |
Delivery success rates, timing analytics |
4.2 Database Changes
4.3 API Endpoints
| Method |
Endpoint |
Description |
| GET |
/api/v1/admin/shipping/carriers |
List carriers |
| GET |
/api/v1/admin/shipping/vendors/{id} |
Vendor shipping config |
| PATCH |
/api/v1/admin/shipping/vendors/{id} |
Update vendor shipping |
| GET |
/api/v1/admin/shipping/rules |
List shipping rules |
| POST |
/api/v1/admin/shipping/rules |
Create shipping rule |
Implementation Checklist
Phase 1: Foundation ✅
Phase 2: Inventory
Phase 3: Orders
Phase 4: Shipping
Testing Requirements
Unit Tests
- Service layer tests for each new service
- Model validation tests
Integration Tests
- API endpoint tests with authentication
- Database constraint tests
- Transaction rollback tests
E2E Tests (Future)
- Admin workflow tests
- Vendor operation scenarios
Rollback Plan
Each phase is independent and can be rolled back:
- Database: Each phase has its own migration file with down migration
- API: New endpoints don't affect existing ones
- Frontend: Menu items can be hidden by commenting out in sidebar.html
Related Documentation