rez_core 7.0.7 → 7.0.9
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/config/database.config.js +1 -1
- package/dist/config/database.config.js.map +1 -1
- package/dist/module/filter/controller/filter.controller.d.ts +9 -0
- package/dist/module/filter/controller/filter.controller.js +45 -0
- package/dist/module/filter/controller/filter.controller.js.map +1 -1
- package/dist/module/filter/service/filter.service.d.ts +16 -1
- package/dist/module/filter/service/filter.service.js +163 -1
- package/dist/module/filter/service/filter.service.js.map +1 -1
- package/dist/module/linked_attributes/service/linked_attributes.service.d.ts +3 -1
- package/dist/module/linked_attributes/service/linked_attributes.service.js +7 -3
- package/dist/module/linked_attributes/service/linked_attributes.service.js.map +1 -1
- package/dist/module/listmaster/repository/list-master-items.repository.d.ts +1 -1
- package/dist/module/listmaster/repository/list-master-items.repository.js +36 -5
- package/dist/module/listmaster/repository/list-master-items.repository.js.map +1 -1
- package/dist/module/meta/service/entity-dynamic.service.js +18 -14
- package/dist/module/meta/service/entity-dynamic.service.js.map +1 -1
- package/dist/module/workflow/controller/workflow.controller.d.ts +0 -1
- package/dist/module/workflow/controller/workflow.controller.js.map +1 -1
- package/dist/module/workflow/service/workflow-meta.service.js +20 -20
- package/dist/module/workflow/service/workflow-meta.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/config/database.config.ts +1 -1
- package/src/module/filter/controller/filter.controller.ts +125 -0
- package/src/module/filter/service/filter.service.ts +339 -6
- package/src/module/linked_attributes/service/linked_attributes.service.ts +2 -0
- package/src/module/listmaster/repository/list-master-items.repository.ts +45 -9
- package/src/module/meta/service/entity-dynamic.service.ts +82 -38
- package/src/module/workflow/controller/workflow.controller.ts +0 -1
- package/src/module/workflow/service/workflow-meta.service.ts +31 -28
- package/src/resources/dev.properties.yaml +2 -2
- package/.claude/settings.local.json +0 -26
- package/.idea/250218_nodejs_core.iml +0 -9
- package/.idea/codeStyles/Project.xml +0 -59
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/copilot.data.migration.agent.xml +0 -6
- package/.idea/copilot.data.migration.ask.xml +0 -6
- package/.idea/copilot.data.migration.ask2agent.xml +0 -6
- package/.idea/copilot.data.migration.edit.xml +0 -6
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -6
- package/.idea/vcs.xml +0 -6
- package/server.log +0 -850
|
@@ -32,10 +32,16 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
32
32
|
mainID?: number,
|
|
33
33
|
): Promise<any> {
|
|
34
34
|
const enterprise_id = loggedInUser.enterprise_id;
|
|
35
|
-
const entityMaster =
|
|
35
|
+
const entityMaster =
|
|
36
|
+
await this.entityMasterRepo.getEntityByMappedEntityType(
|
|
37
|
+
entityType,
|
|
38
|
+
loggedInUser.enterprise_id,
|
|
39
|
+
);
|
|
36
40
|
|
|
37
41
|
if (!entityMaster) {
|
|
38
|
-
throw new BadRequestException(
|
|
42
|
+
throw new BadRequestException(
|
|
43
|
+
`Entity With ${entityType} entity type not found`,
|
|
44
|
+
);
|
|
39
45
|
}
|
|
40
46
|
let tableName: string;
|
|
41
47
|
if (StorageType.SELF === entityMaster.storage_type) {
|
|
@@ -95,7 +101,6 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
95
101
|
maxSeq++;
|
|
96
102
|
entityData.code = `${entityData.entity_type}${maxSeq}`;
|
|
97
103
|
|
|
98
|
-
|
|
99
104
|
// -------------------------------------------------------
|
|
100
105
|
// Parent ID
|
|
101
106
|
// -------------------------------------------------------
|
|
@@ -142,7 +147,10 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
142
147
|
for (const attr of validAttributes) {
|
|
143
148
|
if (attr.attribute_key === 'id' && !entityData.id) continue;
|
|
144
149
|
|
|
145
|
-
if (
|
|
150
|
+
if (
|
|
151
|
+
attr.storage_type.toLowerCase() ===
|
|
152
|
+
AttributeStorageType.EAV.toLowerCase()
|
|
153
|
+
) {
|
|
146
154
|
if (entityData[attr.attribute_key] !== undefined) {
|
|
147
155
|
eavAttributes.push({
|
|
148
156
|
key: attr.attribute_key,
|
|
@@ -160,7 +168,6 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
160
168
|
const colList = columns.map((c) => `"${c}"`).join(', ');
|
|
161
169
|
const placeholderList = placeholders.join(', ');
|
|
162
170
|
|
|
163
|
-
|
|
164
171
|
const sql = `
|
|
165
172
|
INSERT INTO ${this.schema}.${tableName} (${colList})
|
|
166
173
|
VALUES (${placeholderList}) RETURNING *
|
|
@@ -273,7 +280,7 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
273
280
|
entityType: string,
|
|
274
281
|
id: number | string,
|
|
275
282
|
loggedInUser: any,
|
|
276
|
-
resolved?:boolean
|
|
283
|
+
resolved?: boolean,
|
|
277
284
|
): Promise<any> {
|
|
278
285
|
let mainEntity = await this.getEntityByDataSource(
|
|
279
286
|
entityType,
|
|
@@ -281,8 +288,12 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
281
288
|
loggedInUser,
|
|
282
289
|
);
|
|
283
290
|
|
|
284
|
-
if(resolved) {
|
|
285
|
-
mainEntity = await this.resolverService.getResolvedData(
|
|
291
|
+
if (resolved) {
|
|
292
|
+
mainEntity = await this.resolverService.getResolvedData(
|
|
293
|
+
loggedInUser,
|
|
294
|
+
mainEntity,
|
|
295
|
+
entityType,
|
|
296
|
+
);
|
|
286
297
|
}
|
|
287
298
|
|
|
288
299
|
const relationRepo = this.reflectionHelper.getRepoService('EntityRelation');
|
|
@@ -322,7 +333,7 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
322
333
|
response.mappedEntities = await this.formatMappedEntities(
|
|
323
334
|
relatedEntities,
|
|
324
335
|
loggedInUser,
|
|
325
|
-
resolved
|
|
336
|
+
resolved,
|
|
326
337
|
);
|
|
327
338
|
}
|
|
328
339
|
|
|
@@ -333,7 +344,7 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
333
344
|
async formatMappedEntities(
|
|
334
345
|
relatedEntities: any[],
|
|
335
346
|
loggedInUser: any,
|
|
336
|
-
resolved?:boolean
|
|
347
|
+
resolved?: boolean,
|
|
337
348
|
): Promise<any> {
|
|
338
349
|
const mappedEntities: any = {};
|
|
339
350
|
|
|
@@ -345,7 +356,7 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
345
356
|
targetEntityType,
|
|
346
357
|
targetEntityId,
|
|
347
358
|
loggedInUser,
|
|
348
|
-
resolved
|
|
359
|
+
resolved,
|
|
349
360
|
);
|
|
350
361
|
|
|
351
362
|
if (!mappedEntities[targetEntityType]) {
|
|
@@ -552,7 +563,10 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
552
563
|
for (const key of Object.keys(entityData)) {
|
|
553
564
|
const attr = validAttributes.find((attr) => attr.attribute_key === key);
|
|
554
565
|
if (attr) {
|
|
555
|
-
if (
|
|
566
|
+
if (
|
|
567
|
+
attr.storage_type.toLowerCase() ===
|
|
568
|
+
AttributeStorageType.EAV.toLowerCase()
|
|
569
|
+
) {
|
|
556
570
|
eavAttributes.push({
|
|
557
571
|
key: attr.attribute_key,
|
|
558
572
|
value: entityData[key],
|
|
@@ -613,7 +627,10 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
613
627
|
): Promise<any> {
|
|
614
628
|
const enterprise_id = loggedInUser.enterprise_id;
|
|
615
629
|
|
|
616
|
-
const entityMaster = await this.entityMasterService.getEntityData(
|
|
630
|
+
const entityMaster = await this.entityMasterService.getEntityData(
|
|
631
|
+
entityType,
|
|
632
|
+
loggedInUser,
|
|
633
|
+
);
|
|
617
634
|
|
|
618
635
|
let dataSource: string;
|
|
619
636
|
if (StorageType.SELF === entityMaster.storage_type) {
|
|
@@ -629,7 +646,9 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
629
646
|
);
|
|
630
647
|
|
|
631
648
|
// Filter out EAV attributes from SQL query
|
|
632
|
-
const dbColumns = validAttributes.filter(
|
|
649
|
+
const dbColumns = validAttributes.filter(
|
|
650
|
+
(attr) => attr.storage_type !== AttributeStorageType.EAV,
|
|
651
|
+
);
|
|
633
652
|
const columns = dbColumns
|
|
634
653
|
.map((attr) => `"${attr.attribute_key}"`)
|
|
635
654
|
.join(', ');
|
|
@@ -639,7 +658,7 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
639
658
|
let selectColumns = columns;
|
|
640
659
|
if (!columns) {
|
|
641
660
|
selectColumns = 'id';
|
|
642
|
-
} else if (!dbColumns.some(c => c.attribute_key === 'id')) {
|
|
661
|
+
} else if (!dbColumns.some((c) => c.attribute_key === 'id')) {
|
|
643
662
|
selectColumns += ', id';
|
|
644
663
|
}
|
|
645
664
|
|
|
@@ -653,7 +672,9 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
653
672
|
const row = result[0];
|
|
654
673
|
|
|
655
674
|
// Fetch EAV attributes
|
|
656
|
-
const eavAttributes = validAttributes.filter(
|
|
675
|
+
const eavAttributes = validAttributes.filter(
|
|
676
|
+
(attr) => attr.storage_type === AttributeStorageType.EAV,
|
|
677
|
+
);
|
|
657
678
|
if (eavAttributes.length > 0) {
|
|
658
679
|
for (const attr of eavAttributes) {
|
|
659
680
|
if (this.eavService.isTypeSupported(attr.db_datatype)) {
|
|
@@ -684,9 +705,9 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
684
705
|
row[attr.attribute_key] =
|
|
685
706
|
row[attr.attribute_key] != null
|
|
686
707
|
? await this.mediaDataService.getMediaDownloadUrl(
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
708
|
+
Number(row[attr.attribute_key]),
|
|
709
|
+
loggedInUser,
|
|
710
|
+
)
|
|
690
711
|
: null;
|
|
691
712
|
}
|
|
692
713
|
}
|
|
@@ -703,7 +724,11 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
703
724
|
): Promise<any> {
|
|
704
725
|
const enterprise_id = loggedInUser.enterprise_id;
|
|
705
726
|
|
|
706
|
-
const entityMaster =
|
|
727
|
+
const entityMaster =
|
|
728
|
+
await this.entityMasterRepo.getEntityByMappedEntityType(
|
|
729
|
+
entityType,
|
|
730
|
+
enterprise_id,
|
|
731
|
+
);
|
|
707
732
|
if (!entityMaster) return null;
|
|
708
733
|
|
|
709
734
|
const validAttributes = await this.getAttributeCodes(
|
|
@@ -714,11 +739,13 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
714
739
|
// const entityRepo = this.reflectionHelper.getRepoService(entityMaster?.entity_data_class);
|
|
715
740
|
|
|
716
741
|
// Filter out EAV attributes from SQL query
|
|
717
|
-
const dbColumns = validAttributes.filter(
|
|
718
|
-
|
|
742
|
+
const dbColumns = validAttributes.filter(
|
|
743
|
+
(attr) => attr.storage_type !== AttributeStorageType.EAV,
|
|
744
|
+
);
|
|
745
|
+
const columns = dbColumns.map((attr) => `t.${attr.attribute_key}`);
|
|
719
746
|
|
|
720
747
|
// Add id if not present (required)
|
|
721
|
-
if (!columns.some(c => c.includes('.id'))) {
|
|
748
|
+
if (!columns.some((c) => c.includes('.id'))) {
|
|
722
749
|
columns.push('t.id');
|
|
723
750
|
}
|
|
724
751
|
|
|
@@ -738,7 +765,9 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
738
765
|
const row = result[0];
|
|
739
766
|
|
|
740
767
|
// Fetch EAV attributes
|
|
741
|
-
const eavAttributes = validAttributes.filter(
|
|
768
|
+
const eavAttributes = validAttributes.filter(
|
|
769
|
+
(attr) => attr.storage_type === AttributeStorageType.EAV,
|
|
770
|
+
);
|
|
742
771
|
if (eavAttributes.length > 0) {
|
|
743
772
|
for (const attr of eavAttributes) {
|
|
744
773
|
if (this.eavService.isTypeSupported(attr.db_datatype)) {
|
|
@@ -769,9 +798,9 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
769
798
|
row[attr.attribute_key] =
|
|
770
799
|
row[attr.attribute_key] != null
|
|
771
800
|
? await this.mediaDataService.getMediaDownloadUrl(
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
801
|
+
Number(row[attr.attribute_key]),
|
|
802
|
+
loggedInUser,
|
|
803
|
+
)
|
|
775
804
|
: null;
|
|
776
805
|
}
|
|
777
806
|
}
|
|
@@ -863,12 +892,20 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
863
892
|
const tableName = await this.getTableName(entityType, enterprise_id);
|
|
864
893
|
|
|
865
894
|
// Delete EAV records first
|
|
866
|
-
const validAttributes = await this.getAttributeCodes(
|
|
867
|
-
|
|
895
|
+
const validAttributes = await this.getAttributeCodes(
|
|
896
|
+
entityType,
|
|
897
|
+
enterprise_id,
|
|
898
|
+
false,
|
|
899
|
+
);
|
|
900
|
+
const eavAttributes = validAttributes.filter(
|
|
901
|
+
(attr) => attr.storage_type === AttributeStorageType.EAV,
|
|
902
|
+
);
|
|
868
903
|
|
|
869
904
|
if (eavAttributes.length > 0) {
|
|
870
905
|
// Group by data type to minimize calls
|
|
871
|
-
const dataTypes = [
|
|
906
|
+
const dataTypes = [
|
|
907
|
+
...new Set(eavAttributes.map((attr) => attr.db_datatype)),
|
|
908
|
+
];
|
|
872
909
|
|
|
873
910
|
for (const dataType of dataTypes) {
|
|
874
911
|
if (this.eavService.isTypeSupported(dataType)) {
|
|
@@ -876,7 +913,9 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
876
913
|
// Since delete accepts key, we iterate over keys or finding a way to delete all for entity
|
|
877
914
|
// The current EAV service delete method requires a key.
|
|
878
915
|
// Ideally EAV service should support delete by entity_id alone, but sticking to interface:
|
|
879
|
-
const attrsOfType = eavAttributes.filter(
|
|
916
|
+
const attrsOfType = eavAttributes.filter(
|
|
917
|
+
(attr) => attr.db_datatype === dataType,
|
|
918
|
+
);
|
|
880
919
|
for (const attr of attrsOfType) {
|
|
881
920
|
await this.eavService.delete(dataType, {
|
|
882
921
|
entity_type: entityType,
|
|
@@ -901,14 +940,19 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
901
940
|
loggedInUser: any,
|
|
902
941
|
appcode?: string,
|
|
903
942
|
): Promise<any> {
|
|
904
|
-
|
|
905
|
-
|
|
943
|
+
const entityMasters =
|
|
944
|
+
await this.entityMasterRepo.findByEnterpriseIdAndAppCode(
|
|
945
|
+
loggedInUser.enterprise_id,
|
|
946
|
+
appcode,
|
|
947
|
+
);
|
|
906
948
|
|
|
907
949
|
let dropdown = [] as any;
|
|
908
|
-
entityMasters.map(entityMaster =>
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
950
|
+
entityMasters.map((entityMaster) =>
|
|
951
|
+
dropdown.push({
|
|
952
|
+
label: entityMaster.name,
|
|
953
|
+
value: entityMaster.mapped_entity_type,
|
|
954
|
+
}),
|
|
955
|
+
);
|
|
912
956
|
|
|
913
957
|
return dropdown;
|
|
914
958
|
}
|
|
@@ -934,7 +978,7 @@ export class EntityDynamicService extends EntityServiceImpl {
|
|
|
934
978
|
// 2. Get current max sequence number from that table
|
|
935
979
|
const seqResult = await this.entityManager.query(
|
|
936
980
|
`SELECT MAX(id) AS max_seq_no
|
|
937
|
-
FROM ${tableName}
|
|
981
|
+
FROM ${this.schema}.${tableName}
|
|
938
982
|
WHERE entity_type = $1`,
|
|
939
983
|
[entityType],
|
|
940
984
|
);
|
|
@@ -38,9 +38,9 @@ export class WorkflowMetaService extends EntityServiceImpl {
|
|
|
38
38
|
@InjectRepository(StageGroup)
|
|
39
39
|
private readonly stageGroupRepo: Repository<StageGroup>,
|
|
40
40
|
@InjectRepository(ActionDataEntity)
|
|
41
|
-
private readonly actionDataEntityRepository:Repository<ActionDataEntity>,
|
|
41
|
+
private readonly actionDataEntityRepository: Repository<ActionDataEntity>,
|
|
42
42
|
@InjectRepository(TaskDataEntity)
|
|
43
|
-
private readonly taskDataEntityRepository:Repository<TaskDataEntity>,
|
|
43
|
+
private readonly taskDataEntityRepository: Repository<TaskDataEntity>,
|
|
44
44
|
) {
|
|
45
45
|
super();
|
|
46
46
|
}
|
|
@@ -223,7 +223,8 @@ export class WorkflowMetaService extends EntityServiceImpl {
|
|
|
223
223
|
);
|
|
224
224
|
|
|
225
225
|
for (const action of stageActions) {
|
|
226
|
-
const actionCategoryRepo =
|
|
226
|
+
const actionCategoryRepo =
|
|
227
|
+
this.reflectionHelper.getRepoService('ActionCategory');
|
|
227
228
|
const actionCategory = await actionCategoryRepo.findOne({
|
|
228
229
|
where: {
|
|
229
230
|
id: Number(action.action_category),
|
|
@@ -341,7 +342,8 @@ export class WorkflowMetaService extends EntityServiceImpl {
|
|
|
341
342
|
},
|
|
342
343
|
});
|
|
343
344
|
|
|
344
|
-
const listMasterItemsRepo =
|
|
345
|
+
const listMasterItemsRepo =
|
|
346
|
+
this.reflectionHelper.getRepoService('ListMasterItems');
|
|
345
347
|
|
|
346
348
|
const assignmentType = await listMasterItemsRepo.findOne({
|
|
347
349
|
where: {
|
|
@@ -367,7 +369,7 @@ export class WorkflowMetaService extends EntityServiceImpl {
|
|
|
367
369
|
|
|
368
370
|
if (
|
|
369
371
|
actionCategory?.code == 'OWAS' &&
|
|
370
|
-
assignmentType
|
|
372
|
+
assignmentType?.value == 'round_robin'
|
|
371
373
|
) {
|
|
372
374
|
console.log('Auto-assigning owner based on round-robin assignment type');
|
|
373
375
|
await this.assignLead(
|
|
@@ -411,13 +413,14 @@ export class WorkflowMetaService extends EntityServiceImpl {
|
|
|
411
413
|
loggedInUser,
|
|
412
414
|
);
|
|
413
415
|
|
|
414
|
-
const listMasterItemsRepo =
|
|
416
|
+
const listMasterItemsRepo =
|
|
417
|
+
this.reflectionHelper.getRepoService('ListMasterItems');
|
|
415
418
|
const unassignedListMasterItemData = await listMasterItemsRepo.find({
|
|
416
419
|
where: {
|
|
417
420
|
listtype: 'LEST',
|
|
418
421
|
enterprise_id: loggedInUser.enterprise_id,
|
|
419
|
-
value: In(['unassigned', 'active'])
|
|
420
|
-
}
|
|
422
|
+
value: In(['unassigned', 'active']),
|
|
423
|
+
},
|
|
421
424
|
});
|
|
422
425
|
|
|
423
426
|
// Find the IDs explicitly
|
|
@@ -447,21 +450,22 @@ export class WorkflowMetaService extends EntityServiceImpl {
|
|
|
447
450
|
.createQueryBuilder()
|
|
448
451
|
.update()
|
|
449
452
|
.set({ user_id: lead_owner })
|
|
450
|
-
.where(
|
|
451
|
-
.andWhere(
|
|
452
|
-
.andWhere(
|
|
453
|
+
.where('mapped_entity_id = :leadId', { leadId: lead_id })
|
|
454
|
+
.andWhere('mapped_entity_type = :entityType', { entityType: entity_type })
|
|
455
|
+
.andWhere('stage_id = :stageId', { stageId: stage_id })
|
|
453
456
|
.andWhere("(is_current = 'Y' OR is_current IS NULL)")
|
|
454
457
|
.execute();
|
|
455
458
|
|
|
456
|
-
const leadMeetingRepo =
|
|
459
|
+
const leadMeetingRepo =
|
|
460
|
+
this.reflectionHelper.getRepoService('LeadScheduleMeet');
|
|
457
461
|
|
|
458
462
|
await leadMeetingRepo
|
|
459
463
|
.createQueryBuilder()
|
|
460
464
|
.update()
|
|
461
465
|
.set({ user_id: lead_owner })
|
|
462
|
-
.where(
|
|
463
|
-
.andWhere(
|
|
464
|
-
.andWhere(
|
|
466
|
+
.where('stage_id = :stageId', { stageId: stage_id })
|
|
467
|
+
.andWhere('mapped_entity_id = :leadId', { leadId: lead_id })
|
|
468
|
+
.andWhere('mapped_entity_type = :entityType', { entityType: 'LEAD' })
|
|
465
469
|
.andWhere("(status = 'scheduled' OR status = 'rescheduled')")
|
|
466
470
|
.execute();
|
|
467
471
|
|
|
@@ -469,15 +473,15 @@ export class WorkflowMetaService extends EntityServiceImpl {
|
|
|
469
473
|
where: {
|
|
470
474
|
mapped_entity_id: lead_id,
|
|
471
475
|
mapped_entity_type: entity_type,
|
|
472
|
-
stage_id
|
|
473
|
-
}
|
|
476
|
+
stage_id,
|
|
477
|
+
},
|
|
474
478
|
});
|
|
475
479
|
|
|
476
480
|
for (const task of taskRows) {
|
|
477
481
|
const statusRows = await listMasterItemsRepo.findOne({
|
|
478
482
|
where: {
|
|
479
|
-
id: task.status
|
|
480
|
-
}
|
|
483
|
+
id: task.status,
|
|
484
|
+
},
|
|
481
485
|
});
|
|
482
486
|
|
|
483
487
|
const statusName = statusRows?.value?.toLowerCase() || '';
|
|
@@ -485,10 +489,9 @@ export class WorkflowMetaService extends EntityServiceImpl {
|
|
|
485
489
|
['todo', 'in_progress'].includes(statusName) ||
|
|
486
490
|
statusName === 'todo'
|
|
487
491
|
) {
|
|
488
|
-
|
|
489
|
-
await this.taskDataEntityRepository.update(task.id,{
|
|
492
|
+
await this.taskDataEntityRepository.update(task.id, {
|
|
490
493
|
user_id: lead_owner,
|
|
491
|
-
task_owner: lead_owner
|
|
494
|
+
task_owner: lead_owner,
|
|
492
495
|
});
|
|
493
496
|
}
|
|
494
497
|
}
|
|
@@ -577,12 +580,12 @@ export class WorkflowMetaService extends EntityServiceImpl {
|
|
|
577
580
|
|
|
578
581
|
const leadRepo = this.reflectionHelper.getRepoService('CRMLead');
|
|
579
582
|
const lastRow = await leadRepo
|
|
580
|
-
.createQueryBuilder(
|
|
581
|
-
.select(
|
|
582
|
-
.where(
|
|
583
|
-
.andWhere(
|
|
584
|
-
.andWhere(
|
|
585
|
-
.orderBy(
|
|
583
|
+
.createQueryBuilder('cl')
|
|
584
|
+
.select('cl.lead_owner', 'lead_owner')
|
|
585
|
+
.where('cl.level_id = :levelId', { levelId: Number(level_id) })
|
|
586
|
+
.andWhere('cl.level_type = :levelType', { levelType: level_type })
|
|
587
|
+
.andWhere('cl.lead_owner IN (:...owners)', { owners: userIds })
|
|
588
|
+
.orderBy('cl.created_date', 'DESC')
|
|
586
589
|
.limit(1)
|
|
587
590
|
.getRawOne();
|
|
588
591
|
|
|
@@ -4,8 +4,8 @@ DB_HOST: '43.205.35.45'
|
|
|
4
4
|
DB_PORT: '5432'
|
|
5
5
|
DB_USER: 'root'
|
|
6
6
|
DB_PASS: 'Rezolut123'
|
|
7
|
-
DB_NAME: '
|
|
8
|
-
DB_SCHEMA: '
|
|
7
|
+
DB_NAME: 'dev_d'
|
|
8
|
+
DB_SCHEMA: 'ether_adm'
|
|
9
9
|
MASTER_KEY: '0QZ2eRJv5oVILYnyBlC+FbSGVQiWKReh'
|
|
10
10
|
MASTER_IV: 'heuUQf5uPVtkotrFAOKUVw=='
|
|
11
11
|
SECRET_KEY: '1hard_to_guess_secret7890a'
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"Bash(npm run build:*)",
|
|
5
|
-
"Bash(npm install)",
|
|
6
|
-
"Bash(npm run lint)",
|
|
7
|
-
"Bash(npm install:*)",
|
|
8
|
-
"Bash(curl:*)",
|
|
9
|
-
"Bash(npm run start:dev:*)",
|
|
10
|
-
"Bash(mkdir:*)",
|
|
11
|
-
"Bash(lsof:*)",
|
|
12
|
-
"Bash(kill:*)",
|
|
13
|
-
"Bash(npx eslint:*)",
|
|
14
|
-
"Read(/Users/admin/yash/**)",
|
|
15
|
-
"Bash(timeout 15 npm run start:dev)",
|
|
16
|
-
"Read(/Users/admin/yash/**)",
|
|
17
|
-
"Bash(find:*)",
|
|
18
|
-
"Bash(sed:*)",
|
|
19
|
-
"Bash(git checkout:*)",
|
|
20
|
-
"Read(//Users/admin/yash/**)",
|
|
21
|
-
"Bash(npx tsc:*)"
|
|
22
|
-
],
|
|
23
|
-
"deny": [],
|
|
24
|
-
"ask": []
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="JAVA_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
-
<exclude-output />
|
|
5
|
-
<content url="file://$MODULE_DIR$" />
|
|
6
|
-
<orderEntry type="inheritedJdk" />
|
|
7
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
8
|
-
</component>
|
|
9
|
-
</module>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<component name="ProjectCodeStyleConfiguration">
|
|
2
|
-
<code_scheme name="Project" version="173">
|
|
3
|
-
<HTMLCodeStyleSettings>
|
|
4
|
-
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
|
|
5
|
-
</HTMLCodeStyleSettings>
|
|
6
|
-
<JSCodeStyleSettings version="0">
|
|
7
|
-
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
8
|
-
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
9
|
-
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
10
|
-
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
11
|
-
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
12
|
-
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
13
|
-
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
14
|
-
</JSCodeStyleSettings>
|
|
15
|
-
<TypeScriptCodeStyleSettings version="0">
|
|
16
|
-
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
17
|
-
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
18
|
-
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
19
|
-
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
20
|
-
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
21
|
-
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
22
|
-
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
23
|
-
</TypeScriptCodeStyleSettings>
|
|
24
|
-
<VueCodeStyleSettings>
|
|
25
|
-
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
|
|
26
|
-
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
|
|
27
|
-
</VueCodeStyleSettings>
|
|
28
|
-
<codeStyleSettings language="HTML">
|
|
29
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
30
|
-
<indentOptions>
|
|
31
|
-
<option name="INDENT_SIZE" value="2" />
|
|
32
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
33
|
-
<option name="TAB_SIZE" value="2" />
|
|
34
|
-
</indentOptions>
|
|
35
|
-
</codeStyleSettings>
|
|
36
|
-
<codeStyleSettings language="JavaScript">
|
|
37
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
38
|
-
<indentOptions>
|
|
39
|
-
<option name="INDENT_SIZE" value="2" />
|
|
40
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
41
|
-
<option name="TAB_SIZE" value="2" />
|
|
42
|
-
</indentOptions>
|
|
43
|
-
</codeStyleSettings>
|
|
44
|
-
<codeStyleSettings language="TypeScript">
|
|
45
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
46
|
-
<indentOptions>
|
|
47
|
-
<option name="INDENT_SIZE" value="2" />
|
|
48
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
49
|
-
<option name="TAB_SIZE" value="2" />
|
|
50
|
-
</indentOptions>
|
|
51
|
-
</codeStyleSettings>
|
|
52
|
-
<codeStyleSettings language="Vue">
|
|
53
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
54
|
-
<indentOptions>
|
|
55
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
56
|
-
</indentOptions>
|
|
57
|
-
</codeStyleSettings>
|
|
58
|
-
</code_scheme>
|
|
59
|
-
</component>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<component name="InspectionProjectProfileManager">
|
|
2
|
-
<profile version="1.0">
|
|
3
|
-
<option name="myName" value="Project Default" />
|
|
4
|
-
<inspection_tool class="SqlNoDataSourceInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
5
|
-
</profile>
|
|
6
|
-
</component>
|
package/.idea/misc.xml
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
|
|
4
|
-
<output url="file://$PROJECT_DIR$/out" />
|
|
5
|
-
</component>
|
|
6
|
-
</project>
|
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/250218_nodejs_core.iml" filepath="$PROJECT_DIR$/.idea/250218_nodejs_core.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
package/.idea/prettier.xml
DELETED