rez_core 4.0.90 → 4.0.92

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": "4.0.90",
3
+ "version": "4.0.92",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -963,6 +963,8 @@ export class IntegrationService {
963
963
  let variables;
964
964
  let richText;
965
965
  let externalTemplateId: string | undefined = undefined;
966
+ const profile = this.configService.get('PROFILE');
967
+ const subjectPrefix = this.configService.get('SUBJECT_PREFIX');
966
968
  if (templateId) {
967
969
  const templateData = await this.processTemplate(
968
970
  parseInt(templateId, 10),
@@ -977,6 +979,16 @@ export class IntegrationService {
977
979
  subject = templateData.subject;
978
980
  }
979
981
 
982
+ if (subjectPrefix) {
983
+ const updatedSubject =
984
+ profile?.charAt(0).toUpperCase() +
985
+ profile?.slice(1) +
986
+ ' : ' +
987
+ subject; // << use current subject
988
+
989
+ subject = updatedSubject;
990
+ }
991
+
980
992
  // Merge config with enhanced parameters
981
993
  let finalConfig = {
982
994
  ...hub.config_json,
@@ -441,21 +441,6 @@ export class EntityDynamicService {
441
441
  entityData.enterprise_id = loggedInUser.enterprise_id;
442
442
  }
443
443
 
444
- if (!entityData.code && loggedInUser) {
445
- const result = await this.dataSource.query(
446
- `SELECT MAX(CAST(SUBSTRING(code, LENGTH(entity_type) + 1) AS UNSIGNED)) AS max_seq_no
447
- FROM ${tableName}
448
- WHERE entity_type = ?`,
449
- [entityData.entity_type],
450
- );
451
-
452
- // result will be like [ { max_seq_no: 12 } ]
453
- let maxSeqNo = result?.[0]?.max_seq_no ? Number(result[0].max_seq_no) : 0;
454
-
455
- maxSeqNo += 1;
456
- entityData.code = `${entityData.entity_type}${maxSeqNo}`;
457
- }
458
-
459
444
  // Set parent_id if mainID is provided
460
445
  if (mainID) {
461
446
  entityData.parent_id = mainID;
@@ -46,13 +46,14 @@ export class ActionTemplateMappingService extends EntityServiceImpl {
46
46
  `
47
47
  SELECT code as value, name as label , id
48
48
  FROM frm_wf_comm_template
49
- WHERE mode = ? AND organization_id = ? AND level_type = ? AND level_id = ?
49
+ WHERE mode = ? AND organization_id = ? AND level_type = ? AND level_id = ? AND status IN (SELECT id FROM frm_list_master_items WHERE code = "STATUS_ACTIVE" AND organization_id = ?)
50
50
  `,
51
51
  [
52
52
  modeId,
53
53
  loggedInUser.organization_id,
54
54
  loggedInUser.level_type,
55
55
  loggedInUser.level_id,
56
+ loggedInUser.organization_id,
56
57
  ],
57
58
  );
58
59
 
@@ -88,7 +89,7 @@ export class ActionTemplateMappingService extends EntityServiceImpl {
88
89
  `
89
90
  SELECT code as value, name as label , id
90
91
  FROM frm_wf_comm_template
91
- WHERE code IN (?) AND mode = ? AND organization_id = ? AND level_type = ? AND level_id = ?
92
+ WHERE code IN (?) AND mode = ? AND organization_id = ? AND level_type = ? AND level_id = ? AND status IN (SELECT id FROM frm_list_master_items WHERE code = "STATUS_ACTIVE" AND organization_id = ?)
92
93
  `,
93
94
  [
94
95
  templateCodes,
@@ -96,6 +97,7 @@ export class ActionTemplateMappingService extends EntityServiceImpl {
96
97
  loggedInUser.organization_id,
97
98
  loggedInUser.level_type,
98
99
  loggedInUser.level_id,
100
+ loggedInUser.organization_id,
99
101
  ],
100
102
  );
101
103