File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed
internal-packages/run-engine/src/batch-queue Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,9 @@ export class CreateBatchService extends WithRunEngine {
7171 throw entitlementValidation . error ;
7272 }
7373
74+ // Extract plan type from entitlement validation for billing tracking
75+ const planType = entitlementValidation . plan ?. type ;
76+
7477 // Get batch limits for this organization
7578 const { config, rateLimiter } = await getBatchLimits ( environment . organization ) ;
7679
@@ -148,6 +151,7 @@ export class CreateBatchService extends WithRunEngine {
148151 realtimeStreamsVersion : options . realtimeStreamsVersion ,
149152 idempotencyKey : body . idempotencyKey ,
150153 processingConcurrency : config . processingConcurrency ,
154+ planType,
151155 } ;
152156
153157 await this . _engine . initializeBatch ( initOptions ) ;
Original file line number Diff line number Diff line change @@ -697,6 +697,7 @@ export function setupBatchQueueCallbacks() {
697697 batchIndex : itemIndex ,
698698 skipChecks : true , // Already validated at batch level
699699 realtimeStreamsVersion : meta . realtimeStreamsVersion ,
700+ planType : meta . planType ,
700701 } ,
701702 "V2"
702703 ) ;
Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ export const BatchMeta = z.object({
7676 idempotencyKey : z . string ( ) . optional ( ) ,
7777 /** Processing concurrency limit for this batch's environment */
7878 processingConcurrency : z . number ( ) . optional ( ) ,
79+ /** Plan type for billing (e.g., "free", "paid") - used when skipChecks is enabled */
80+ planType : z . string ( ) . optional ( ) ,
7981} ) ;
8082export type BatchMeta = z . infer < typeof BatchMeta > ;
8183
@@ -161,6 +163,8 @@ export type InitializeBatchOptions = {
161163 idempotencyKey ?: string ;
162164 /** Processing concurrency limit for this batch's environment */
163165 processingConcurrency ?: number ;
166+ /** Plan type for billing (e.g., "free", "paid") - used when skipChecks is enabled */
167+ planType ?: string ;
164168} ;
165169
166170/**
You can’t perform that action at this time.
0 commit comments