Wheels — Import
Import wheel products from a CSV file. Automatically resolves human-readable names to database IDs, generates part numbers and descriptions, creates molds if needed, and inserts products in a single transaction.
Usage: efision -r <region> wheels import <file> [--dry-run]
| Flag | Default | Description |
|---|---|---|
--dry-run | false | Validate and preview without inserting |
CSV Format
All 16 columns are required in the header. See the table below for which values can be empty.
brand,model,diameter,width,profile,directional,holes,pcd1,pcd2,et,cb,bolt,cap,base_finish,procedures,status
INOVIT,Speed,19,9.5,0,,5,112,,40,73.1,32x15x60,CP506AL68,Black,"Machined Face,Dark Tint,Satin Lacquer",inactive
Hartes Metal,Strike,22,12.0,0,,8,165.1,,-44,125.2,34x16x60,CP708PS130,Black,Milled Dimple,inactive
| Column | Type | Can be empty | Empty default |
|---|---|---|---|
brand | string | No | — |
model | string | No | — |
diameter | int | No | — |
width | float | No | — |
profile | int | Yes | 0 |
directional | string | Yes | “” (non-directional) |
holes | int | No | — |
pcd1 | string | No | — |
pcd2 | string | Yes | “” (single PCD) |
et | int | No | — |
cb | float | No | — |
bolt | string | No | — |
cap | string | No | — |
base_finish | string | No | — |
procedures | string | Yes | “” (no procedures) |
status | string | No | active/inactive/1/0 |
Name Resolution
Brand, model, bolt, cap, finish, and procedure names are resolved to database IDs. The model column matches against both pdName and pdNO in ProductDesign.
Workflow
- Parses CSV and validates required fields
- Resolves all names to database IDs (with in-memory caching)
- Auto-creates
ProductMoldif no mold exists for the design + diameter + width combination - Generates part numbers using the V1 formula (same as
check-pn) - Generates descriptions (same formula as batch-update)
- Checks for duplicate specs already in the database (skips duplicates)
- Shows a preview table with generated part numbers
- If
--dry-run: stops here - Prompts for confirmation (
y/N) - Inserts
Product+ProductWheels+CategoryProductin a single transaction - Links design-level appendant categories (
ProductAndMoldAppendant)
Examples
Dry run (validate only):
efision -r us wheels import new-wheels.csv --dry-run
Efision Wheels Import
============================================================
Region: US
Mode: Dry run (no changes)
File: new-wheels.csv
Parsed 41 row(s) from CSV
41 wheel(s) to import:
# Brand Model Size HxPCD ET CB Finish Procedures Status Part Number
1 INOVIT Speed 19x9.5 5x112 40 73.10 Black Machined Face/Dark Tint/... Inactive 02319M5T40KMFTDTM1ANA
2 INOVIT Speed 20x10 5x120 40 72.60 Black Machined Face/Dark Tint/... Inactive 02320N5B40KMFTDTM1BNA
...
Dry run complete. Run without --dry-run to import.
Import with duplicate detection:
efision -r us wheels import new-wheels.csv
3 row(s) have duplicate specs already in database:
Row Existing pID Existing PN
5 14580 02319M5TF38KMFTDTM1ANA
...
38 wheel(s) to import:
...
Import 38 wheel product(s) into US region? [y/N] yes
Successfully imported 38 wheel product(s)!
Errors shown for unresolvable values:
efision -r demo wheels import bad-data.csv --dry-run
2 row(s) have errors:
Row Field Error
5 bolt bolt '29x15x60' not found
8 model model 'NewDesign' not found for brand 'INOVIT'
Notes
- All inserts execute within a single database transaction (all-or-nothing)
- Part numbers are generated using the same V1 formula as
check-pn - Molds are auto-created when a design + size combination doesn’t exist yet (initial ET/PCD/CB ranges set to the row’s values)
- Duplicate specs (matching design + all wheel specs) are detected and skipped, not rejected
proceduresuses comma-separated names (e.g."Machined Face,Dark Tint,Satin Lacquer"), same asbatch-updatebrandmust matchProductBrand.pbNameexactly;modelmatchesProductDesign.pdNameorpdNO- Lookup errors (missing bolt, cap, finish, procedure, PCD code, CB code, width code) are reported per-row with the specific field and value that failed