7.0 KiB
Quick CSV Import Test Guide
Starting the Application
cd src/PowderCoating.Web
dotnet run
Access at: https://localhost:58461
Login Credentials
- SuperAdmin:
superadmin@powdercoating.com/SuperAdmin123! - Company Admin:
admin@demo.com/CompanyAdmin123!
Test Steps
1. Navigate to CSV Import
- Login to the application
- Click Tools in the navigation menu
- Scroll down to the CSV Bulk Import card (yellow border)
- You'll see 3 tabs: Customers, Catalog Items, Inventory
2. Test Customer Import
Download Template
- Click on Customers tab
- Click Download Customer Template button
- Open the downloaded CSV file in Excel or text editor
- You'll see headers and one example row
Modify Template
Add a few test customers:
CompanyName,ContactName,Email,Phone,Address,City,State,ZipCode,CustomerType,PricingTierCode,CreditLimit,PaymentTerms,TaxExempt,Notes
Test Company 1,Alice Smith,alice@test1.com,555-0001,100 Test St,Chicago,IL,60601,Commercial,Gold,10000,Net 30,false,Test customer 1
Test Company 2,Bob Jones,bob@test2.com,555-0002,200 Test Ave,Chicago,IL,60602,Commercial,Silver,5000,Net 15,false,Test customer 2
Home User,John Doe,john@home.com,555-0003,300 Home Ln,Chicago,IL,60603,Individual,,0,Cash,true,Individual customer
Import
- Save the CSV file
- Click Choose File in the Upload section
- Select your modified CSV file
- Click Import Customers button
- Watch for:
- Loading spinner appears
- After processing, results card appears showing:
- Number of records imported (green)
- Number of errors (red)
- Total rows processed (blue)
- Toast notification in bottom-right corner
- Verify by going to Customers page - you should see your new customers
3. Test Catalog Item Import
Download Template
- Click on Catalog Items tab
- Click Download Catalog Template button
- Open the downloaded CSV file
Modify Template
Add items with hierarchical categories:
CategoryPath,ItemName,SKU,Description,BasePrice,UnitOfMeasure,EstimatedWeight,EstimatedSurfaceArea,RequiresSandblasting,RequiresMasking,IsActive
Automotive/Wheels/Standard,Car Wheel 17",WHL-17-STD,Standard 17 inch wheel,85.00,each,18.0,5.0,true,true,true
Automotive/Wheels/Performance,Car Wheel 18" Sport,WHL-18-SPORT,Performance 18 inch wheel,120.00,each,20.0,5.5,true,true,true
Industrial/Railings/Commercial,Stair Handrail 6ft,RAIL-6FT-STR,6 foot stair handrail,95.00,section,15.0,8.0,true,false,true
Furniture/Outdoor/Patio,Patio Chair Frame,FURN-CHAIR-PAT,Patio chair metal frame,45.00,each,12.0,6.0,true,false,true
Import
- Save and import the CSV file
- Check results - you should see 4 items imported
- Important: The categories will be auto-created!
- "Automotive" → "Wheels" → "Standard"
- "Automotive" → "Wheels" → "Performance"
- "Industrial" → "Railings" → "Commercial"
- "Furniture" → "Outdoor" → "Patio"
- Verify by going to Catalog page - browse the category tree
4. Test Inventory Item Import
Download Template
- Click on Inventory tab
- Click Download Inventory Template button
Modify Template
Add powder coating inventory:
SKU,ItemName,CategoryName,Manufacturer,ColorName,ColorCode,QuantityInStock,UnitOfMeasure,UnitCost,ReorderPoint,ReorderQuantity,Notes
PWD-RED-001,Red Powder Coating,Powder Coatings,Tiger Drylac,Red,RAL 3020,400,lbs,3.85,80,150,Traffic red
PWD-BLU-001,Blue Powder Coating,Powder Coatings,Tiger Drylac,Blue,RAL 5005,300,lbs,3.95,60,120,Signal blue
PWD-GRN-001,Green Powder Coating,Powder Coatings,Axalta,Green,RAL 6018,250,lbs,4.10,50,100,Yellow green
SAND-MEDIA-001,Sandblasting Media,Consumables,Generic,Brown,,500,lbs,1.25,100,300,Aluminum oxide
Import
- Save and import the CSV file
- Check results - should show 4 items imported
- Verify by going to Inventory page
5. Test Error Handling
Duplicate Detection
- Try importing the same CSV file again
- You should see:
- 0 records imported
- Warnings about duplicate emails/SKUs
- Detailed list of skipped rows
Missing Required Fields
Create a CSV with missing CompanyName:
CompanyName,ContactName,Email,Phone,Address,City,State,ZipCode,CustomerType,PricingTierCode,CreditLimit,PaymentTerms,TaxExempt,Notes
,Missing Company,missing@test.com,555-9999,,,,,,,,,
Expected: Error message "Row 2: CompanyName is required."
Invalid Pricing Tier
CompanyName,ContactName,Email,Phone,Address,City,State,ZipCode,CustomerType,PricingTierCode,CreditLimit,PaymentTerms,TaxExempt,Notes
Test Company,Jane Doe,jane@test.com,555-8888,400 Test St,Chicago,IL,60604,Commercial,Diamond,15000,Net 30,false,Invalid tier
Expected: Warning "Pricing tier 'Diamond' not found. Customer will have no pricing tier." but customer still imported.
6. Verify Results
After all imports:
-
Customers Page:
- Should see all imported customers
- Check that pricing tiers are assigned correctly
- Verify contact information is accurate
-
Catalog Page:
- Expand category tree to see hierarchical structure
- Verify all items are under correct categories
- Check that prices and SKUs are correct
-
Inventory Page:
- See all powder coatings and consumables
- Verify quantities, costs, and reorder points
- Check color codes and manufacturer info
Common Issues
Issue: "No file provided or file is empty"
Solution: Make sure you selected a file before clicking Import
Issue: "Only CSV files are allowed"
Solution: Save file as .csv (not .xlsx or .txt)
Issue: "Pricing tier 'XXX' not found"
Solution: Use Standard, Silver, Gold, or Platinum (case-insensitive)
Issue: Categories not showing up
Solution:
- Check CategoryPath format: "Parent/Child/GrandChild"
- No leading/trailing slashes
- Use forward slashes only
Issue: Build errors
Solution: Make sure CsvHelper is installed:
cd src/PowderCoating.Infrastructure
dotnet add package CsvHelper
cd ../PowderCoating.Application
dotnet add package CsvHelper
Success Indicators
✅ Templates download successfully ✅ CSV files import without errors ✅ Success counts match expected numbers ✅ Data appears in respective pages (Customers, Catalog, Inventory) ✅ Categories auto-created for catalog items ✅ Duplicates are detected and skipped ✅ Error messages are clear and actionable ✅ Toast notifications appear ✅ Results card shows detailed summary
Next Steps
Once basic import is working:
- Try importing larger files (50+ rows)
- Test with deep category hierarchies (4-5 levels)
- Verify multi-tenancy (different companies can't see each other's imports)
- Export QuickBooks data and re-import via CSV
- Use CSV import for initial data seeding instead of manual entry
Performance Benchmarks
Expected import times (approximate):
- 10 rows: < 1 second
- 50 rows: < 3 seconds
- 100 rows: < 5 seconds
- 500 rows: < 15 seconds
- 1000 rows: < 30 seconds
Times will vary based on:
- Number of categories to create
- Database size
- Server performance