passwordless-server icon indicating copy to clipboard operation
passwordless-server copied to clipboard

PAS-444 | Populate metered billing from periodic credential reports.

Open jonashendrickx opened this issue 1 year ago • 1 comments

Ticket

Description

This is the first step to populate metered billing from periodic credential reports in the api. Stripe recommends we keep the usage records ourselves, so for this the periodic credential reports will serve their purpose.

In step 2 of the refactoring, we will stop updating the CurrentUserCount in the Applications table periodically, but instead do it upon login of an admin to significantly reduce network traffic.

Shape

Screenshots

For testing I populated PeriodicCredentialReports first. Then forced the background job to run:

image

Checklist

I did the following to ensure that my changes were tested thoroughly:

  • Tested locally.

I did the following to ensure that my changes do not introduce security vulnerabilities:

  • __

jonashendrickx avatar May 01 '24 14:05 jonashendrickx

Codecov Report

Attention: Patch coverage is 0% with 61 lines in your changes are missing coverage. Please review.

Project coverage is 32.56%. Comparing base (9657e87) to head (ba09d4a).

Files Patch % Lines
...kgroundServices/MeteredBillingBackgroundService.cs 0.00% 43 Missing :warning:
...dminConsole/Services/SharedStripeBillingService.cs 0.00% 15 Missing :warning:
src/AdminConsole/Billing/NoOpBillingService.cs 0.00% 2 Missing :warning:
src/AdminConsole/Services/BaseBillingService.cs 0.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #576      +/-   ##
==========================================
- Coverage   32.58%   32.56%   -0.02%     
==========================================
  Files         525      525              
  Lines       26561    26576      +15     
  Branches      860      865       +5     
==========================================
  Hits         8655     8655              
- Misses      17785    17800      +15     
  Partials      121      121              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 02 '24 07:05 codecov[bot]