Return stored seat counts in the subscriptions API endpoint
What does this MR do?
In the billing page, we display three counts from seat data that are updated once a day by UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker
-
Seats currently in use
is currently recalculated at the time of rendering, counting all the users that can be billed at the moment. -
Max seats used
currently renders the value stored in the database, so its value could be behindSeats currently in use
at any point if more members were added after the update has been performed. -
Seats owed
is also calculated at the time of rendering and depends on the value ofMax seats used
.
This MR updates the GET gitlab_subscription for namespace
response so that the counts displayed from the GitlabSubscription
are what we have stored in the database (the values saved once a day). This way we avoid presenting inconsistencies in the seats data we display.
Related issue
https://gitlab.com/gitlab-org/gitlab/-/issues/233444
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Amparo Luna