[SaaS] Provide BE data about subscription seats and ids to FE overage modal
Problem description
The seat overage modal requires the subscription seat data to display the modal to the user when there is an overage. The frontend needs a way to get the resulting overage when users are added to a group.
Proposal
Create an API endpoint that the frontend can pass the proposed membership changes and that returns the resulting seat count data.
Proposed schema:
query {
gitlabSubscriptionBillableUserCountChanges(
targetNamespaceId: Int!,
targetNamespaceType: NamespaceTypeEnum!, # either "GROUP" or "PROJECT"
role: RoleEnum! # eg "GUEST", "REPORTER"
addedUsers: [{ id: Int, email: String }], # can be empty/null. Either email or ID must be present in the object.
addedGroupId: Int
) {
hasNewOverage, # Bool! - whether or not there is a new overage after the users have been added (ie seats_owed increases as a result of this change)
seatsInSubscription, # Int! - purchased seat quantity in the subscription
resultingBillableUserCount # Int! - the number of billable users in the subscription after the proposed changes
}
}
Edited by Josianne Hyson