Ignore:
Timestamp:
09/16/26 23:37:15 (13 days ago)
Author:
Stefan <trsunovstefan@…>
Branches:
main
Children:
8b447ef
Parents:
df05838
Message:

add reserved_quantity and modify the phases, add v_03.png and v_03.xml for P1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • docs/P3-UseCaseModel/UseCaseModel.md

    rdf05838 r9577c79  
    3838 * [https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0005.md UC0005] –
    3939   '''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.
     40   price, which reserves the crypto being sold, credits cash and preserves the cost basis.
    4141 * [https://github.com/StefanTrsunov/bp/blob/main/docs/P3-UseCaseModel/UseCase0006.md UC0006] –
    4242   '''View portfolio and transaction history''' – Trader inspects current holdings, unrealised
    … …  
    8888||[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`.||
    8989||[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.||
     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, reservation of committed crypto (`holdings.reserved_quantity`) and cost-basis bookkeeping.||
    9191||[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.||
    9292||[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.||
    … …  
    104104   kept in one place. Direct links:
    105105   [https://github.com/StefanTrsunov/bp/blob/main/docs/P1-ConceptualModel/ERModelAIUsage.md#session-1--2026-04-21 Session 1 – 2026-04-21],
    106    [https://github.com/StefanTrsunov/bp/blob/main/docs/P1-ConceptualModel/ERModelAIUsage.md#session-2--2026-08-06--2026-08-07 Session 2 – 2026-08-06/07].
     106   [https://github.com/StefanTrsunov/bp/blob/main/docs/P1-ConceptualModel/ERModelAIUsage.md#session-2--2026-08-06--2026-08-07 Session 2 – 2026-08-06/07],
     107   [https://github.com/StefanTrsunov/bp/blob/main/docs/P1-ConceptualModel/ERModelAIUsage.md#session-3--2026-09-16 Session 3 – 2026-09-16].
    107108
    108109'''Service:''' Claude Code (Anthropic), https://claude.com/claude-code – Claude subscription,
    109 model Claude Opus 4.7 (1M context).
     110model Claude Opus 4.7 (1M context) in sessions 1–2, Claude Sonnet 5 in session 3.
    110111
    111112'''In short:''' the AI proposed the actor taxonomy and drafted the seven use cases with their SQL
    112113in session 1. In session 2 the use-case model itself was '''not''' changed – the only work was
    113114re-executing every scenario, including the failure paths, against a live PostgreSQL 16 database.
     115In session 3, UC0004 and UC0005 were revised to reserve the resource an order commits (crypto on
     116a sell) before settling it, closing a gap where nothing stopped a second sell order from being
     117granted crypto already promised to a first one; see
     118[UseCaseModelAIUsage](UseCaseModelAIUsage.md#session-3--2026-09-16).
Note: See TracChangeset for help on using the changeset viewer.