# Vue manual position v1.2.2 hardening

Use this reference for FinanceManager Vue/FastAPI sprints that touch `Position hinzufügen`, provider search, preview/confirm, Equity/ETF valuation labels, and the Crypto overview layout.

## Durable lessons

- Treat **Preview** as read-only and **Confirm** as the only write boundary. Provider-search/preview may return enriched DTOs, but must not materialize catalog/instrument rows until confirm.
- Normalize provider warnings into user-safe categories. If at least one useful candidate exists, do not surface raw fallback/provider failures as scary User Mode errors; keep raw details in logs/admin diagnostics. With zero useful candidates, show a clear actionable warning.
- Preserve provider evidence across the candidate → preview → confirm path: `provider_symbol`, exchange, listing currency, price currency, price date/source, provider chain, and confidence label.
- When confirming an Equity/ETF position, materialize both transaction currency (`currency_original`) and instrument currency. Cache provider price snapshots on the instrument/catalog only when the value came from a selected/reviewed candidate.
- Equity status labels should be user-facing and deterministic: `missing_market_price`/`missing` → `Preis fehlt`, `missing_fx`/`missing` → `FX fehlt`, cost-basis/missing CHF value → `Einstand unvollständig`, only known price+FX+value → `Bewertet`.
- If a migration adds optional catalog/provider snapshot columns, add compatibility `_add_missing_columns` calls as well as create-table DDL, then update the schema-version test.
- Frontend tests must track the actual `data-test` names. For `PositionAddPage`, the query input uses `instrument-query`; the review button uses `review-position`; the review summary container uses `review-box`.
- Crypto overview should remain compact and useful: KPI banner, table visible high on the page, compact allocation blocks, empty states for weak charts/sparklines, and no duplicate/wasteful wallet summary blocks.

## Verification pattern

Run at minimum:

```bash
unset JARVIS_FINANCE_DB_PATH
PYTHONPATH=src pytest -q tests/unit/test_vue_dashboard_v12_acceptance.py
PYTHONPATH=src pytest -q tests
cd frontend && npm test -- --run && npm run build
```

Then run changed-source and `frontend/dist` secret scans, `git diff --check`, Git-safety checks for runtime/secrets/DB artifacts, commit, push, and verify remote hash equality. If normal HTTPS `origin` is unauthenticated but the FinanceManager runtime GitHub token is available, use a temporary authenticated header/URL for push and `ls-remote`; never set a token-bearing remote or print the token.

## Pitfalls

- Do not regress to raw provider error output in User Mode.
- Do not let `JARVIS_FINANCE_DB_PATH` leak into pytest from a running UAT server.
- Do not classify a zero/None CHF valuation as fully `Bewertet` just because stored price and FX statuses are `ok`.
- Do not forget to stage newly added frontend tests; `git diff --stat` will omit untracked files.
