feat(accounts): debt-detail, statement-closing-day, availableCredit (v0.5.0)#5
Merged
feat(accounts): debt-detail, statement-closing-day, availableCredit (v0.5.0)#5
Conversation
…availableCredit Three AI-facing additions for credit-card debt reporting: - `accounts debt-detail <id>` wraps the existing backend breakdown endpoint with pro-AI defaults (`--mode=current_cycle --limit=100`) plus passthrough flags for `--anchor-date`, `--start-date`, `--end-date`, `--search`, `--only-pending`, pagination. - `accounts create --statement-closing-day <n>` reaches parity with `accounts update`. Lets AI create CREDIT cards with the cycle data needed for `debt-detail` to work without falling back to the 30-day synthetic window. The backend returns `creationWarning` on the account when the flag is omitted on a CREDIT type. - `accounts list` now derives `availableCredit = max(0, creditLimit - currentDebt)` client-side for CREDIT accounts with a non-null `creditLimit`. Omitted for other account types. Adds `DEBT_DETAIL_SMOKE.md` with 6 automated E2E scenarios and 2 manual checks (real-data validation + archived-account behavior). .gitignore picks up `*.dump`/`*.sql`/`dev-fixtures/` so no production data can slip into this public repo. Bumps to 0.5.0. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
lucas accounts debt-detail <id>— pass-through overGET /api/accounts/:id/credit-debt-breakdownwith AI-friendly defaults (--mode=current_cycle --limit=100).lucas accounts create --statement-closing-day <n>— parity withaccounts update. Emitsaccount.creationWarningfrom the backend when CREDIT is created without it.lucas accounts listnow returnsavailableCreditfor CREDIT accounts with a non-nullcreditLimit.Bumps to v0.5.0. Changelog updated.
Why
Kimi (AI agent) was approximating current credit-card debt with a 7/14/21/31-day search loop, which inflated reported debt with already-settled prior-cycle charges. The backend already has the precise cycle math (
accounts.credit-debt-breakdown), it was only missing a CLI surface. This PR exposes it.Test plan
bun run test)bun run format,bun run typecheck,bun run lint,bun run build— all greendocs/DEBT_DETAIL_SMOKE.md):charges=400, payments=0, currentDebt=400charges=400, payments=20, net=380currentDebt == composedDebt + outsideRangeDebtholdscreationWarningpresent; default mode errors with Spanish message;--mode customsucceedslucasapp-front bun run buildandLucasApp xcodebuildboth greenBackend dependency
Requires
lucasapp-backend#19(merged & deployed 2026-04-20). ThecreationWarningfield only surfaces when the backend is on the new version; other features work against any backend.🤖 Generated with Claude Code