Repository navigation
REP-2256-feat(journal-entries): add --adjusting-entry filter to list - #44
Open
valeyakymenko wants to merge 1 commit into
Open
valeyakymenko wants to merge 1 commit into
valeyakymenko wants to merge 1 commit into
Conversation
`journal-entries list --adjusting-entry true|false` returns only adjusting entries, or only regular ones, through the API's is_adjusting_entry filter. Leaving the flag off lists both, as before. Other resources reject the flag. Validation errors now name the API error_code when the API returns one, so scripts can branch on the code instead of the message.
POD666
approved these changes
Nov 5, 2026
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
dualentry journal-entries listcan now return only adjusting entries, or only regular ones, with--adjusting-entry true|false. The API already had this filter and the CLI had no way to ask for it. Leaving the flag off lists both, same as today.Validation errors now keep the API's
error_code. The API refuses an adjusting entry with a stable code likeadjusting_entry_bank_account, but the CLI printed only the message, so a script could only match on wording.Changes
journal-entries list --adjusting-entry true|false: sendsis_adjusting_entryto the API and works with--all. The value is case-insensitive and anything else is a usage error. Other resources reject the flag, like any filter they don't offer.error_codenow printsValidation error [code]: ..., on every command. A 422 without a code prints as before.tests/test_filter_gating.pyandtests/test_client.py.journal-entries createandupdateneed no change, they already sendis_adjusting_entryfrom the JSON file.Test plan
pyteston Python 3.13): 301 passed, 136 skipped. The skipped ones aretests/test_integration.py, which needs an API key.ruff checkandruff format --check)scripts/check_changelog.py origin/main)dualentry <command>against a real API (see Artifacts)Artifacts
Run against a local API server on a private test database with fake data. Nothing is mocked, every
dualentrycall below is a real HTTP request.jqtrims-o jsonrows to the fields that matter here, and the[exit N]lines come from the script that ran the commands.The files:
adjusting.jsonsets"is_adjusting_entry": true,regular.jsonleaves it out,disabled-company.jsonuses a company with adjusting entries turned off,bank-line.jsonhas a line on a bank account,recurring.jsonis a recurring template with the flag set.The flag
Filtering
What the server received for those list calls, with no flag,
true,false, and--all:Human output
API refusals keep their code
With a key whose role can edit journal entries but has no adjusting entry permission:
Bad input
Neither call reaches the API.
Before, on main (743e99d)
Not exercised
journal-entries update: this PR doesn't change it.--allresume hint with the flag: it needs a crawl past the page limit, so it has a unit test only.tests/test_integration.pyand the production API: this ran against the local server only.