Skip to content

improvement(admin): cleanup included usage settings for enterprise#5825

Merged
icecrasher321 merged 1 commit into
stagingfrom
improvement/admin-incl-usage-cleanup
Jul 21, 2026
Merged

improvement(admin): cleanup included usage settings for enterprise#5825
icecrasher321 merged 1 commit into
stagingfrom
improvement/admin-incl-usage-cleanup

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

Cleanup included usage references for enterprise.

Type of Change

  • Other: Code Cleanup

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 21, 2026 11:13pm

Request Review

@cursor

cursor Bot commented Jul 21, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes org usage limit calculation, Enterprise Stripe metadata shape, and admin limit APIs across provisioning, webhooks, and grants; mis-sync could affect effective caps until webhooks apply.

Overview
Removes included monthly usage as a first-class Enterprise billing concept and tightens how admins see and edit limits.

Enterprise billing no longer reads or writes includedMonthlyCredits in Stripe metadata, provisioning payloads, or credit math. Effective usage is configured usage limit + prepaid only (defaulting usage to invoice amount when metadata is missing). Issuance dedupe keys move from enterprise-v2 to enterprise-v3 without the included-credits term.

Admin dashboard API renames Team pooled allowance to planAllowanceDollars (nullable on summaries), drops includedMonthlyDollars from limits PATCH and provisioning views, and adds configurationUpdate on organization detail for in-flight Enterprise metadata sync (pending/processing/failed requested limits, seats, concurrency).

resolveEnterpriseMetadataIntent now surfaces a configurationUpdate object (hidden once the webhook applies simConfigOperationId), with toDashboardConfigurationUpdate mapping requested credits to dollars for the UI.

Reviewed by Cursor Bugbot for commit ecee977. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes the legacy included-usage setting from Enterprise billing. The main changes are:

  • Uses configured usage limits plus prepaid balance for Enterprise credit calculations.
  • Renames Team allowance fields to planAllowanceDollars.
  • Removes included-usage fields from provisioning payloads and Stripe metadata.
  • Adds pending configuration updates to admin organization details.

Confidence Score: 4/5

Existing Enterprise subscriptions can receive lower usage limits after reconciliation or an admin credit grant.

  • Webhook reconciliation no longer honors a larger stored included allowance.
  • Credit grants treat the legacy Enterprise allowance as zero when no configured usage limit exists.
  • New provisioning payloads and admin response shapes are otherwise consistent with the updated contracts.

apps/sim/lib/billing/enterprise-credit-limits.ts and apps/sim/lib/admin/dashboard.ts

Important Files Changed

Filename Overview
apps/sim/lib/billing/enterprise-credit-limits.ts Removes the included-credit floor, which can lower limits for existing Enterprise metadata.
apps/sim/lib/admin/dashboard.ts Updates admin allowance fields and configuration state, but legacy Enterprise grants can lose their allowance fallback.
apps/sim/lib/billing/enterprise-outbox.ts Removes the obsolete provisioning field and exposes normalized configuration-update state.
apps/sim/lib/billing/enterprise-provisioning.ts Moves provisioning keys to v3 and stops emitting included-allowance metadata.
apps/sim/lib/api/contracts/v1/admin/dashboard.ts Updates admin schemas for plan allowances and pending configuration updates.
apps/sim/lib/billing/webhooks/enterprise.ts Uses the revised Enterprise limit calculation during subscription reconciliation.

Reviews (1): Last reviewed commit: "improvement(admin): cleanup included usa..." | Re-trigger Greptile

Comment thread apps/sim/lib/billing/enterprise-credit-limits.ts
Comment thread apps/sim/lib/admin/dashboard.ts
@icecrasher321
icecrasher321 merged commit 995167d into staging Jul 21, 2026
20 checks passed
@waleedlatif1
waleedlatif1 deleted the improvement/admin-incl-usage-cleanup branch July 22, 2026 00:02
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.

1 participant