Skip to content

fix: remove date picker for single account sync, use auto-calculated dates#66

Merged
meseer merged 1 commit intomainfrom
feat/questrade-single-account-auto-dates
Apr 30, 2026
Merged

fix: remove date picker for single account sync, use auto-calculated dates#66
meseer merged 1 commit intomainfrom
feat/questrade-single-account-auto-dates

Conversation

@meseer
Copy link
Copy Markdown
Owner

@meseer meseer commented Apr 30, 2026

Summary

Remove the modal date picker from single account Questrade sync and automatically determine the start date using the same logic as the all-accounts sync.

Changes

  • Removed the modal form with date pickers from createSingleAccountUploadButton
  • Added calculateSingleAccountStartDate() helper that uses:
    • Subsequent sync: calculateFromDateWithLookback('questrade', accountId) — last sync date minus lookback period
    • First sync: account creation date via getAccountCreationDate()
    • Fallback: 2 weeks ago (if no creation date available)
  • Removed unused getDateRange import
  • Added 8 tests covering all date calculation scenarios (subsequent sync, first sync, fallback, edge cases)

Motivation

Previously, single account sync required the user to manually pick dates. The all-accounts sync already had automatic date calculation logic. This change makes the single account sync consistent with that behavior — no user interaction needed for date selection.

…dates

- Remove modal date picker from single account upload button
- Calculate start date automatically using same logic as all-accounts sync:
  - Subsequent sync: last sync date minus lookback period
  - First sync: account creation date
  - Fallback: 2 weeks ago
- Extract calculateSingleAccountStartDate helper (exported for testing)
- Add comprehensive tests for date calculation logic
- Remove unused getDateRange import
@meseer meseer merged commit d059866 into main Apr 30, 2026
2 checks passed
@meseer meseer deleted the feat/questrade-single-account-auto-dates branch April 30, 2026 00:32
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.

1 participant