Skip to content

MBA-1428: Transaction submission wizard and status view - #263

Open
devin-ai-integration[bot] wants to merge 2 commits into
devin/1784217279-mba-1427-position-inquiryfrom
devin/1786399913-mba-1428-transactions
Open

devin-ai-integration[bot] wants to merge 2 commits into
devin/1784217279-mba-1427-position-inquiryfrom
devin/1786399913-mba-1428-transactions

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 10, 2026

Copy link
Copy Markdown

Summary

Web replacement for keying a TRANFILE record for PORTTRAN: a two-step submission wizard (details → review & confirm) plus a transaction status view, backed by a mock service over a TRNREC.cpy-shaped fixture. Stacked on the MBA-1427 position branch; the transactions nav item is now enabled.

Validation mirrors the COBOL paragraphs rather than inventing new rules:

Check Source
Portfolio id PORT + 4 digits PORTVALD 1000-VALIDATE-ID
Portfolio must exist PORTTRAN 2110-CHECK-PORTFOLIO
Type ∈ BU/SL/TR PORTTRAN 2120-CHECK-TRANSACTION-TYPE
Quantity > 0; price & amount > 0 except TR PORTTRAN 2130-CHECK-AMOUNTS
Sell ≤ units held PORTTRAN 2220-PROCESS-SELL

Digit limits come straight from the copybook (S9(11)V9(4) quantity/price, S9(13)V9(2) amount), so an overflowing amount is rejected before review.

Two BigInt decimal helpers keep COMP-3 precision — no Number anywhere in the money path:

// V9(4) x V9(4) -> V9(2), truncating like an unqualified COMPUTE
multiplyDecimals('325.5', '61.7333') === '20094.18'   // not .19
compareDecimals('99.9999', '100') < 0

The sell-balance check runs before the review step (and again in the service on submit), and treats already-pending sells as encumbered:

availableUnits(portfolioId, investmentId)
  = position.units - Σ pending SELL quantities

Submitted records are written with TRN-STATUS = 'P', stamped date/time/sequence, and settle on the next PORTTRAN run — the list view surfaces P/D/F/R with filters on portfolio, status and type.

Reusable FormField was lifted out of PortfolioFormPage (no behaviour change) so both forms share it.

Jira: https://cog-gtm.atlassian.net/browse/MBA-1428

Screenshots

Submission form with auto-calculated amount:

form

Review & confirm step:

review

Status view after submit:

status

Testing

npm run lint, npm run typecheck, npm run build, npm test (71 tests) all pass. New coverage: amount truncation, validation rules, mock service (unknown portfolio, oversell, pending-sell encumbrance), and a full wizard flow test.

Link to Devin session: https://app.devin.ai/sessions/9b436d246db74e7f91301fb25f38af54


Devin Review

Status Commit
⚪ Not started

Run Devin Review

Open in Devin Review (Staging)

@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • 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.

0 participants