rez_core 5.0.293 → 5.0.295

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "5.0.293",
3
+ "version": "5.0.295",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -23,16 +23,16 @@ export class ScheduleHandlerService {
23
23
  private readonly listMasterRepo: Repository<ListMasterData>,
24
24
  ) {}
25
25
 
26
- async scheduleQueryBuilder(workflowId: number, jobData: any) {
26
+ async scheduleQueryBuilder(workflow_id: number, jobData: any) {
27
27
  // 1️⃣ Fetch workflow automation config
28
28
  const workflow = await this.workflowAutomation.findOne({
29
29
  where: {
30
- id: workflowId,
31
- organization_id: jobData.organizationId,
30
+ id: workflow_id,
31
+ organization_id: jobData.organization_id,
32
32
  },
33
33
  });
34
34
 
35
- if (!workflow) throw new Error(`Workflow with ID ${workflowId} not found`);
35
+ if (!workflow) throw new Error(`Workflow with ID ${workflow_id} not found`);
36
36
 
37
37
  const scheduleJson =
38
38
  typeof workflow.schedule === 'string'
@@ -45,7 +45,7 @@ export class ScheduleHandlerService {
45
45
  const entity = await this.entityMasterRepository.findOne({
46
46
  where: {
47
47
  mapped_entity_type: entityType,
48
- organization_id: jobData.organizationId,
48
+ organization_id: jobData.organization_id,
49
49
  },
50
50
  select: ['db_table_name'],
51
51
  });
@@ -100,7 +100,7 @@ export class ScheduleHandlerService {
100
100
  .select('e.*')
101
101
  .where(comparisonDateCondition)
102
102
  .andWhere('e.organization_id = :orgId', {
103
- orgId: jobData.organizationId,
103
+ orgId: jobData.organization_id,
104
104
  });
105
105
 
106
106
  this.logger.debug(`Executing Scheduler Query: ${qb.getSql()}`);
@@ -115,19 +115,19 @@ export class ScheduleHandlerService {
115
115
  }
116
116
 
117
117
  // ⚙️ Step 2: Handle scheduled automation (main entry point)
118
- async handleScheduledWorkflow(workflowId: number, jobData: any) {
118
+ async handleScheduledWorkflow(workflow_id: number, jobData: any) {
119
119
  const { results, workflow, tableName } = await this.scheduleQueryBuilder(
120
- workflowId,
120
+ workflow_id,
121
121
  jobData,
122
122
  );
123
123
 
124
124
  if (!results?.length) {
125
- this.logger.warn(`No records found for scheduled workflow ${workflowId}`);
125
+ this.logger.warn(`No records found for scheduled workflow ${workflow_id}`);
126
126
  return;
127
127
  }
128
128
 
129
129
  this.logger.log(
130
- `Processing ${results.length} records for workflow ${workflowId}`,
130
+ `Processing ${results.length} records for workflow ${workflow_id}`,
131
131
  );
132
132
 
133
133
  // Parse the workflow event JSON again to get filter/action info
@@ -157,7 +157,7 @@ export class ScheduleHandlerService {
157
157
 
158
158
  // 🧮 Step 3: Execute workflow actions for matched entities
159
159
  if (!matchedEntities.length) {
160
- this.logger.log(`No records passed criteria for workflow ${workflowId}`);
160
+ this.logger.log(`No records passed criteria for workflow ${workflow_id}`);
161
161
  return;
162
162
  }
163
163
 
@@ -167,7 +167,7 @@ export class ScheduleHandlerService {
167
167
 
168
168
  for (const entity of matchedEntities) {
169
169
  await this.workflowAutomationEngineService.executeActions(
170
- workflowId,
170
+ workflow_id,
171
171
  entity,
172
172
  jobData,
173
173
  );
@@ -5,6 +5,7 @@
5
5
  import { UserData } from "src/module/user/entity/user.entity";
6
6
 
7
7
  export interface ScheduleJobData {
8
+ id: number;
8
9
  schedule_id: number;
9
10
  workflow_id: number;
10
11
  workflow_name: string;
@@ -368,6 +368,7 @@ export class WorkflowScheduleService {
368
368
  const schedule = await this.getScheduleById(scheduleId);
369
369
 
370
370
  const jobData: ScheduleJobData = {
371
+ id:loggedInUser.id,
371
372
  schedule_id: schedule.id,
372
373
  workflow_id: schedule.workflow_id,
373
374
  workflow_name: schedule.workflow_name,
@@ -520,6 +521,7 @@ export class WorkflowScheduleService {
520
521
  */
521
522
  private async scheduleJob(schedule: ScheduledWorkflow, loggedInUser: UserData): Promise<void> {
522
523
  const jobData: ScheduleJobData = {
524
+ id:loggedInUser.id,
523
525
  schedule_id: schedule.id,
524
526
  workflow_id: schedule.workflow_id,
525
527
  workflow_name: schedule.workflow_name,