Merge pull request #22 from beatz174-bit/codex/provide-csv-template-for-product-seed-data
Add CSV template for product seed data
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# Product seed CSV template
|
||||
|
||||
Use `products_seed_template.csv` to author product seed data that can be imported into the Dexie database. Populate one row per product and ensure the `category` column contains the product's category name.
|
||||
|
||||
## Columns
|
||||
- **name**: Product display name.
|
||||
- **category**: Category label for the product. Codex will generate the category table from the unique values in this column.
|
||||
- **unit_type**: Unit of measure (e.g., `units`, `packs`, `bottles`).
|
||||
- **bulk_name**: Label for the bulk unit (e.g., `carton`, `box`).
|
||||
- **units_per_bulk**: Number of individual units contained in a bulk item.
|
||||
- **barcode**: Optional barcode string. Leave blank if unknown.
|
||||
- **archived**: `true` or `false` to indicate whether the product is archived.
|
||||
|
||||
## Usage flow for Codex
|
||||
1. Read `products_seed_template.csv`.
|
||||
2. Seed `products` with the CSV rows (generate UUIDs and timestamps per record).
|
||||
3. Build a **unique, alphabetized** list of categories from the `category` column and seed the `categories` table with those values (UUIDs plus timestamps).
|
||||
4. If necessary, seed `areas` separately using the existing defaults in `src/db/seed.ts` or an equivalent CSV.
|
||||
@@ -0,0 +1,4 @@
|
||||
name,category,unit_type,bulk_name,units_per_bulk,barcode,archived
|
||||
Sparkling Water 500ml,Drinks,units,carton,24,012345678905,false
|
||||
Salted Chips 50g,Snacks,units,carton,48,023456789012,false
|
||||
Chocolate Bar,Confectionery,units,box,30,034567890129,false
|
||||
|
Reference in New Issue
Block a user