rez_core 4.0.161 → 4.0.163

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.161",
3
+ "version": "4.0.163",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -205,9 +205,9 @@ export class WrapperService {
205
205
  // Try to find template at user's level first
206
206
  let templates = await this.datasource.query(
207
207
  `SELECT id FROM frm_wf_comm_template
208
- WHERE code = ?
209
- AND level_id = ?
210
- AND level_type = ?
208
+ WHERE code = $1
209
+ AND level_id = $2
210
+ AND level_type = $3
211
211
  LIMIT 1`,
212
212
  [entity.template_code, level_id, level_type],
213
213
  );
@@ -18,7 +18,7 @@ export class EntityMasterRepository {
18
18
  let data = await this.entityMasterRepository.findOne({ where: { id } });
19
19
  if (data) {
20
20
  let listMasterData = await this.entityMasterRepository.query(
21
- `SELECT * FROM frm_list_master_items where id = ?`,
21
+ `SELECT * FROM frm_list_master_items where id = $1`,
22
22
  [data?.status],
23
23
  );
24
24
  data.status = listMasterData?.[0].name;
@@ -23,7 +23,7 @@ export class ActionRepository {
23
23
  `
24
24
  SELECT name, type
25
25
  FROM frm_list_master
26
- WHERE organization_id = ? AND source = 'master'
26
+ WHERE organization_id = $1 AND source = 'master'
27
27
  `,
28
28
  [organization_id],
29
29
  );
@@ -45,7 +45,7 @@ export class ActionRepository {
45
45
  `
46
46
  SELECT name, id
47
47
  FROM frm_list_master_items
48
- WHERE listtype = ? AND organization_id = ?
48
+ WHERE listtype = $1 AND organization_id = $2
49
49
  `,
50
50
  [list_type, organization_id],
51
51
  );
@@ -177,7 +177,7 @@ export class ActionRepository {
177
177
  `
178
178
  SELECT action_id
179
179
  FROM frm_wf_stage_action_mapping
180
- WHERE stage_id = ?
180
+ WHERE stage_id = $1
181
181
  `,
182
182
  [stage_id],
183
183
  );
@@ -89,7 +89,7 @@ export class StageRepository {
89
89
  s.*
90
90
  FROM frm_wf_stage_group g
91
91
  INNER JOIN frm_wf_stage s ON s.stage_group_id = g.id
92
- WHERE g.workflow_id = ? AND g.organization_id = ? AND g.id = ?
92
+ WHERE g.workflow_id = $1 AND g.organization_id = $2 AND g.id = $3
93
93
  ORDER BY g.id, s.id
94
94
  `,
95
95
  [stageGroup.workflow_id, organization_id, stage_group_id],
@@ -30,12 +30,12 @@ export class TaskRepository {
30
30
  if (!action?.length) return;
31
31
 
32
32
  const todoListMasterItemId = await this.dataSource.query(
33
- `SELECT id FROM frm_list_master_items WHERE code = 'in_progress' and organization_id = ? and listtype = 'TKST' LIMIT 1;`,
33
+ `SELECT id FROM frm_list_master_items WHERE code = 'in_progress' and organization_id = $1 and listtype = 'TKST' LIMIT 1;`,
34
34
  [loggedInUser.organization_id],
35
35
  );
36
36
 
37
37
  const leadData = await this.dataSource.query(
38
- `SELECT * FROM crm_lead WHERE id = ?`,
38
+ `SELECT * FROM crm_lead WHERE id = $1`,
39
39
  [mapped_entity_id],
40
40
  );
41
41
 
@@ -46,30 +46,29 @@ export class TaskRepository {
46
46
  // search that is_mandatory is true or not in list_master_items for the given organization
47
47
 
48
48
  const is_mandatory = await this.dataSource.query(
49
- `SELECT code FROM frm_list_master_items WHERE id = ? and organization_id = ? LIMIT 1;`,
49
+ `SELECT code FROM frm_list_master_items WHERE id = $1 and organization_id = $2 LIMIT 1;`,
50
50
  [act.action_requirement, loggedInUser.organization_id],
51
51
  );
52
52
 
53
53
  const now = new Date();
54
54
  const dueDateTime = new Date(now);
55
55
  dueDateTime.setDate(dueDateTime.getDate() + 2);
56
-
56
+
57
57
  // Force conversion to IST
58
- const istFormatterDate = new Intl.DateTimeFormat('en-CA', {
59
- timeZone: 'Asia/Kolkata'
58
+ const istFormatterDate = new Intl.DateTimeFormat('en-CA', {
59
+ timeZone: 'Asia/Kolkata',
60
60
  });
61
- const istFormatterTime = new Intl.DateTimeFormat('en-US', {
62
- timeZone: 'Asia/Kolkata',
63
- hour: '2-digit',
64
- minute: '2-digit',
65
- hour12: true
61
+ const istFormatterTime = new Intl.DateTimeFormat('en-US', {
62
+ timeZone: 'Asia/Kolkata',
63
+ hour: '2-digit',
64
+ minute: '2-digit',
65
+ hour12: true,
66
66
  });
67
-
67
+
68
68
  const due_date = istFormatterDate.format(dueDateTime); // YYYY-MM-DD in IST
69
69
  const due_time = istFormatterTime.format(dueDateTime); // e.g. "03:14 AM"
70
-
70
+
71
71
  console.log({ due_date, due_time });
72
-
73
72
 
74
73
  const taskData = this.TaskRepository.create({
75
74
  stage_id: act.stage_id,
@@ -113,7 +112,7 @@ export class TaskRepository {
113
112
  if (!task) return;
114
113
 
115
114
  const completedListMasterItemId = await this.dataSource.query(
116
- `SELECT id FROM frm_list_master_items WHERE code = 'completed' and organization_id = ? and listtype = 'TKST' LIMIT 1;`,
115
+ `SELECT id FROM frm_list_master_items WHERE code = 'completed' and organization_id = $1 and listtype = 'TKST' LIMIT 1;`,
117
116
  [loggedInUser.organization_id],
118
117
  );
119
118
 
@@ -346,7 +346,7 @@ export class TaskService extends EntityServiceImpl {
346
346
  const taskStatusQuery = `
347
347
  SELECT id, name
348
348
  FROM frm_list_master_items
349
- WHERE organization_id = ?
349
+ WHERE organization_id = $1
350
350
  AND listtype = 'TKST'
351
351
  `;
352
352
  const taskAllStatus = await this.dataSource.query(taskStatusQuery, [