Add service to preview billable user changes
What does this MR do and why?
Issue: #354768 (closed)
This adds a service that calculates how adding users to a group affects the billable members count for that group.
Nothing uses this yet, but it will eventually sit behind GraphQL (see !90195 (merged)) and will be used by the frontend to display a warning if the additional users will cause the subscription to go into an overage.
There are three ways to add users:
- by group
- by emails
- by user ids
There are a couple things to keep in mind:
- We want to deduplicate users so we don't count them multiple times.
- Any added email that doesn't have an associated User counts as +1 billable member.
- Ultimate subscriptions don't count guests as billable members.
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Ryan Cobb