Skip to content

daytrader-go: market - #5

Open
devin-ai-integration[bot] wants to merge 2 commits into
migration/daytrader-gofrom
devin/1794800000-go-market
Open

devin-ai-integration[bot] wants to merge 2 commits into
migration/daytrader-gofrom
devin/1794800000-go-market

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Ports the market area of DayTrader to Go: the home page, the quotes page and the market summary. Only daytrader-go/internal/features/market/ and daytrader-go/templates/market_*.html are touched.

What was ported

  • action=home (TradeServletAction.doHome, tradehome.jsp): account and holdings for the logged-in user, the account summary totals, and the market summary. The status line is read from web.Attr(r, "results"), default "Ready to Trade". Like tradehome.jsp, the page does not print it.
  • action=quotes (doQuotes, quote.jsp, displayQuote.jsp): symbols split on commas and spaces, one row per quote, each with the buy form (action=buy, hidden symbol, quantity default 100). GetQuote keeps the legacy "invalid symbol" placeholder for empty or over-long symbols.
  • Market summary (TradeSLSBBean.getMarketSummary, MarketSummaryDataBean, marketSummary.jsp): the 100 s:1__ quotes ordered by change, first five as gainers, last five reversed as losers, TSIA / open TSIA as averages rounded HALF_UP to 2 places, total volume, gain percent.
  • Unit tests for formatting, symbol splitting, summary maths, account totals and template rendering.

Parity (as printed by make parity)

  • Legacy Liberty on :9083: 13/13 PASS.
  • Go on :8080, on a local throwaway branch merging this branch + go-auth + go-account + go-infra (the siblings on origin at the time): 01-login, 02-home, 03-quotes, 08-account-update, 09-invalid-login, 10-logout PASS. Target scenarios 02-home and 03-quotes both PASS.
  • Not passing in that combination: 04-register, 05-buy, 13-rest-entry DIFF; 06-sell, 07-portfolio, 11-rest-list, 12-rest-search ERROR. I did not investigate these; go-trading, go-rest and go-tests were not on origin yet.
  • gofmt -l ., go vet ./..., go test ./... are clean on this branch.

Deliberate differences from legacy

  • The summary query adds symbol as a tie-break: ORDER BY change1 DESC, symbol. Legacy orders by change1 only, so ties are in database order.
  • The market summary is held in a package-level cache with a refresh interval instead of the EJB singleton's.
  • The quotes page has its own footer block (market_quotesEnd) instead of the shared pageEnd. quote.jsp keeps "for a quote or to trade." on one line, and the shared block (taken from tradehome.jsp) splits it, which showed up as a diff in 03-quotes.

Scaffold requests

  • templates/layout.html pageEnd: allow the one-line footer note variant used by quote.jsp, so the quotes page can drop its copy of the footer.

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/f643c40cb1c34516aed26f03b9a47be3
Open in Devin Desktop: https://partner-workshops.devinenterprise.com/desktop/session/f643c40cb1c34516aed26f03b9a47be3?variant=devin
Requested by: @sumitshatwara

@devin-ai-integration

Copy link
Copy Markdown
Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant