portfolio_rs/tests/snapshots/holdings.snap
Markus Zoppelt b927c9a14a fix: a manual holding without purchases is one item
For a position without a ticker that is not cash, `Amount` is its value.
Without purchases quantity_dec() still returned `Amount`, so a watch worth
250 was reported as 250 units: in the balances table, in get_positions,
get_context and /api/context, and in new snapshots. The balances table
also showed its price as 0.00.

quantity_dec() is now 1 for such a holding; get_amount() keeps returning
the data-format amount, and valuation still uses `Amount`. The balances
column is renamed from Amount to Quantity, and a manual holding shows "-"
as its price. Older snapshots that stored `Amount` as the quantity give
the same get_performance results: without purchases there are no
transactions to price.
2026-11-01 21:06:31 +01:00

19 lines
3.8 KiB
Text

┌─────────┬────────────┬────────┬──────────┬─────────────┬───────┬─────────┬───────┐
│ Total ┆ Securities ┆ Cash ┆ Invested ┆ Unreal. PnL ┆ %PnL ┆ Day PnL ┆ %Day │
╞═════════╪════════════╪════════╪══════════╪═════════════╪═══════╪═════════╪═══════╡
│ 2500.00 ┆ 2000.00 ┆ 500.00 ┆ 2000.00 ┆ 0.00 ┆ 0.00% ┆ 0.00 ┆ 0.00% │
└─────────┴────────────┴────────┴──────────┴─────────────┴───────┴─────────┴───────┘
┌──────────┬────────┬──────────┬──────────┬──────────┬────────┬─────────┬─────────┬─────────┬────────┐
│ Name ┆ Class ┆ Quantity ┆ Avg Cost ┆ Invested ┆ Price ┆ Value ┆ PnL ┆ %Hist ┆ %Day │
╞══════════╪════════╪══════════╪══════════╪══════════╪════════╪═════════╪═════════╪═════════╪════════╡
│ FAKEUP ┆ Stocks ┆ 10.0000 ┆ 100.00 ┆ 1000.00 ┆ 110.00 ┆ 1100.00 ┆ 100.00 ┆ 10.00% ┆ 4.76% │
├╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
│ FAKEDN ┆ Bonds ┆ 5.0000 ┆ 200.00 ┆ 1000.00 ┆ 180.00 ┆ 900.00 ┆ -100.00 ┆ -10.00% ┆ -5.26% │
├╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
│ Unknown ┆ Cash ┆ 500.0000 ┆ - ┆ - ┆ - ┆ 500.00 ┆ - ┆ - ┆ - │
├╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
│ FAKEGONE ┆ Stocks ┆ 3.0000 ┆ - ┆ - ┆ n/a ┆ n/a ┆ - ┆ - ┆ - │
├╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
│ TOTAL ┆ ┆ ┆ ┆ 2000.00 ┆ ┆ 2500.00 ┆ 0.00 ┆ 0.00% ┆ 0.00% │
└──────────┴────────┴──────────┴──────────┴──────────┴────────┴─────────┴─────────┴─────────┴────────┘
Warning: 1 position(s) without market price excluded from totals: FAKEGONE