Changeset 9577c79 for docs/P4-Prototype/BuildInstructions.md
- Timestamp:
- 09/16/26 23:37:15 (13 days ago)
- Branches:
- main
- Children:
- 8b447ef
- Parents:
- df05838
- File:
-
- 1 edited
-
docs/P4-Prototype/BuildInstructions.md (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
docs/P4-Prototype/BuildInstructions.md
rdf05838 r9577c79 106 106 most recent trade (`v_latest_prices`), never from a stored column. 107 107 108 ### 7. Optional — richer data for the P6 reports 109 110 `data_load.sql` only seeds a few minutes of trade history, which is not enough 111 for the [top traders](../P6-AdvancedReports/AdvancedReports.md#top-traders-by-realized-performance) 112 or [market performance](../P6-AdvancedReports/AdvancedReports.md#market-performance-leaderboard) 113 reports (menu `[10]`/`[11]`) to show more than a single period. To see them do 114 something more interesting, load five quarters of synthetic history on top: 115 116 ```sh 117 psql "postgresql://$DBUSER:$DBPASSWORD@$DBHOST:$DBPORT/$DBNAME" \ 118 -f server/db/reports_demo_data.sql 119 ``` 120 121 It is deliberately not part of `-init`/`-load-data` — see the header of 122 [`reports_demo_data.sql`](../../server/db/reports_demo_data.sql) for why — so 123 running it never changes the balances the smoke test below checks. 124 108 125 ## Testing instructions 109 126 … … 114 131 funds**, **Browse markets**, **Place market BUY order**, **Place market SELL 115 132 order**, **View portfolio**, **View transaction history**, **Manage watchlist**, 116 **Logout**. 133 **Logout**, and two [P6](../P6-AdvancedReports/AdvancedReports.md) reports: 134 **Report: top traders** and **Report: market performance**. 117 135 118 136 You never have to remember an identifier. Markets are always printed as a … … 122 140 ### End-to-end smoke test 123 141 124 Verified on 2026-0 8-07against PostgreSQL 16 with freshly loaded sample data.142 Verified on 2026-09-16 against PostgreSQL 16 with freshly loaded sample data. 125 143 Expected values are exact. 126 144 127 145 1. `./eduberza -init` — prints `Database initialised.` 128 146 2. `./eduberza`, then `[2] Login` → `alice` / `test123` → `Login successful.` 129 3. `[6] View portfolio` → one row: `ETH 0.5000` at avg 3500.000000, current130 3520.000000, value 1760.0000, unrealised P/L `+10.0000`. Cash available131 8250.0000, net worth 10010.0000.147 3. `[6] View portfolio` → one row: `ETH 0.5000` reserved 0.0000, available 148 0.5000, at avg 3500.000000, current 3520.000000, value 1760.0000, 149 unrealised P/L `+10.0000`. Cash available 8250.0000, net worth 10010.0000. 132 150 4. `[4] Place market BUY order` → `BTC` → `0.01` → 133 151 `Order executed: buy 0.0100 BTC @ 67140.000000 (notional 671.4000 USD)`. … … 150 168 to any table — no order row, no ledger entry, no holding. 151 169 - **Insufficient holding:** as `bob` (no positions), try to sell `1` ETH. 152 Expect `Insufficient holding: trying to sell 1.0000, hold 0.0000`. 170 Expect `Insufficient holding: trying to sell 1.0000, available 0.0000 (of 171 0.0000 held, 0.0000 reserved)`. 172 - **Two sell orders racing for the same crypto:** give `alice` a 2 BTC holding 173 and start two `eduberza` processes at once, each selling `1.5` BTC (together 174 3 BTC, more than she has). Expect exactly one `Order executed`, and the 175 other `Insufficient holding` reading the post-commit quantity — see 176 [UseCase0005Implementation](UseCase0005Implementation.md) for the exact 177 transcript. This is the concurrency guarantee that 178 `holdings.reserved_quantity` and the `SELECT ... FOR UPDATE` lock together 179 provide. 153 180 - **Duplicate registration:** register with username `alice`. Expect 154 181 `Username or email already taken.`
Note:
See TracChangeset
for help on using the changeset viewer.
