feat(deco-ai-gateway): move billing defaults to database config table#272
Merged
JonasJesus42 merged 2 commits intomainfrom Mar 3, 2026
Merged
feat(deco-ai-gateway): move billing defaults to database config table#272JonasJesus42 merged 2 commits intomainfrom
JonasJesus42 merged 2 commits intomainfrom
Conversation
Create llm_gateway_config singleton table to store configurable billing defaults (prepaid/postpaid limits, hard cap, markup %, min Stripe amount). Replace hardcoded constants with async loadGatewayDefaults() that reads from DB with 5-min cache and falls back to previous hardcoded values. Made-with: Cursor
🚀 Preview Deployments Ready!Your changes have been deployed to preview environments: 📦
|
Contributor
There was a problem hiding this comment.
1 issue found across 8 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="deco-ai-gateway/server/db/schema.sql">
<violation number="1" location="deco-ai-gateway/server/db/schema.sql:44">
P2: This introduces a duplicated schema/policy definition for `llm_gateway_config` in the same script. Keep a single source of truth to avoid drift when defaults or policy rules change.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
The config table was defined in both PART 1 (main schema) and PART 3 (migrations). Since PART 1 already uses CREATE TABLE IF NOT EXISTS, the migration block was fully redundant. Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Create llm_gateway_config singleton table to store configurable billing defaults (prepaid/postpaid limits, hard cap, markup %, min Stripe amount). Replace hardcoded constants with async loadGatewayDefaults() that reads from DB with 5-min cache and falls back to previous hardcoded values.
Made-with: Cursor
Summary by cubic
Moves billing defaults to a DB-backed config so limits, hard cap, markup, and minimum Stripe charge can be changed without deploys. Also removes a duplicate llm_gateway_config schema definition.
New Features
Migration
Written for commit f6ff84e. Summary will update on new commits.