@@ -123,13 +123,35 @@ export class RunEngineTriggerTaskService {
123123 throw tagValidation . error ;
124124 }
125125
126- // Validate entitlement
127- const entitlementValidation = await this . validator . validateEntitlement ( {
128- environment,
129- } ) ;
126+ // Validate entitlement (unless skipChecks is enabled)
127+ let planType : string | undefined ;
128+
129+ if ( ! options . skipChecks ) {
130+ const entitlementValidation = await this . validator . validateEntitlement ( {
131+ environment,
132+ } ) ;
130133
131- if ( ! entitlementValidation . ok ) {
132- throw entitlementValidation . error ;
134+ if ( ! entitlementValidation . ok ) {
135+ throw entitlementValidation . error ;
136+ }
137+
138+ // Extract plan type from entitlement response
139+ planType = entitlementValidation . plan ?. type ;
140+ } else {
141+ // When skipChecks is enabled, planType should be passed via options
142+ planType = options . planType ;
143+
144+ if ( ! planType ) {
145+ logger . warn ( "Plan type not set but skipChecks is enabled" , {
146+ taskId,
147+ environment : {
148+ id : environment . id ,
149+ type : environment . type ,
150+ projectId : environment . projectId ,
151+ organizationId : environment . organizationId ,
152+ } ,
153+ } ) ;
154+ }
133155 }
134156
135157 const [ parseDelayError , delayUntil ] = await tryCatch ( parseDelay ( body . options ?. delay ) ) ;
@@ -313,6 +335,7 @@ export class RunEngineTriggerTaskService {
313335 scheduleInstanceId : options . scheduleInstanceId ,
314336 createdAt : options . overrideCreatedAt ,
315337 bulkActionId : body . options ?. bulkActionId ,
338+ planType,
316339 } ,
317340 this . prisma
318341 ) ;
0 commit comments