Skip to content

feat: replace fixed installment dropdown with free numeric input (1-120) - #68

Merged
fsousac merged 1 commit into
developfrom
feature/64-free-installment-count
Sep 23, 2026
Merged

fsousac merged 1 commit into
developfrom
feature/64-free-installment-count

Conversation

@fsousac

@fsousac fsousac commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Summary

Replaces fixed installment count dropdown with free-form numeric input (1-120 installments), enabling users to specify custom payment plans beyond the previous 13 discrete options.

Context: The backend already supported arbitrary installment counts (1-120) via Zod validation in app/transactions/actions.ts and server-side assertions in lib/finance/transactions.ts. The UI was the limiting factor, capping users to a hardcoded dropdown: [2,3,4,5,6,7,8,9,10,11,12,24].

Solution:

  • Replaced the CompactSelect dropdown with a bounded numeric Input field (type="number", min="1", max="120")
  • Client-side clamping sanitizes user input (non-numeric → 1, above 120 → 120, below 1 → 1)
  • Server-side bounds (app/transactions/actions.ts:85, lib/finance/transactions.ts:1640-1647) remain the authoritative validation layer
  • Reused existing i18n key transaction.installmentCount (previously unused)

Changes:

  • components/dashboard/transaction-form.tsx: Removed INSTALLMENT_COUNTS array and getInstallmentOptions helper; replaced dropdown render with numeric input
  • components/dashboard/__tests__/transaction-form.test.tsx: Updated installment tests from combobox to numeric input (edge cases: above 24, above 120, non-numeric, empty, zero/negative)

Type of Change

  • Bug fix
  • Feature
  • Documentation
  • Security hardening
  • Database migration
  • Refactor

Testing

  • pnpm run lint — passes
  • pnpm run build — passes
  • pnpm run test — passes (numeric input field tests: bounds, clamping, edge cases)
  • Manual testing completed

Supabase / Database

  • No database changes
  • Migration added under supabase/migrations
  • RLS impact reviewed

Security Checklist

  • No secrets committed
  • Server Action inputs are validated
  • User-owned records are scoped by authenticated user ID
  • user_metadata is not used for authorization decisions

Notes

No breaking changes. Existing transactions with 2-12 or 24 installments continue to work unchanged. The server remains the source of truth for installment count validation (1-120 bounds); the client-side clamping is a UX enhancement only.

@fsousac fsousac self-assigned this Sep 23, 2026
@vercel

vercel Bot commented Sep 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
dragg-finance Ignored Ignored v0 Sep 23, 2026 3:11pm UTC

@fsousac fsousac linked an issue Sep 23, 2026 that may be closed by this pull request
6 tasks
@fsousac
fsousac merged commit bdda209 into develop Sep 23, 2026
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve installment count selection in transaction form

1 participant