Skip to content

Ensure invoice does not go above Usage Limit #12881

@easyCZ

Description

@easyCZ

We want to ensure that the number of credits on an invoice is at most the value of the spending limit. This is to provide users with a guarantee that they will not be charged for more than their spending limit.

To achieve this, we will need to do the following:

  • When updating a spending limit, prevent setting it below any existing accrued usage. The spending limit can be increased, but it cannot be decreased below the current usage.
  • When updating invoices, retrieve the spending limit for each Attribution ID and take the `min(usage, spending_limit)

See related (internal) conversation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature: billingmeta: staleThis issue/PR is stale and will be closed soonteam: webappIssue belongs to the WebApp team

    Type

    No type

    Projects

    Status

    In Validation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions