rez_core 5.0.16 → 5.0.17
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/dist/module/meta/service/entity-dynamic.service.js +2 -2
- package/dist/module/meta/service/entity-dynamic.service.js.map +1 -1
- package/dist/module/workflow/service/stage-group.service.d.ts +6 -2
- package/dist/module/workflow/service/stage-group.service.js +37 -11
- package/dist/module/workflow/service/stage-group.service.js.map +1 -1
- package/dist/module/workflow/workflow.module.js +3 -1
- package/dist/module/workflow/workflow.module.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/meta/service/entity-dynamic.service.ts +2 -2
- package/src/module/workflow/service/stage-group.service.ts +39 -18
- package/src/module/workflow/workflow.module.ts +3 -1
package/package.json
CHANGED
|
@@ -597,10 +597,10 @@ export class EntityDynamicService {
|
|
|
597
597
|
);
|
|
598
598
|
|
|
599
599
|
const columns = validAttributes
|
|
600
|
-
.map((attr) =>
|
|
600
|
+
.map((attr) => `t.${attr.attribute_key}`)
|
|
601
601
|
.join(', ');
|
|
602
602
|
const selectQuery = `SELECT ${columns}
|
|
603
|
-
FROM ${tableName}
|
|
603
|
+
FROM ${tableName} t
|
|
604
604
|
WHERE id = $1`;
|
|
605
605
|
|
|
606
606
|
const result = await this.dataSource.query(selectQuery, [id]);
|
|
@@ -13,6 +13,8 @@ import * as moment from 'moment';
|
|
|
13
13
|
import { MediaDataService } from 'src/module/meta/service/media-data.service';
|
|
14
14
|
import axios from 'axios';
|
|
15
15
|
import { ConfigService } from '@nestjs/config';
|
|
16
|
+
import { ListMasterData } from 'src/module/listmaster/entity/list-master.entity';
|
|
17
|
+
import { StageGroup } from '../entity/stage-group.entity';
|
|
16
18
|
|
|
17
19
|
@Injectable()
|
|
18
20
|
export class StageGroupService extends EntityServiceImpl {
|
|
@@ -27,6 +29,10 @@ export class StageGroupService extends EntityServiceImpl {
|
|
|
27
29
|
private readonly stageMovementRepo: Repository<StageMovementData>,
|
|
28
30
|
private readonly mediaDataService: MediaDataService,
|
|
29
31
|
private readonly configService: ConfigService,
|
|
32
|
+
@InjectRepository(ListMasterData)
|
|
33
|
+
private readonly listMasterRepo: Repository<ListMasterData>,
|
|
34
|
+
@InjectRepository(StageGroup)
|
|
35
|
+
private readonly stageGroupRepo: Repository<StageGroup>,
|
|
30
36
|
) {
|
|
31
37
|
super();
|
|
32
38
|
}
|
|
@@ -78,38 +84,53 @@ export class StageGroupService extends EntityServiceImpl {
|
|
|
78
84
|
|
|
79
85
|
// if (!workflowLevelMapping) return null;
|
|
80
86
|
|
|
81
|
-
let
|
|
82
|
-
stage_movement_data = await this.stageMovementRepo.find({
|
|
87
|
+
let stageMovement = await this.stageMovementRepo.find({
|
|
83
88
|
where: {
|
|
84
89
|
mapped_entity_type: 'LEAD',
|
|
85
90
|
mapped_entity_id: lead_id,
|
|
86
91
|
},
|
|
87
92
|
});
|
|
88
93
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
if (!stageMovement || stageMovement.length === 0) {
|
|
95
|
+
return [];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
console.log('stageMovementttegst', stageMovement);
|
|
99
|
+
|
|
100
|
+
const stageGroupData = await this.stageGroupRepo.findOne({
|
|
101
|
+
where: {
|
|
102
|
+
id: stageMovement[0].stage_group_id,
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
if (!stageGroupData) {
|
|
107
|
+
return [];
|
|
108
|
+
}
|
|
93
109
|
|
|
94
110
|
// 3) Lead status (parameterized)
|
|
95
111
|
let leadStatus: string | null = null;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
112
|
+
|
|
113
|
+
const leadData = await this.getEntityData('LEAD', lead_id, loggedInUser);
|
|
114
|
+
console.log('leadData', leadData);
|
|
115
|
+
const leadRecord = Array.isArray(leadData) ? leadData[0] : null;
|
|
116
|
+
|
|
117
|
+
if (leadRecord && leadRecord.lead_status != null) {
|
|
118
|
+
const leadStatusItem = await this.listMasterRepo.findOne({
|
|
119
|
+
where: {
|
|
120
|
+
id: leadRecord.lead_status,
|
|
121
|
+
organization_id: loggedInUser.organization_id,
|
|
122
|
+
},
|
|
123
|
+
select: ['name'],
|
|
124
|
+
});
|
|
125
|
+
if (leadStatusItem) {
|
|
126
|
+
leadStatus = leadStatusItem.name;
|
|
107
127
|
}
|
|
108
128
|
}
|
|
129
|
+
|
|
109
130
|
// 4. Fetch stage groups & hierarchy
|
|
110
131
|
const stageGroupAndStageHierarchy =
|
|
111
132
|
(await this.stageGroupRepository.getAllStageGroupAndStageHierarchy(
|
|
112
|
-
|
|
133
|
+
stageGroupData[0].workflow_id,
|
|
113
134
|
loggedInUser,
|
|
114
135
|
lead_id,
|
|
115
136
|
)) as Array<{
|
|
@@ -63,6 +63,7 @@ import { ActivityLogController } from './controller/activity-log.controller';
|
|
|
63
63
|
import { NotificationModule } from '../notification/notification.module';
|
|
64
64
|
import { MapperModule } from '../mapper/mapper.module';
|
|
65
65
|
import { WorkflowAutomationModule } from '../workflow-automation/workflow-automation.module';
|
|
66
|
+
import { ListMasterData } from '../listmaster/entity/list-master.entity';
|
|
66
67
|
|
|
67
68
|
@Module({
|
|
68
69
|
imports: [
|
|
@@ -83,9 +84,10 @@ import { WorkflowAutomationModule } from '../workflow-automation/workflow-automa
|
|
|
83
84
|
ActionDataEntity,
|
|
84
85
|
ActionResourcesMapping,
|
|
85
86
|
ActivityLog,
|
|
87
|
+
ListMasterData,
|
|
86
88
|
]),
|
|
87
|
-
EntityModule,
|
|
88
89
|
ListMasterModule,
|
|
90
|
+
EntityModule,
|
|
89
91
|
NotificationModule,
|
|
90
92
|
MapperModule,
|
|
91
93
|
WorkflowAutomationModule,
|