feat: add split transaction support and migrate build to tsup - #34
Closed
moosasharieff wants to merge 3 commits into
Closed
moosasharieff wants to merge 3 commits into
moosasharieff wants to merge 3 commits into
Conversation
…ns in get_transactions - New CreateSplitTransactionTool creates transactions split across multiple categories via the YNAB subtransactions API - Updated GetTransactionsTool to include subtransactions in response so existing splits are visible - 16 new tests covering milliunit conversion, parent amount summing, validation, and error cases
Author
|
Hi @calebl, This PR is ready to merge. Can you please review and merge the changes. |
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.
Summary
ynab_create_split_transactiontool to create transactions split across multiple budget categories via the YNABsubtransactionsAPIynab_get_transactionsto includesubtransactionsin the response, making existing splits visible to AI clientstscwithtsup(esbuild-based) for the build step — eliminates OOM crashes on large type graphs and reduces build time to ~240msNew tool:
ynab_create_split_transactionTakes
accountId,date,payeeId/payeeName, optional metadata, and asubtransactionsarray (min 2). Each split entry has anamountin dollars plus optionalcategoryId,memo, and payee overrides. The tool setscategory_id: nullon the parent transaction (required by the YNAB API for splits) and sums subtransaction amounts as the parent total.Key API constraint: Updating subtransactions on existing splits is not supported by the YNAB API — this tool covers creation only.
Test plan
npm run buildcompletes without errorsnpm test— all 185 tests pass (17 files, including 16 new tests forCreateSplitTransactionTool)npm run debug) and verify it appears in YNAB with correct categories and amountsynab_get_transactionsand confirmsubtransactionsis populated for existing splits