From 0577e3224061b1462db8ee6d209bd9ff49b7463a Mon Sep 17 00:00:00 2001 From: "benjamin.baker" Date: Tue, 25 Aug 2026 17:12:01 -0400 Subject: [PATCH] add CSV import guide and clarify Azure export location Adds a concise native-CSV import guide covering exact headers, required columns, foreign-key-by-name resolution, import order, and the do-not-edit rule for Azure/Thor exports. Also clarifies the Import Site Assets Azure card that Bulk operations lives in the top command bar of the group Members page, matching the Entra UI. --- docs/CSV-IMPORT-GUIDE.md | 72 +++++++++++++++++++ .../src/views/settings/ImportSiteAssets.vue | 2 +- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 docs/CSV-IMPORT-GUIDE.md diff --git a/docs/CSV-IMPORT-GUIDE.md b/docs/CSV-IMPORT-GUIDE.md new file mode 100644 index 00000000..1cc0a716 --- /dev/null +++ b/docs/CSV-IMPORT-GUIDE.md @@ -0,0 +1,72 @@ +# ShopDB CSV Import Guide + +Short version: one CSV per table, a header row of exact column names, one record +per row. The importer matches on natural keys, so re-importing updates instead of +duplicating. + +## Rules for hand-built native CSVs + +1. First row is the header. Use the exact column names below, lowercase, no spaces. +2. Include every REQUIRED column. Other columns are optional; drop the ones you + do not use. +3. Foreign keys are entered by NAME, not id. Put the human name and the importer + resolves it: `assettypeid=machine`, `statusid=In Use`, `locationid=A1`, + `vendorid=Haas Automation`. The referenced record must already exist (import + lookup tables first, see order below). +4. Booleans (`isactive`, etc.) are `1`/`0` or `true`/`false`. Leave blank for the + default. +5. Dates are `YYYY-MM-DD`. Leave blank if unknown. +6. Leave a cell blank to skip it. Do not type `NULL` or `N/A`. +7. Save as UTF-8 CSV, comma-separated. ASCII only (no smart quotes, no em-dashes). + +## Import order (dependencies first) + +assetstatuses, assettypes, locationtypes, modeltypes, computertypes, +machinetypes, businessunits, locations, vendors, models, operatingsystems, assets, +computers, machines. + +An asset row must exist before its `computers`/`machines` subtype row: the subtype +links back with `assetid` (the asset's `assetnumber`). + +## Columns (REQUIRED in bold) + +- assetstatuses: **status**, description, color, isactive +- locationtypes: **locationtype**, description, color, isactive +- modeltypes: **modeltype**, category, description, icon, isactive +- computertypes: **computertype**, description, icon, color, isactive +- machinetypes: **machinetype**, description, icon, color, isactive +- businessunits: **businessunit**, code, description, parentid, isactive +- locations: **locationname**, building, floor, room, description, locationtypeid, + parentlocationid, isactive +- vendors: **vendor**, description, website, supportphone, supportemail, notes, + isactive +- models: **modelnumber**, modeltypeid, vendorid, description, notes, isactive +- operatingsystems: **osname**, osversion, architecture, endoflife, isactive +- assets: **assetnumber**, **assettypeid**, name, serialnumber, gaugelabreference, + maintenancereference, statusid, locationid, businessunitid, notes, isactive +- computers: **assetid**, computertypeid, hostname, osid, vendorid, modelnumberid, + loggedinuser, isactive +- machines: **assetid**, machinetypeid, vendorid, modelnumberid, requiresmanualconfig, + islocationonly, lastmaintenancedate, nextmaintenancedate, maintenanceintervaldays, + controllervendorid, controllermodelid, isactive + +Measuring tools are assets: add an `assets` row with `assettypeid=measuring_tool`. + +## Example (assets.csv) + + assetnumber,name,serialnumber,assettypeid,statusid,locationid + MILL-01,Haas VF-2 Mill,SN1001,machine,In Use,A1 + PC-01,Shopfloor PC 01,SN2001,computer,In Use,B1 + MIC-01,Mitutoyo Micrometer,SN3001,measuring_tool,In Use,Gage Lab + +Then machines.csv links the machine subtype: + + assetid,machinetypeid,vendorid + MILL-01,Mill,Haas Automation + +## Azure and Thor exports (do NOT edit) + +For Azure (Entra device-group) and Thor (PC inventory) files, upload the export +AS-IS. The importer auto-detects them by their header and extracts the fields it +needs. Do not rename headers, reorder columns, add/remove rows, or reformat cells. +Editing the export breaks auto-detection. diff --git a/frontend/src/views/settings/ImportSiteAssets.vue b/frontend/src/views/settings/ImportSiteAssets.vue index 8cfeeba2..a365e22e 100644 --- a/frontend/src/views/settings/ImportSiteAssets.vue +++ b/frontend/src/views/settings/ImportSiteAssets.vue @@ -186,7 +186,7 @@
  • Open the Microsoft Entra admin center (entra.microsoft.com).
  • Go to Groups, then open the device group you want to import.
  • Select Members in the left menu.
  • -
  • Click Bulk Operations->Download Members to export the CSV.
  • +
  • In the top command bar, click Bulk operations->Download members to export the CSV.
  • Upload that CSV here with the source set to Azure device group.