feat(budgets): add budgets and budget-categories commands#17
Conversation
Refs #11. - budgets list with start-date/end-date filters, show. - budget-categories list with budget-id/category-id/start-date/end-date filters, show. - Read-only commands; Sure exposes only :index and :show on both resources via api/v1. Path escaping on the new show routes. Args: cobra.NoArgs on list subcommands so a typo doesn't get silently ignored.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR adds two new CLI command groups— ChangesBudgets CLI Commands
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
cobra's Find returns the nearest matching ancestor with no error when a leaf is missing, so the prior test would have silently passed even if a subcommand had been deregistered. Compare the resolved cmd's Name() to the expected leaf to actually verify registration.
Same fix as #17: cobra's Find returns the nearest matching ancestor when a leaf is missing, so the prior test would silently pass even if a subcommand had been deregistered. Compare resolved Name() to the expected leaf.
* feat(transfers): add transfers and rejected-transfers commands Read-only coverage for `/api/v1/transfers` and `/api/v1/rejected_transfers`: - `transfers list` with `--status`, `--account-id`, `--start-date`, `--end-date`, and paging flags. Mirrors the upstream `Api::V1::TransferDecisionFiltering` concern (status is validated upstream against `Transfer.statuses`; account_id against UUID; dates filter the underlying entries.date). - `transfers show <id>`. - `rejected-transfers list` — same filters minus `--status` (the RejectedTransfer model has no status column). - `rejected-transfers show <id>`. Tests cover command shape, registration, expected flag set, and the invariant that `rejected-transfers list` must NOT expose `--status`. Part of #11 (P1.2). * test(transfers): tighten registration test against cobra's loose Find Same fix as #17: cobra's Find returns the nearest matching ancestor when a leaf is missing, so the prior test would silently pass even if a subcommand had been deregistered. Compare resolved Name() to the expected leaf.
Part of #11 (P1).
Adds CLI coverage for
/api/v1/budgetsand/api/v1/budget_categories, both of which Sure exposes as read-only resources.Commands
budgets list [--start-date Y-M-D] [--end-date Y-M-D]— mirrors the upstreamapply_filters(start_date >=, end_date <=).budgets show <id>budget-categories list [--budget-id UUID] [--category-id UUID] [--start-date Y-M-D] [--end-date Y-M-D]— full upstream filter set.budget-categories show <id>Path escaping on the
showroutes.Args: cobra.NoArgson the list subcommands.Verification
we-promise/sureconfig/routes.rbapi/v1 namespace.apply_filters(budgets_controller.rb,budget_categories_controller.rb).go build ./...+go test ./cmd/sure-cli/root/...green.Summary by CodeRabbit
Release Notes
budgetscommand with list and show subcommands for viewing budget informationbudget-categoriescommand with list and show subcommands for managing budget categories