Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(daily_usage): Compute and store usage_diff #2800

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

vincent-pochet
Copy link
Collaborator

Context

This PR is part of the Usage Revenue and unit.

Today, Lago does not offer a way to retrieve customer usage with a granularity lower than the billing period (via invoices and fees). On the other end, it is possible to get the current usage for a customer/subscription, but this usage is just a “snapshot” of the usage a the current time.

Description

This PR adds a new usage_diff field to the DailyUsage. The logic to compute the daily usage is also updated to fill this new field.

@vincent-pochet vincent-pochet force-pushed the feat-daily-usage-diff branch 6 times, most recently from 340dd9e to 7bc1244 Compare November 15, 2024 15:33
@vincent-pochet vincent-pochet marked this pull request as ready for review November 15, 2024 15:33
Copy link
Contributor

@nudded nudded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

app/services/daily_usages/compute_service.rb Outdated Show resolved Hide resolved
@vincent-pochet vincent-pochet merged commit ea26d28 into main Nov 21, 2024
6 checks passed
@vincent-pochet vincent-pochet deleted the feat-daily-usage-diff branch November 21, 2024 08:25
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.

2 participants