Context
Use this when a file import flow must keep its exact-match happy path, but still let users recover from mismatched headers or unknown material names inside the app.
Pattern
- Keep the default strict. Exact header/material matches should continue to work with zero extra input.
- Return mapping metadata on every import response. Include detected source columns, required field mapping status, and unique imported material resolutions so the UI can react without inventing its own parser.
- Suggest, don’t auto-apply. Deterministic header aliases (
Part Id → Id, Qty → Quantity) are useful as suggestions, but require an explicit user mapping before import succeeds.
- Separate pure import from side effects. Let the service layer consume explicit mappings; let the bridge/app layer create missing library entities first, then rerun import with the created ids.
- Rewrite imported material values to the resolved library name before validation. That keeps downstream project/nesting flows working with canonical material names.