This part of trigger-event.usecase.ts seems to be throwing the error where firstJob is undefined.
for (const job of jobs) {
const firstJob = await this.jobRepository.storeJobs(job);
await this.addJobUsecase.execute({
userId: firstJob._userId,
environmentId: firstJob._environmentId,
organizationId: firstJob._organizationId,
jobId: firstJob._id,
});
}