Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update endpoints to handle Enterprise plans #4783

Merged
merged 21 commits into from Jan 19, 2024

Conversation

LMNTL
Copy link
Contributor

@LMNTL LMNTL commented Dec 22, 2023

Checklist

  1. If you've added code that should be tested, add tests
  2. If you've changed APIs, update (or create!) the documentation
  3. Ensure the tests pass
  4. Make sure that your code lints and that you've followed our coding style
  5. Write a title and, if necessary, a description of your work suitable for publishing in our release notes
  6. Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
  7. Open an issue in the docs if there are UI/UX changes

Description

Update endpoints to allow managing Enterprise plans. Update the service usage endpoint to get stats for all users in an organization if they have an Enterprise plan .

Notes

Mostly small changes - CustomerPortalView needed to be updated to handle the fact that Enterpise plans and storage add-ons aren't included in the default billing configuration. Also, the check in /organizations/{org id}/service_usage/ for all users in the current org has been uncommented, bugfixed, and made to only apply if the user has an Enterprise plan (Gold, Platinum.)

Related issues

Front-end changes are included in kpi#4782

Copy link
Contributor

@bufke bufke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget the unit test 😄

kobo/apps/stripe/views.py Outdated Show resolved Hide resolved
kpi/serializers/v2/service_usage.py Outdated Show resolved Hide resolved
Copy link

@jnm jnm changed the base branch from beta to release/2.023.48 December 27, 2023 20:02
@jnm jnm changed the base branch from release/2.023.48 to release/2.023.52 December 30, 2023 03:39
@LMNTL LMNTL requested a review from bufke January 12, 2024 20:34
@jnm jnm changed the base branch from release/2.023.52 to release/next-jnm January 17, 2024 15:07
@@ -0,0 +1,139 @@
import os
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file merits broader review. Let's call it out of scope of this PR and we can change it later too. I'd love to discuss consistent generation of test data.

Copy link
Contributor

@bufke bufke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub requires me to type here

@LMNTL LMNTL requested a review from bufke January 19, 2024 19:33
Copy link
Contributor

@bufke bufke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Is this the right branch to merge to? Do we still need to test it more on a staging site since changes were made?

@bufke bufke merged commit 8a2ac17 into release/next-jnm Jan 19, 2024
4 checks passed
@LMNTL LMNTL deleted the enterprise-plan-backend branch January 23, 2024 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants