aboutsummaryrefslogtreecommitdiffstats
path: root/ui-desktop/src/test/java/market/guess/engine
diff options
context:
space:
mode:
authorKostya <mail@sartin.in>2026-09-06 15:42:59 +0300
committerKostya <mail@sartin.in>2026-09-06 15:42:59 +0300
commit1cf436ccd3efd45d67749102363b9a7f0d242c54 (patch)
tree9332676f5a5353172a0c54384f960dd66c105aed /ui-desktop/src/test/java/market/guess/engine
parent5bc7c4ed9d052668af66d3116a6b7afbe62c6eec (diff)
downloadguess-market-1cf436ccd3efd45d67749102363b9a7f0d242c54.tar.gz
guess-market-1cf436ccd3efd45d67749102363b9a7f0d242c54.tar.xz
guess-market-1cf436ccd3efd45d67749102363b9a7f0d242c54.zip
service: add ex-2 XML loader and carry order side through matching
Ex-2 documents declare users and their market-maker assignments next to the events, and the loader has to reject files that are schema-valid but logically inconsistent, which the v1 loader has no notion of. Add XMLLoaderV2, which checks the extension, unmarshals the document, runs it through XMLValidatorV2 and only then replaces the event and user repositories, so a rejected file leaves the previous catalog intact. The validator enforces unique positive event ids, non-empty names and descriptions, commission within 0..90 with a known type, at least two distinct options, a positive LMSR b or order-book d with non-negative initial inventory, unique user names, positive initial cash, and exactly one existing event per market-maker reference. Let EventMapperV2 take the resolved market maker's name so it lands on the domain event. Give Order a side and the placing user, and Trade the seller, so an order book can match a buyer against a seller. Keep the previous constructors, defaulting to a BUY with no user or seller, so existing LMSR call sites stay unchanged. Route LocalMatchingEngine through the mechanism's placeOrder with side, user and limit price instead of buy(), and have cancelOrder take the order to cancel. Also add an isBlocked query to User and Ledger for accounts that went negative.
Diffstat (limited to 'ui-desktop/src/test/java/market/guess/engine')
0 files changed, 0 insertions, 0 deletions