# AST-1.4.2 Legacy Asset Bridge Mapping

The bridge uses a reviewed CSV to map each legacy asset to an existing active
serialized Asset item. It does not guess from legacy names or codes, and it does
not create categories or items.

The CSV must have this exact header and one row for every row in Employee's
`assets` table:

```csv
legacy_asset_id,company_id,item_id
12,1,37
13,1,37
```

Each item must belong to the same company as the source asset and use
`SERIALIZED` tracking. The command previews the complete batch by default:

```bash
php artisan asset:legacy-bridge storage/app/legacy-asset-map.csv
```

After reviewing the preview and the mapping file, apply it explicitly:

```bash
php artisan asset:legacy-bridge storage/app/legacy-asset-map.csv --apply
```

The bridge copies legacy `code` to `serialized_assets.asset_code`, stores the
source ID in `legacy_asset_id`, maps known legacy statuses to the corresponding
serialized status, and sets condition to `NEW` because the legacy register has
no condition field. Unknown statuses, incomplete mappings, item/company
mismatches, and collisions fail the whole transaction. An identical existing
copy is counted as already copied, so reruns do not create duplicates.

The bridge leaves `assets` and `employee_assets` rows untouched. It does not
copy assignment history, create stock transactions, or add domain tables. The
optional Employee foreign-key alteration is not part of this implementation.
