v0.16.0 — HomeBox CSV import + sold lifecycle + custom fields
Bring an existing HomeBox inventory straight in, and capture the fields HomeBox has that we were missing (skipping asset IDs per Tony). - Item: soldTo/soldPrice/soldDate/soldNotes + flexible customFields (JSON, e.g. VIN / oil weight for vehicles); both editable in the item dialog and shown on the detail page - Pure HomeBox CSV parser (src/lib/inventory/homebox-import.ts, +5 tests) — RFC4180 quoting (commas/newlines/escaped quotes in fields), HomeBox's 0001-* null dates and 0 = empty price, semicolon labels, HB.field.* custom columns, nested 'A / B' location paths - Import service + /api/v1/items/import: find-or-creates the nested locations and labels, creates items, recomputes location paths, returns a summary - Inventory 'Import' button: paste/upload CSV, review every row with checkboxes (uncheck to skip), then import. Preview parses client-side (parser is pure) - Verified end-to-end: nested locations, split labels, sold + custom fields, skip, quoted names, null-date handling. tsc + 38 tests + build green Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Item" ADD COLUMN "customFields" JSONB,
|
||||
ADD COLUMN "soldDate" TIMESTAMP(3),
|
||||
ADD COLUMN "soldNotes" TEXT,
|
||||
ADD COLUMN "soldPrice" DECIMAL(10,2),
|
||||
ADD COLUMN "soldTo" TEXT;
|
||||
@@ -325,6 +325,15 @@ model Item {
|
||||
modelNumber String?
|
||||
brand String? // brand / manufacturer
|
||||
|
||||
// Sold lifecycle (HomeBox parity)
|
||||
soldTo String?
|
||||
soldPrice Decimal? @db.Decimal(10, 2)
|
||||
soldDate DateTime?
|
||||
soldNotes String?
|
||||
|
||||
// Custom fields — flexible key/value (e.g. VIN, "Oil Weight": "5W-30")
|
||||
customFields Json?
|
||||
|
||||
// Consumable attributes (Pantry phase)
|
||||
barcode String?
|
||||
bestBefore DateTime?
|
||||
|
||||
Reference in New Issue
Block a user