fix(cli): drop nine commands with no v2 route - #24
Conversation
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
left a comment
There was a problem hiding this comment.
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.
|
Addressed in cc205e8: |
Summary
create/update/geton resources that public v2 never exposed. Nine advertised commands only ever 404 or 405.inbox getis removed, not repointed. The two real detail routes (/inbox/transactions/{id}/,/inbox/records/{id}/) need a type discriminator the genericgetcannot send. Reinstating belongs in EOPS-372.Fixes EOPS-368
Changes
has_create=False, has_update=Falseon companies, budgets, depreciation-books, paper-checkshas_getflag; inbox useshas_get=Falsehas_number(schema has nonumber/internal_id)tests/test_stale_commands.pylocks the nine out; invoices still have create/updateTest plan
uv run pytest)uv run ruff check .)companies create/inbox get/budgets create/paper-checks createexit 2companies list/get 4374,inbox list,paper-checks get 432still workinvoices --helpstill lists create/update