fix(sync): dashboard sync covers current year plus Nov-Dec of previous
/sync-bank now uses one shared default window in both implementations: 1 November of the previous year to 31 December of the current year. Payments dated around New Year are picked up in January; duplicates are still filtered by Sync ID. Python used a hardcoded 2026 window and would have stopped syncing on 2027-01-01; Go used the current calendar year only. Adds make sync-year [YEAR=N] with the same window. The CLI default without flags (last 30 days) is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -59,6 +59,18 @@ def get_sheets_service(credentials_path: str):
|
||||
return _SHEETS_SERVICE
|
||||
|
||||
|
||||
def default_sync_window(today=None) -> tuple[str, str]:
|
||||
"""Window used by the dashboard sync, as (from, to) in YYYY-MM-DD.
|
||||
|
||||
The whole current calendar year plus the last two months of the previous
|
||||
one, so payments dated around New Year are still picked up in January.
|
||||
Re-fetching is safe because rows are deduplicated by Sync ID.
|
||||
Mirrors DefaultWindow in go/internal/services/banksync/sync.go.
|
||||
"""
|
||||
year = (today or datetime.now()).year
|
||||
return f"{year - 1}-11-01", f"{year}-12-31"
|
||||
|
||||
|
||||
def as_text_cell(value) -> str:
|
||||
"""Mark a value to be stored as text when written with USER_ENTERED.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user