Event-sourced bank account on Axon Framework 5.4.2 + Spring Boot 4.1.1, with transcripts generated by tests and three reproduced JPA-store variants. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b69H5rTewUKPyhGS8r
18 lines
900 B
Plaintext
18 lines
900 B
Plaintext
# Open, deposit, withdraw: commands in, events stored, read model updated
|
|
|
|
$ POST /accounts/acc-1?owner=Asha
|
|
HTTP 201 {"accountId":"acc-1","status":"opened"}
|
|
$ POST /accounts/acc-1/deposit?amount=500
|
|
HTTP 200 {"accountId":"acc-1","deposited":500}
|
|
$ POST /accounts/acc-1/withdraw?amount=120
|
|
HTTP 200 {"accountId":"acc-1","withdrawn":120}
|
|
|
|
# Stored events (aggregate_event_entry), the only thing the write side persists
|
|
seq=0 aggregate_type=accountId com.ankurm.axondemo.domain.AccountOpened {"accountId":"acc-1","owner":"Asha"}
|
|
seq=1 aggregate_type=accountId com.ankurm.axondemo.domain.MoneyDeposited {"accountId":"acc-1","amount":500}
|
|
seq=2 aggregate_type=accountId com.ankurm.axondemo.domain.MoneyWithdrawn {"accountId":"acc-1","amount":120}
|
|
|
|
# Read model, filled by the event handlers
|
|
$ GET /accounts/acc-1
|
|
HTTP 200 {"accountId":"acc-1","owner":"Asha","balance":380,"eventsApplied":3}
|