You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 26f4372
Browse filesBrowse the repository at this point in the historyBrowse files
fix(config): make SQL active-commitment expiry boundary inclusive
GetActivePurchaseHistory excluded a commitment expiring exactly at asOf
(`> $1`) while the API layer's isActiveCommitment treats that instant as
still active (!now.After(expiry)). Align the SQL predicate to `>= $1`
so both sides share one boundary definition, and document the inclusive
contract in the store and interface docstrings. The pgxmock tests pin
the new predicate.
Addresses CodeRabbit review on PR #1221 (store_postgres.go).
`SELECT account_id, purchase_id, .*revocation_window_closes_at, revoked_at, revoked_via, support_case_id FROM purchase_history WHERE term > 0 AND timestamp \+ make_interval\(hours => term \* 8760\) > \$1 ORDER BY timestamp DESC$`,
803
+
`SELECT account_id, purchase_id, .*revocation_window_closes_at, revoked_at, revoked_via, support_case_id FROM purchase_history WHERE term > 0 AND timestamp \+ make_interval\(hours => term \* 8760\) >= \$1 ORDER BY timestamp DESC$`,
`FROM purchase_history WHERE term > 0 AND timestamp \+ make_interval\(hours => term \* 8760\) > \$1 AND \(cloud_account_id = ANY\(\$2\) OR \(provider = \$3 AND account_id = ANY\(\$4\)\)\) ORDER BY timestamp DESC$`,
825
+
`FROM purchase_history WHERE term > 0 AND timestamp \+ make_interval\(hours => term \* 8760\) >= \$1 AND \(cloud_account_id = ANY\(\$2\) OR \(provider = \$3 AND account_id = ANY\(\$4\)\)\) ORDER BY timestamp DESC$`,
0 commit comments