Repository navigation
feat(assets): CSV import of the asset inventory (#861) - #862
Merged
alex-dembele merged 4 commits intoOct 2, 2026
Merged
Conversation
POST /assets/import validates every row (name, type, criticality incl. French spellings, owner), refuses names already in the tenant or repeated in the file, checks the plan cap against the whole file, and writes every asset in one transaction through CreateAssetUseCase. Errors carry the same line/column/code/params contract as the risk import.
…tly' into 861-featassets-csv-import-of-the-asset-inventory
/assets/import reuses the shared CSV import page with its own template, column help and FR/EN catalogue strings, and is reachable from an Import button on the inventory. The three asset-specific error codes are added to the catalogue.
This was referenced Oct 1, 2026
…tly' into 861-featassets-csv-import-of-the-asset-inventory
Base automatically changed from
755-fixrisks-csv-import-of-risks-and-assets-fails-silently
to
master
October 2, 2026 10:05
alex-dembele
deleted the
861-featassets-csv-import-of-the-asset-inventory
branch
October 2, 2026 12:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #861
Stacked on #859 (#755), which is itself stacked on #855 (#792). The base is the #755 branch; merge #855, then #859, then this one. GitHub will retarget it to master.
A team can now load its asset inventory from a spreadsheet instead of typing assets one at a time. The risk file from #755 can then name those assets in its
assetscolumn.POST /assets/import, behindassets:create+capAssets, tenant from the session only.name(required),type,criticality(LOW/MEDIUM/HIGH/CRITICAL, orFAIBLE/MOYENNE/ÉLEVÉE/CRITIQUE;MEDIUMwhen empty),owner. Headersnom/criticitéare accepted. Typed category/attributes stay out of scope (feat(assets): CSV import of the asset inventory #861 AC 2).CreateAssetUseCase. Errors carryline/column/code/params/message, the same contract as fix(risks): CSV import of risks and assets fails silently #755.limit_reached). Imported assets carrysource=IMPORT./assets/importon the sharedCsvImportPagefrom fix(risks): working, all-or-nothing CSV import of risks (#755) #859, an Import button on the inventory, and every string in the FR/EN catalogue.Verification
Tests:
TestImportAssets_{Success,NotFound,Unauthorized,Validation_OneBadRowImportsNothing,ExistingNameIsRefused_OnlyInSameTenant,WriteFailureRollsBackEverything,HeaderAndFileErrors,FrenchSpreadsheetExport,OverCapacityWritesNothing}andTestAssetImportHTTP_{Success,Validation_NothingPersisted,Unauthorized,NotFound_NoFile,RowsLandOnlyInCallersTenant}(real SQLite transaction).Live (Postgres 18 + Vite, throwaway, French UI):
/assets/import.;,nom,criticité,CRITIQUE/faible) → 200, 3 assets,source=IMPORT, criticalities CRITICAL/LOW/HIGH.Honest remainders