Fix billing pipeline first month scheduling (#1891)

* Fix billing pipeline first month scheduling

* compare to expansion next month

* use yoda date comparison

* update cursor time to be mid of day
This commit is contained in:
Pavlo Tkach
2023-01-05 21:45:56 -05:00
committed by GitHub
parent ecd1dd81a2
commit 274ae57385
2 changed files with 25 additions and 1 deletions
@@ -120,7 +120,7 @@ public class GenerateInvoicesAction implements Runnable {
.orElse(Cursor.createGlobal(RECURRING_BILLING, START_OF_TIME))
.getCursorTime());
if (yearMonth.getMonthOfYear() >= currentCursorTime.getMonthOfYear()) {
if (!YearMonth.fromDateFields(currentCursorTime.toDate()).isAfter(yearMonth)) {
throw new IllegalStateException(
"Latest billing events expansion cycle hasn't finished yet, terminating invoicing"
+ " pipeline");