feat(client): scope the securities trade counterparty picker to securities - #4258
Merged
Conversation
gilgardosh
temporarily deployed
to
accounter-fullstack
August 19, 2026 22:30 — with
GitHub Actions
Inactive
gilgardosh
temporarily deployed
to
accounter-fullstack
August 19, 2026 22:30 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
Pull request overview
This PR narrows the counterparty picker for the main transaction row of a ForeignSecuritiesCharge so that users choose from security businesses (plus a general fallback business) instead of the full business directory, while keeping the fee row behavior unchanged.
Changes:
- Thread
chargeTypefromChargeExtendedInfo→ChargeTransactionsTable→TransactionsTable→ row cells to enable charge-type-specific UI behavior. - Add
useGetSecurityBusinessesand update the counterparty cell to use security-scoped options (with ISIN in labels) plusUserContext.foreignSecuritiesBusinessIdas a fallback. - Extend
UserContextand update client tests/changeset to reflect the new context field and behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/client/src/providers/user-provider.tsx | Exposes foreignSecuritiesBusinessId via the user context query + mapping. |
| packages/client/src/hooks/use-get-security-businesses.ts | Adds a new hook to fetch and format selectable security businesses (with ISIN). |
| packages/client/src/components/transactions-table/index.tsx | Adds optional chargeType prop and threads it into row data. |
| packages/client/src/components/transactions-table/columns.tsx | Extends row type to include chargeType for use in cells. |
| packages/client/src/components/transactions-table/cells/counterparty.tsx | Scopes counterparty picker options to securities for foreign-securities main rows, with fallback. |
| packages/client/src/components/charges/charge-transactions-table.tsx | Passes chargeType down into TransactionsTable. |
| packages/client/src/components/charges/charge-extended-info.tsx | Provides chargeType into the charge transactions table when rendered in charge view. |
| packages/client/src/components/tests/user-menu.test.tsx | Updates test fixture to include foreignSecuritiesBusinessId. |
| .changeset/security-counterparty-picker.md | Documents the client-facing behavior change for release notes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
gilgardosh
force-pushed
the
feat/security-business-tab
branch
from
August 20, 2026 09:52
5a78f8c to
5e176c4
Compare
gilgardosh
force-pushed
the
feat/security-counterparty-picker
branch
from
August 20, 2026 09:55
b208d3d to
d24c7f9
Compare
gilgardosh
temporarily deployed
to
accounter-fullstack
August 20, 2026 09:55 — with
GitHub Actions
Inactive
gilgardosh
temporarily deployed
to
accounter-fullstack
August 20, 2026 09:55 — with
GitHub Actions
Inactive
gilgardosh
force-pushed
the
feat/security-business-tab
branch
3 times, most recently
from
August 20, 2026 13:56
566a682 to
e137d21
Compare
gilgardosh
force-pushed
the
feat/security-counterparty-picker
branch
from
August 20, 2026 14:59
d24c7f9 to
b472fd6
Compare
gilgardosh
temporarily deployed
to
accounter-fullstack
August 20, 2026 14:59 — with
GitHub Actions
Inactive
gilgardosh
temporarily deployed
to
accounter-fullstack
August 20, 2026 14:59 — with
GitHub Actions
Inactive
…ities The main transaction of a foreign-securities charge settles against the security it traded, so its counterparty picker now lists security businesses plus the general foreign-securities business, each labelled with its ISIN, instead of the whole business directory. The fee row keeps the full list. chargeType is threaded from charge-extended-info down to the counterparty cell the same way enableEdit is; other TransactionsTable callers pass none and are unaffected. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Addresses review feedback. useGetSecurityBusinesses now takes a pause flag, and the counterparty cell passes pause: !isSecurityTrade - the hook is called from a table cell, so a plain transactions table was running the AllSecurityBusinesses query once per row for a list it never shows. chargeType is the shared ChargeType union instead of string across the three layers that thread it, since it is compared against typename literals. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
gilgardosh
force-pushed
the
feat/security-counterparty-picker
branch
from
August 20, 2026 15:00
b472fd6 to
67fdbf8
Compare
gilgardosh
temporarily deployed
to
accounter-fullstack
August 20, 2026 15:00 — with
GitHub Actions
Inactive
gilgardosh
temporarily deployed
to
accounter-fullstack
August 20, 2026 15:00 — with
GitHub Actions
Inactive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Final step of the per-security businesses plan. Stacked on #4257.
Closes the loop on the screenshot that started this: on a foreign-securities charge, the main
transaction's counterparty should be the specific security, the fee row stays Poalim, and the
ledger is untouched.
When the main transaction has no counterparty yet, its picker now lists the tenant's security
businesses plus the general foreign-securities business (the fallback for a trade whose security
cannot be told) instead of the whole business directory — where the right answer is a needle in a
haystack and a wrong one is one click away. Each option carries its ISIN, which is what tells two
share classes of one issuer apart. The fee row keeps the full list, matching the server's suggestion
rule (#4255).
The rule is decided client-side from what the charge already knows, so
chargeTypeis threaded fromcharge-extended-info→ChargeTransactionsTable→TransactionsTableonto the row, exactly likeenableEdit/enableChargeLink. The otherTransactionsTablecallers (business transactions tab,balance report) pass no charge type and are unaffected.
The suggestion itself needed no client change — the cell already pre-seeds the select from
missingInfoSuggestions, which now resolves the security named in the description.Adds
useGetSecurityBusinesses(the securities-scoped counterpart ofuseGetAdminBusinesses) andsurfaces
UserContext.foreignSecuritiesBusinessIdthrough the user provider for the fallback option.Verification
yarn generate,yarn lint,yarn prettierclean; client typechecks andyarn buildsucceeds.yarn test— 3439 passed.🤖 Generated with Claude Code