feat: add DataBillingMeter and DataAggregateLimitCounter node types#1105
Merged
pyramation merged 1 commit intomainfrom May 10, 2026
Merged
feat: add DataBillingMeter and DataAggregateLimitCounter node types#1105pyramation merged 1 commit intomainfrom
pyramation merged 1 commit intomainfrom
Conversation
Add upstream node type definitions for billing/metering: - DataBillingMeter: attaches record_usage triggers to tables for billing meter tracking (increment on INSERT, decrement on DELETE, transfer on UPDATE when entity_field changes) - DataAggregateLimitCounter: attaches org_limit_aggregates_inc/dec triggers for per-entity aggregate limit tracking (vs per-user limits in DataLimitCounter)
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Adds two new node type definitions to
packages/node-type-registryfor billing and aggregate limit tracking:DataBillingMeter— Declares a billing usage-recording trigger on a table. Callsrecord_usageon INSERT (increment), DELETE (reversal), and optionally UPDATE (transfer whenentity_fieldchanges). Required param:meter_slug.DataAggregateLimitCounter— Declares per-entity (org-level) aggregate limit triggers viaorg_limit_aggregates_inc/dec, complementing the existing per-userDataLimitCounter. Required param:limit_name.Both follow the existing
NodeTypeDefinitionpattern and are exported fromsrc/data/index.ts.The corresponding SQL generators live in
constructive-io/constructive-db:DataAggregateLimitCountergenerator — merged via PR feat(presigned-url): add per-bucket mutation entry points on root Mutation type #1071DataBillingMetergenerator — in PR feat(presigned-url): enforce bulk upload limits (maxBulkFiles + maxBulkTotalSize) #1081 (billing metering phase 1)Review & Testing Checklist for Human
DataBillingMeter.parameter_schemamatches the parameters consumed by thedata_billing_metergenerator in constructive-db (meter_slug,entity_field,quantity,events)DataAggregateLimitCounter.parameter_schemamatches thedata_aggregate_limit_countergenerator (limit_name,entity_field,events)descriptiontext accurately reflects runtime behavior for both nodesNotes
metaschema-generatorsin constructive-db.DataBillingMeterincludes aquantityparam (default 1) thatDataAggregateLimitCounterdoes not, mirroring the difference between billing (variable units) and limits (always ±1). This matches the generator implementations.Link to Devin session: https://app.devin.ai/sessions/6e29559e7a5d4074810f0bd0273dcfc3
Requested by: @pyramation