aboutsummaryrefslogtreecommitdiffstats
path: root/ui-desktop/src/main
Commit message (Collapse)AuthorAgeFilesLines
* ui-fx: move the JavaFX UI into a module that sees only the api Kostya2026-10-1164-6353/+3
| | | | | | | | | | | | | | | | | | | | | | | Exercise 3 asks for a new desktop client that reuses the Exercise 2 screens, and the course asks that clients depend on the DTO contract, never on the engine. ui-desktop mixed both: its views and controllers only talk to the api interfaces, but AppView and AppState each had a convenience constructor that built a ServiceEngine, which tied every UI class to the service module. Move the screens, controllers, components, FXML, skins and fonts into a new ui-fx module that depends on api alone. Packages are unchanged, so FXML controller names and resource paths keep working as they are. ui-desktop keeps only the Exercise 2 app: Launcher, App, which now builds the ServiceEngine and passes its contexts in, and ServiceEngine itself. The Exercise 3 client can then reuse ui-fx with remote contexts and never put the engine on its classpath. The build proves the split: ui-fx compiles with nothing but api visible. Tests move with the code they cover. AppStateTest drives the real engine, so it stays in ui-desktop.
* account: let users deposit cash into their account Kostya2026-10-091-2/+2
| | | | | | | | | | | | | | | | Exercise 3 replaces the fixed initial cash of Exercise 2 with accounts that users top up themselves. Add AccountContext.deposit, which credits a DEPOSIT entry through LedgerContext so it carries a timestamp and a running balance like every other ledger movement, and return the updated account. The amount crosses the api boundary as a string, like all money values. Reject anything that is not a positive number with at most two decimal places instead of rounding it, so a user is never credited a different amount than they asked for. A deposit can bring a negative account back above zero, which lifts the block.
* ui-desktop: build the JavaFX market UI on top of the serviceKostya2026-09-0965-13/+6426
| | | | | | | | | | | | | | | | | | | | Replace the placeholder hello-world window with a working desktop client for the guess market. ServiceEngine wires the in-memory repositories, XML loader, risk, matching, fulfillment and settlement contexts together, and AppState exposes their results as observable JavaFX state for the views to bind to. The FXML views have an events tab and a users tab. The events tab lists events with mechanism and commission filters, and shows each event's price chart, order book ladder, trade history and participants. The users tab shows each user's ledger and positions, and lets them place buy and sell orders. Dialogs cover loading an XML file (in a background task), creating an event and resolving one. Bundle a CSS theme and Nerd Font faces so the UI looks the same on every machine. Teach build.sh to copy each module's src/main/resources into its class output, since FXML, CSS and fonts are loaded from the classpath at runtime.
* flatten modules to repo root, vendor deps, repair Eclipse build pathsKostya2026-08-092-0/+31
Move api, engine, ui-console and ui-desktop out of modules/ up to the repo root and drop the empty exception project (GuessMarketException now lives in api). Vendor gson, jaxb, okhttp, openjfx and tomcat under lib/, and group the JUnit standalone jar into lib/junit/ alongside them. Rewrite every .classpath: drop the copy-pasted optional="true" that was masking real build path errors, point the library entries at ../lib/, and put the JUnit jar on the test source folders so the placeholder AppTest classes compile. ui-desktop: take the JavaFX jars off the modulepath (there is no module-info.java, so module="true" left the packages unresolvable) and add a Launcher that calls Application.launch, avoiding the "JavaFX runtime components are missing" check without VM arguments. engine: add LocalGuessMarketService and the GuessMarketContext provider interface, and give GuessMarketException the no-arg and cause constructors they need.