-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(subscription): Make sure terminated invoice always comes with the…
… right boundaries (#2561) ## Context Some termination invoices failed to refresh or are generated with the wrong boundaries. This is related to a small mismatch with the time comparison when looking if the subscription was terminated before the invoice timestamp. ## Description This PR fixes the `subscription#terminated_at?` comparison so that it always compare time with the second precision, to avoid side effects related to rounding when persisting `ActiveRecord` objects. A lot of `DateTime` objects are also converted into proper `Time.zone` to fix potential issues around time management as DateTime should not be used in Lago's context (see https://docs.datadoghq.com/code_analysis/static_analysis_rules/ruby-best-practices/no-datetime/)
- Loading branch information
1 parent
30b31d4
commit 5cf42f1
Showing
11 changed files
with
314 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.