supplier-management
Manage supplier pricelists, process Excel uploads, handle product catalogs, create selections, and generate stock reports. Use when working with supplier data, pricelist uploads, product selection workflows, or inventory management.
When & Why to Use This Skill
This Claude skill provides expert assistance for the NXT-SPP (Supplier Pricelist Processing) system, enabling seamless management of supplier pricelists, Excel data uploads, and product catalogs. It automates the end-to-end workflow from file validation and data merging to generating actionable stock reports, significantly enhancing procurement and inventory management efficiency through intelligent automation.
Use Cases
- Automated Pricelist Ingestion: Streamline the process of uploading and parsing bulk supplier pricelists in Excel or CSV formats, reducing manual data entry and human error.
- Data Quality & Validation: Automatically verify supplier data completeness, SKU uniqueness, and price accuracy before merging updates into the master product catalog.
- Inventory Selection Management: Efficiently create and manage product selections to define stocking parameters, allowing for quick activation of new inventory items.
- Dynamic Stock Reporting: Generate and export comprehensive inventory reports by supplier or category to monitor stock-on-hand and inform strategic purchasing decisions.
| name | supplier-management |
|---|---|
| description | Manage supplier pricelists, process Excel uploads, handle product catalogs, create selections, and generate stock reports. Use when working with supplier data, pricelist uploads, product selection workflows, or inventory management. |
| allowed-tools | Read, Edit, Grep, Glob, Bash, Write |
Supplier Management & Pricelist Processing
Expert assistance for the NXT-SPP (Supplier Pricelist Processing) system in MantisNXT.
System Overview
The NXT-SPP system handles the complete workflow:
- Upload - Import supplier pricelists (Excel/CSV)
- Validate - Verify data quality and completeness
- Merge - Integrate products into catalog
- Select - Create product selections for inventory
- Stock Reports - Generate inventory stock on hand reports
Key Components
Pricelist Upload
// Upload endpoint
POST /api/suppliers/pricelists/upload
// Alternative SPP upload
POST /api/spp/upload
// File types supported
- .xlsx (Excel)
- .csv (CSV)
- .xls (Legacy Excel)
Supplier Dashboard
Location: src/components/suppliers/UnifiedSupplierDashboard.tsx
Features:
- View all suppliers
- Upload pricelists
- Manage product catalogs
- Create selections
- Generate stock reports
Portfolio Dashboard
Location: src/components/spp/PortfolioDashboard.tsx
Features:
- Overview of uploads and metrics
- Recent upload history
- Active selection status
- Quick actions
Common Tasks
Upload a Pricelist
# Test pricelist upload
curl -X POST "http://localhost:3000/api/suppliers/pricelists/upload" \
-F "file=@path/to/pricelist.xlsx" \
-F "supplierId=123"
Check Upload Status
Uploads go through these statuses:
received- File uploaded successfullyvalidating- Checking data qualityvalidated- Data is validmerged- Products added to catalogfailed- Upload encountered errors
Create a Selection
A selection defines which products to stock:
- Choose products from supplier catalogs
- Set quantities and parameters
- Activate selection
- Generate stock reports
Generate Stock Report
With an active selection:
- Navigate to Stock Reports tab
- Select report type (by supplier, by category, etc.)
- Export to Excel or view in UI
Database Schema
Core Tables
-- Suppliers
CREATE TABLE suppliers (
supplier_id SERIAL PRIMARY KEY,
supplier_name VARCHAR(255),
contact_info JSONB
);
-- Pricelist Uploads
CREATE TABLE pricelist_uploads (
upload_id SERIAL PRIMARY KEY,
supplier_id INTEGER REFERENCES suppliers,
filename VARCHAR(255),
status VARCHAR(50),
received_at TIMESTAMP,
row_count INTEGER
);
-- Products
CREATE TABLE products (
product_id SERIAL PRIMARY KEY,
sku VARCHAR(100) UNIQUE,
supplier_id INTEGER REFERENCES suppliers,
product_name VARCHAR(500),
unit_price DECIMAL(10,2),
category VARCHAR(100)
);
-- Selections
CREATE TABLE selections (
selection_id SERIAL PRIMARY KEY,
selection_name VARCHAR(255),
is_active BOOLEAN,
created_at TIMESTAMP
);
-- Selection Items
CREATE TABLE selection_items (
item_id SERIAL PRIMARY KEY,
selection_id INTEGER REFERENCES selections,
product_id INTEGER REFERENCES products,
quantity INTEGER
);
File Upload Processing
Excel File Structure
Expected columns (flexible mapping):
- SKU / Part Number / Item Code
- Product Name / Description
- Unit Price / Cost / Price
- Category / Type / Group
- Supplier Part # / Supplier SKU
- UOM (Unit of Measure)
- Stock Status
Processing Flow
File Validation
- Check file type and size
- Verify readable format
- Scan for required columns
Data Extraction
- Parse Excel/CSV rows
- Map columns to schema
- Clean and normalize data
Product Matching
- Match by SKU
- Check for duplicates
- Create new products or update existing
Merge to Catalog
- Insert new products
- Update prices
- Track price changes
- Log all modifications
Service Layer
PricelistService
Location: src/lib/services/PricelistService.ts
Key methods:
uploadPricelist()- Handle file uploadvalidatePricelist()- Validate dataprocessPricelist()- Parse and extract datamergePricelist()- Merge into catalog
React Query Hooks
Location: src/hooks/useNeonSpp.ts
Available hooks:
useDashboardMetrics()- Get overview metricsusePricelistUploads()- List recent uploadsuseActiveSelection()- Get active selectionuseSuppliers()- List all suppliersuseProducts()- Query product catalog
Common Issues & Solutions
Upload Fails
Check:
- File format is supported (.xlsx, .csv)
- File size is within limits
- File has required columns
- Data types match expectations
- No duplicate SKUs within file
Products Not Appearing
Check:
- Upload status is "merged"
- Products aren't filtered out
- Supplier_id is correct
- SKUs don't have validation errors
Selection Not Activating
Check:
- Only one selection can be active
- Selection has items
- Referenced products exist
- Database constraints are met
Stock Reports Empty
Check:
- Active selection exists
- Selection has items
- Products are in inventory
- Correct filters applied
API Endpoints
// Suppliers
GET /api/suppliers // List suppliers
POST /api/suppliers // Create supplier
GET /api/suppliers/:id // Get supplier details
// Pricelists
POST /api/suppliers/pricelists/upload // Upload pricelist
GET /api/suppliers/pricelists // List uploads
GET /api/suppliers/pricelists/:id // Upload details
// Products
GET /api/products // Query products
GET /api/products/:id // Product details
// Selections
GET /api/selections // List selections
POST /api/selections // Create selection
PUT /api/selections/:id/activate // Activate selection
GET /api/selections/active // Get active selection
// Reports
GET /api/stock-reports // Generate reports
GET /api/stock-reports/export // Export to Excel
Best Practices
- Validate uploads before merging to prevent data quality issues
- Test with small files first to verify column mapping
- Keep one active selection at a time for clarity
- Use consistent SKU format across suppliers
- Review price changes before activating selections
- Export stock reports regularly for record keeping
- Monitor upload status for errors
- Clean supplier data for better matching
Testing Workflow
# 1. Check suppliers exist
curl "http://localhost:3000/api/suppliers"
# 2. Upload test pricelist
curl -X POST "http://localhost:3000/api/suppliers/pricelists/upload" \
-F "file=@test-pricelist.xlsx" \
-F "supplierId=1"
# 3. Monitor upload status
curl "http://localhost:3000/api/suppliers/pricelists"
# 4. Verify products merged
curl "http://localhost:3000/api/products?supplierId=1"
# 5. Create selection
curl -X POST "http://localhost:3000/api/selections" \
-H "Content-Type: application/json" \
-d '{"name": "Test Selection", "items": [...]}'
# 6. Generate stock report
curl "http://localhost:3000/api/stock-reports"
Performance Considerations
- Large pricelists (>10,000 rows) process in background
- Use batch operations for bulk product updates
- Index SKU columns for faster lookups
- Cache frequently accessed supplier data
- Paginate product lists for better UX
Data Integrity
- Foreign keys enforce supplier-product relationships
- Unique constraints prevent duplicate SKUs
- Validation rules ensure data quality
- Audit logs track all changes
- Soft deletes preserve history