Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 7, 2025

Statements were restricted to credit card accounts. This PR extends statement functionality to all account types and adds configurable grouping modes.

Schema Changes

  • Added statementDay (optional), statementLockedToMonth (boolean), and groupBy ('month'|'statement') to all account schemas
  • Credit cards still require statementDay; optional for checking/savings
  • Added GroupByMode enum and corresponding AccountFields constants

UI Changes

AccountSettingsModal

  • Removed placeholder "Recommended Settings (Coming Soon)" section
  • Statement closing day input now available for all account types
  • Added "Lock statements to calendar months" toggle
  • Added "Group By" radio selector for month vs statement period grouping

LedgerTable & SeparatorRow

  • Month separators display statement totals (pending, scheduled, total) when statementLockedToMonth enabled
  • Statement info calculation optimized to single-pass reduce operation
  • Foundation laid for statement-based grouping (statement periods as collapsible groups)

StatementDayInput

  • Removed credit card type restriction

Example

// Account with statements locked to calendar months
{
  id: 'acc-checking-001',
  type: 'Checking',
  statementDay: 15,
  statementLockedToMonth: true,
  groupBy: 'month'
}

// Month separators now show: "January 2024 | Pending: $123.45 | Total: $1,234.56"

Current implementation preserves existing "group by month" behavior. Full "group by statement" mode (statement periods as primary collapsible groups) requires additional grouping logic restructuring.

Original prompt

This section details on the original issue you should resolve

<issue_title>Feature: Enhanced Monthly Grouping and Separator</issue_title>
<issue_description># Enhanced Monthly Grouping and Statements for All Account Types

Summary

Extend statements from credit card accounts only to all account types, and add flexible grouping options (by month or by statement period).

Requirements

1. Enable Statements for All Account Types

  • Remove credit card restrictions from statement generation and display
  • Add statementDay to all account types in validation schemas
  • Add new statementLockedToMonth boolean - when enabled, statements align with calendar months

2. Add Group-By Setting

  • Add groupBy field to accounts: 'month' | 'statement'
  • Group by Month (current behavior): Months are collapsible, statement dividers inserted within
  • Group by Statement: Statement periods are collapsible, month dividers inserted within when month changes
  • When statementLockedToMonth is true, both modes behave identically

3. Enhanced Monthly Separator

  • When statements are locked to months, SeparatorRow should display statement info (start/end balances, totals) similar to StatementSeparatorRow

4. Clean Up Account Settings Modal

  • Remove the entire "Recommended Settings (Coming Soon)" section
  • Add new settings: Statement Closing Day (for all accounts), Lock to Month toggle, Group By selector

Key Files to Modify

  • src/validation/accountSchemas.js - Add statementDay, statementLockedToMonth, groupBy to common schema
  • src/components/LedgerTable/LedgerTable.jsx - Implement dual grouping modes
  • src/components/LedgerTable/SeparatorRow.jsx - Add optional statement info display
  • src/components/AccountSettingsModal/AccountSettingsModal.jsx - Remove placeholder settings, add new ones
  • src/components/StatementDayInput/StatementDayInput.jsx - Remove credit card restriction

Acceptance Criteria

  • All account types can have statements
  • "Lock statements to calendar months" toggle works
  • "Group by" setting switches between Month and Statement grouping
  • Account Settings Modal has no "Coming Soon" placeholders
  • yarn lint passes
  • Existing credit card behavior preserved</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits December 7, 2025 23:56
Co-authored-by: jwaspin <6432180+jwaspin@users.noreply.github.com>
Co-authored-by: jwaspin <6432180+jwaspin@users.noreply.github.com>
Co-authored-by: jwaspin <6432180+jwaspin@users.noreply.github.com>
Copilot AI changed the title [WIP] Extend statements to all account types with grouping options Extend statements from credit cards to all account types with flexible grouping Dec 8, 2025
Copilot AI requested a review from jwaspin December 8, 2025 00:08
@jwaspin jwaspin added this to the Version 2.1.0 milestone Dec 8, 2025
@jwaspin jwaspin added the enhancement New feature or request label Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants