| 19 | | * [wiki:UseCase0001 UC0001] – '''Register new account''' – Visitor creates an account with a |
| 20 | | unique username and e-mail; the password is stored as a SHA-256 hash. |
| 21 | | * [wiki:UseCase0002 UC0002] – '''Log in''' – Visitor authenticates with username and password so |
| 22 | | the system treats every following action as a Trader. |
| | 23 | * [https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0001.md UC0001] – |
| | 24 | '''Register new account''' – Visitor creates an account with a unique username and e-mail; the |
| | 25 | password is stored as a SHA-256 hash. |
| | 26 | * [https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0002.md UC0002] – |
| | 27 | '''Log in''' – Visitor authenticates with username and password so the system treats every |
| | 28 | following action as a Trader. |
| 26 | | * [wiki:UseCase0003 UC0003] – '''Deposit virtual funds''' – Trader tops up their virtual cash |
| 27 | | balance; the user row and the ledger are written in one transaction. |
| 28 | | * [wiki:UseCase0004 UC0004] – '''Place market BUY order''' – Trader buys a crypto asset at the |
| 29 | | current market price, which debits cash and upserts the holding at a running weighted-average |
| 30 | | price. |
| 31 | | * [wiki:UseCase0005 UC0005] – '''Place market SELL order''' – Trader sells part or all of a |
| 32 | | holding at the current market price, which credits cash and preserves the cost basis. |
| 33 | | * [wiki:UseCase0006 UC0006] – '''View portfolio and transaction history''' – Trader inspects |
| 34 | | current holdings, unrealised P/L, cash balances and the most recent ledger entries. |
| 35 | | * [wiki:UseCase0007 UC0007] – '''Manage watchlist''' – Trader lists, adds and removes crypto |
| 36 | | assets on a personal watchlist, where adding an asset already on the list is a no-op. |
| | 32 | * [https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0003.md UC0003] – |
| | 33 | '''Deposit virtual funds''' – Trader tops up their virtual cash balance; the user row and the |
| | 34 | ledger are written in one transaction. |
| | 35 | * [https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0004.md UC0004] – |
| | 36 | '''Place market BUY order''' – Trader buys a crypto asset at the current market price, which |
| | 37 | debits cash and upserts the holding at a running weighted-average price. |
| | 38 | * [https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0005.md UC0005] – |
| | 39 | '''Place market SELL order''' – Trader sells part or all of a holding at the current market |
| | 40 | price, which credits cash and preserves the cost basis. |
| | 41 | * [https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0006.md UC0006] – |
| | 42 | '''View portfolio and transaction history''' – Trader inspects current holdings, unrealised |
| | 43 | P/L, cash balances and the most recent ledger entries. |
| | 44 | * [https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0007.md UC0007] – |
| | 45 | '''Manage watchlist''' – Trader lists, adds and removes crypto assets on a personal watchlist, |
| | 46 | where adding an asset already on the list is a no-op. |
| 58 | | * [wiki:UseCase0001 UseCase0001] – Visitor registers a new account |
| 59 | | * [wiki:UseCase0002 UseCase0002] – Visitor logs in |
| 60 | | * [wiki:UseCase0003 UseCase0003] – Trader deposits virtual funds |
| 61 | | * [wiki:UseCase0004 UseCase0004] – Trader places a market BUY order |
| 62 | | * [wiki:UseCase0005 UseCase0005] – Trader places a market SELL order |
| 63 | | * [wiki:UseCase0006 UseCase0006] – Trader views portfolio and transaction history |
| 64 | | * [wiki:UseCase0007 UseCase0007] – Trader manages a watchlist |
| | 69 | * [https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0001.md UseCase0001] – Visitor registers a new account |
| | 70 | * [https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0002.md UseCase0002] – Visitor logs in |
| | 71 | * [https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0003.md UseCase0003] – Trader deposits virtual funds |
| | 72 | * [https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0004.md UseCase0004] – Trader places a market BUY order |
| | 73 | * [https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0005.md UseCase0005] – Trader places a market SELL order |
| | 74 | * [https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0006.md UseCase0006] – Trader views portfolio and transaction history |
| | 75 | * [https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0007.md UseCase0007] – Trader manages a watchlist |
| 73 | | ||[wiki:UseCase0001 UC0001 – Register]||High||Nothing else works without it; demonstrates `INSERT` with a uniqueness check.|| |
| 74 | | ||[wiki:UseCase0002 UC0002 – Log in]||High||Authenticates every Trader action; demonstrates `SELECT` with parameter binding.|| |
| 75 | | ||[wiki:UseCase0003 UC0003 – Deposit]||High||Shows a multi-row transaction: `UPDATE users` plus `INSERT INTO transactions`.|| |
| 76 | | ||[wiki:UseCase0004 UC0004 – Buy]||Very high||Core of the exchange: `INSERT orders`, `UPDATE users`, upsert `holdings`, ledger entry, market trade.|| |
| 77 | | ||[wiki:UseCase0005 UC0005 – Sell]||Very high||Dual of Buy; demonstrates row-level `FOR UPDATE` locking and cost-basis bookkeeping.|| |
| 78 | | ||[wiki:UseCase0006 UC0006 – Portfolio]||High||Demonstrates joins over `holdings`, `markets` and `crypto`, and the `v_portfolio` view.|| |
| 79 | | ||[wiki:UseCase0007 UC0007 – Watchlist]||Medium||Demonstrates N–M relation handling and `ON CONFLICT` upsert semantics.|| |
| | 86 | ||[https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0001.md UC0001 – Register]||High||Nothing else works without it; demonstrates `INSERT` with a uniqueness check.|| |
| | 87 | ||[https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0002.md UC0002 – Log in]||High||Authenticates every Trader action; demonstrates `SELECT` with parameter binding.|| |
| | 88 | ||[https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0003.md UC0003 – Deposit]||High||Shows a multi-row transaction: `UPDATE users` plus `INSERT INTO transactions`.|| |
| | 89 | ||[https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0004.md UC0004 – Buy]||Very high||Core of the exchange: `INSERT orders`, `UPDATE users`, upsert `holdings`, ledger entry, market trade.|| |
| | 90 | ||[https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0005.md UC0005 – Sell]||Very high||Dual of Buy; demonstrates row-level `FOR UPDATE` locking and cost-basis bookkeeping.|| |
| | 91 | ||[https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0006.md UC0006 – Portfolio]||High||Demonstrates joins over `holdings`, `markets` and `crypto`, and the `v_portfolio` view.|| |
| | 92 | ||[https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0007.md UC0007 – Watchlist]||Medium||Demonstrates N–M relation handling and `ON CONFLICT` upsert semantics.|| |