Skip to content

Commit 134898b

Browse files
feat: cleaned the pr
1 parent 17fd08a commit 134898b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

app/services/billing/rate_cards/schedule.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,17 @@ def initialize(anchor_date:, phases:, rates:, prorated:, timezone:, starts_at:,
5151
end
5252

5353
def cycles_due_by(timestamp)
54-
walk(timestamp).first
54+
due, _pending = walk(timestamp)
55+
due
5556
end
5657

5758
def cycles_overlapping(range)
5859
cycles_due_by(range.end).select { |cycle| cycle.ended_at > range.begin && cycle.started_at < range.end }
5960
end
6061

6162
def due_after(timestamp)
62-
walk(timestamp).last&.due_at
63+
_due, pending = walk(timestamp)
64+
pending&.due_at
6365
end
6466

6567
def next_billing_at(timestamp)

0 commit comments

Comments
 (0)