Skip to content

fix(cli): drop nine commands with no v2 route - #24

Merged
Warkanlock merged 3 commits into
mainfrom
eops-368-drop-stale-commands
Sep 1, 2026
Merged

fix(cli): drop nine commands with no v2 route#24
Warkanlock merged 3 commits into
mainfrom
eops-368-drop-stale-commands

Conversation

@Warkanlock

Copy link
Copy Markdown
Contributor

Summary

  • Factory registered create/update/get on resources that public v2 never exposed. Nine advertised commands only ever 404 or 405.
  • inbox get is removed, not repointed. The two real detail routes (/inbox/transactions/{id}/, /inbox/records/{id}/) need a type discriminator the generic get cannot send. Reinstating belongs in EOPS-372.
  • Recreates the command-surface fix from eops-368-fix(commands): drop nine commands with no v2 route #19 (closed unmerged) without the retry-client ride-along.

Fixes EOPS-368

Changes

  • has_create=False, has_update=False on companies, budgets, depreciation-books, paper-checks
  • has_get flag; inbox uses has_get=False
  • paper-checks drop has_number (schema has no number / internal_id)
  • tests/test_stale_commands.py locks the nine out; invoices still have create/update

Test plan

  • Unit tests pass (uv run pytest)
  • Linter passes (uv run ruff check .)
  • Live: companies create / inbox get / budgets create / paper-checks create exit 2
  • Live: companies list/get 4374, inbox list, paper-checks get 432 still work
  • Live: invoices --help still lists create/update

Factory registered create/update/get on read-only resources.
Those verbs only ever 404 or 405. Inbox get is removed, not
repointed: the two real inbox detail routes need a type
discriminator the generic get cannot send.

@Warkanlock Warkanlock left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments

The following comments reference lines outside the diff and are included here:

💡 src/dualentry_cli/commands/init.py:184
[Medium] Three-way branch at lines 184–238 uses bare elif that masks a logical gap
if has_get and has_number: (line 184) registers a get-number/get-id pair, elif has_get: (line 238) registers a plain get. If both flags are True, only the first branch runs — correct. But a future caller passing has_get=True, has_number=True expecting both paths will silently skip the elif. The bare elif invites logic errors.
Command: replace the bare elif has_get: at line 238 with elif has_get and not has_number: to make the three states explicit and prevent accidental masking.

    elif has_get and not has_number:

elif has_get already excluded has_number via the if above.
Spell not has_number so the three states stay obvious.
@Warkanlock

Copy link
Copy Markdown
Contributor Author

Addressed in cc205e8: elif has_get and not has_number: so the three factory states stay explicit.

Keep EOPS-368 has_* flags with EOPS-369 filter sets after
#25 and #26 landed. Paper-checks stay list/get only.
@Warkanlock
Warkanlock merged commit b545180 into main Sep 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant