Skip to content

feat(transfers): add transfers and rejected-transfers commands#18

Merged
dgilperez merged 2 commits into
mainfrom
feat/cli-transfers-cmds
May 23, 2026
Merged

feat(transfers): add transfers and rejected-transfers commands#18
dgilperez merged 2 commits into
mainfrom
feat/cli-transfers-cmds

Conversation

@dgilperez
Copy link
Copy Markdown
Collaborator

Adds read-only coverage for the upstream /api/v1/transfers and /api/v1/rejected_transfers endpoints, completing P1.2 of #11.

Commands

sure-cli transfers list [--status pending] [--account-id <uuid>] [--start-date YYYY-MM-DD] [--end-date YYYY-MM-DD] [--page N] [--per-page N]
sure-cli transfers show <id>

sure-cli rejected-transfers list [--account-id <uuid>] [--start-date YYYY-MM-DD] [--end-date YYYY-MM-DD] [--page N] [--per-page N]
sure-cli rejected-transfers show <id>

Filter mapping (matches upstream concern)

Both endpoints share Api::V1::TransferDecisionFiltering:

Flag Upstream behavior
--status Transfer only — validated against Transfer.statuses enum keys
--account-id UUID-validated; filters underlying entries
--start-date / --end-date Filters by entries.date

rejected-transfers list deliberately does not expose --status: the RejectedTransfer model has no status column, and passing status to that controller is a no-op upstream. A test (TestRejectedTransfersCommandShape) locks this invariant in.

Tests

  • TestTransfersCommandShape — verifies subcommands + full flag set on list, Args validator on show.
  • TestRejectedTransfersCommandShape — same, plus the no---status guard.
  • TestTransfersCommandsRegistered — both registered on the root command.

Full suite green (go test ./...).

Docs

  • README usage block updated.
  • docs/ROADMAP.md — moved to Completed.

Refs #11.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 23, 2026

Warning

Review limit reached

@dgilperez, we couldn't start this review because you've used your available PR reviews for now.

Your plan currently allows 1 review/hour. Refill in 56 minutes and 16 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4e1a776a-8914-4c3e-9caa-563d9ed37a8e

📥 Commits

Reviewing files that changed from the base of the PR and between 00c8d9c and 117aff0.

📒 Files selected for processing (5)
  • README.md
  • cmd/sure-cli/root/root.go
  • cmd/sure-cli/root/transfers_cmds.go
  • cmd/sure-cli/root/transfers_cmds_test.go
  • docs/ROADMAP.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cli-transfers-cmds

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@superagent-security superagent-security Bot added contributor:verified Contributor passed trust analysis. pr:verified PR passed security analysis. labels May 23, 2026
@dgilperez dgilperez force-pushed the feat/cli-transfers-cmds branch from ff14ea8 to 4ea35b2 Compare May 23, 2026 18:46
dgilperez added 2 commits May 23, 2026 21:32
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).
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.
@dgilperez dgilperez force-pushed the feat/cli-transfers-cmds branch from 4ea35b2 to 117aff0 Compare May 23, 2026 19:32
@dgilperez dgilperez merged commit 7e20ce2 into main May 23, 2026
5 checks passed
@dgilperez dgilperez deleted the feat/cli-transfers-cmds branch May 23, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:verified Contributor passed trust analysis. pr:verified PR passed security analysis.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant