API endpoint design & implementation: Subscription information
Problem
While working on #679 (closed) we want to show purchases and seats in the UI.
This becomes a problem when a subscription
- Self-Managed and has a true-up
- GitLab.com and users have been added to the group
Since this data isn't exposed by the backend, we'd need to make these calculations in the UI. Previously this wasn't a problem since the UI listed individual purchases, and did not add the total up.
Proposal
Design and implement a /subscriptions
endpoint with a clear contract of what data is available.
Possibly this could be done with graphql: #889 (closed) but that's a stretch-goal.
Alternatively subscription_presenter
can be augmented with the required information.
In any case, this is calculating seats purchased and seats used; so it's a non-trivial product effect here.
Result
We can trust that data in the UI accurately reflects the correct data