rez_core 5.0.287 → 5.0.288

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.287",
3
+ "version": "5.0.288",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -38,7 +38,7 @@ export class ScheduleHandlerService {
38
38
  typeof workflow.schedule === 'string'
39
39
  ? JSON.parse(workflow.schedule)
40
40
  : workflow.schedule;
41
-
41
+
42
42
  const entityType = workflow.applicable_entity_type;
43
43
 
44
44
  // 2️⃣ Get table name from frm_entity_master
@@ -47,11 +47,11 @@ export class ScheduleHandlerService {
47
47
  mapped_entity_type: entityType,
48
48
  organization_id: jobData.organizationId,
49
49
  },
50
- select: ['data_source'],
50
+ select: ['db_table_name'],
51
51
  });
52
52
  if (!entity?.data_source) throw new Error(`Entity ${entityType} not found`);
53
53
 
54
- const tableName = entity.data_source;
54
+ const tableName = entity.db_table_name;
55
55
 
56
56
  // 3️⃣ Resolve executionDate (list master item name)
57
57
  const executionDateItem = await this.listMasterRepo.findOne({
@@ -88,10 +88,18 @@ export class ScheduleHandlerService {
88
88
 
89
89
  const qb = this.dataSource
90
90
  .createQueryBuilder()
91
- .from(tableName, tableName)
92
- .select('*')
91
+ .from(tableName, 'e')
92
+ .innerJoin(
93
+ 'frm_wf_stage_movement_data',
94
+ 'sm',
95
+ `
96
+ sm.mapped_entity_id = e.id
97
+ AND sm.is_current = 'Y'
98
+ `,
99
+ )
100
+ .select('e.*')
93
101
  .where(comparisonDateCondition)
94
- .andWhere(`${tableName}.organization_id = :orgId`, {
102
+ .andWhere('e.organization_id = :orgId', {
95
103
  orgId: jobData.organizationId,
96
104
  });
97
105