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

NLP usage tracking and limits based on subscription plan and one time add ons #5131

Draft
wants to merge 39 commits into
base: billing-addons-backend
Choose a base branch
from

Conversation

Guitlle
Copy link

@Guitlle Guitlle commented Sep 28, 2024

Description

This PR provides the logic for the NLP usage counts tracking and also limits enforcing. Limits are based on the subscription plan and one time add ons. Some refactoring was involved to organize the utilities, comments are welcome to improve the organization of the code.

Notes

Changes on the following components:

  • kobo/apps/organizations
    • Added a function to get the organization for a user id
  • kobo/apps/stripe
    • Logic for the PlanAddOn model to get the total counters for organization as well as modifying the increment function to receive an organization instead of an user.
  • kobo/apps/trackers
    • Moved some general usage tracking utility functions to this app in order to organize things better, updated the NLP update counter function to use the new logic.
  • kobo/apps/subsequences
    • The google integrations have been modified to check that the remaining organization usage is enough to process the amount for a new usage request

Related issues

Notion TASK-1014
Notion TASK-1004

Guitlle and others added 30 commits August 28, 2024 12:56
@Guitlle Guitlle self-assigned this Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants