Skip to content

PM-5839: Correct payment report calendar dates - #129

Merged
jmgasper merged 1 commit into
developfrom
PM-5839-1
Aug 14, 2026
Merged

PM-5839: Correct payment report calendar dates#129
jmgasper merged 1 commit into
developfrom
PM-5839-1

Conversation

@jmgasper

Copy link
Copy Markdown
Collaborator

What was broken

Inclusive end-date filtering could omit records from the selected day. After the first PM-5839 change made the end date inclusive, late July 31 finance payments appeared as August 1 in SFDC Payments, and monthly BA fees could place them in an August bucket.

Root cause

Finance payment timestamps are stored as UTC values without timezone metadata. The report bounds were interpreted as instants or through the database session timezone, while the SFDC timestamp projection treated UTC values as New York wall time and shifted them in the wrong direction.

What was changed

  • Interpret payment-accrual inputs as calendar dates and use a half-open next-day upper bound.
  • Convert SFDC America/New_York calendar bounds to UTC-naive payment-storage bounds, including daylight-saving transitions.
  • Return SFDC payment timestamps with the correct New York UTC offset.
  • Use corrected New York dates for both BA fee variants and monthly grouping.
  • Document the date-only calendar contract in DTO and directory metadata.

Any added/updated tests

  • Updated SQL regression assertions for payment accruals, SFDC Payments, total and monthly BA fees, month bucketing, and report-directory metadata.
  • Verified July 31 and daylight-saving boundary semantics against PostgreSQL 16.
  • Focused PM-5839 tests passed: 7 tests across 3 suites.
  • pnpm lint and pnpm build passed.
  • The full suite reports 350 passing and 21 failing tests. The same 21 unrelated failures were reproduced on the clean merged baseline; this change adds no full-suite failures.

What was broken

Date filters could omit the selected end date or, after making it inclusive, show late July 31 SFDC payments as August 1. Monthly BA fees could also place those payments in the next month.

Root cause

Finance payment timestamps are stored as UTC values without timezone metadata. Date bounds were interpreted as instants or through the database session timezone, while SFDC output applied the America/New_York conversion in the wrong direction.

What was changed

Interpret report filters as calendar dates with half-open next-day bounds. Convert SFDC New York calendar bounds to UTC for payment storage, return payment dates with the correct New York offset, and group BA fees by the corrected New York date.

Any added/updated tests

Updated SQL regression coverage for payment accruals, SFDC payments, both BA fee variants, monthly buckets, and report-directory metadata. PostgreSQL 16 checks cover the July 31 boundary and daylight-saving transitions.
@jmgasper
jmgasper merged commit b6c41bd into develop Aug 14, 2026
5 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.

1 participant