rez_core 5.0.263 → 5.0.265

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.263",
3
+ "version": "5.0.265",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -10,6 +10,7 @@ import { ActionHandler } from 'src/module/workflow-automation/interface/action.d
10
10
  import * as moment from 'moment';
11
11
  import { ConfigService } from '@nestjs/config';
12
12
  import axios from 'axios';
13
+ import { WorkflowMetaService } from './workflow-meta.service';
13
14
 
14
15
  @Injectable()
15
16
  @ActionHandler('add_task')
@@ -20,6 +21,8 @@ export class TaskService extends EntityServiceImpl {
20
21
  @Inject('ActivityLogService')
21
22
  private readonly activityLogService: ActivityLogService,
22
23
  private readonly configService: ConfigService,
24
+ @Inject('WorkflowMetaService')
25
+ private readonly workflowService: WorkflowMetaService,
23
26
  ) {
24
27
  super();
25
28
  }
@@ -35,6 +38,22 @@ export class TaskService extends EntityServiceImpl {
35
38
  dueDate.setDate(dueDate.getDate() + 2);
36
39
  dueDate.setHours(0, 0, 0, 0);
37
40
 
41
+ const dueTime = new Date().toLocaleTimeString('en-US', {
42
+ timeZone: 'Asia/Kolkata',
43
+ hour: '2-digit',
44
+ minute: '2-digit',
45
+ hour12: true,
46
+ });
47
+
48
+ const getStage = await this.workflowService.getCurrentStage(
49
+ entity.entity_type,
50
+ entity.id,
51
+ user,
52
+ );
53
+
54
+ const stageName = getStage.name;
55
+ const stageGroupName=getStage.stage_group_name;
56
+
38
57
  if (entity.entity_type !== 'LEAD') {
39
58
  entity = await this.getEntityData('LEAD', entity.parent_id, user);
40
59
  }
@@ -48,10 +67,10 @@ export class TaskService extends EntityServiceImpl {
48
67
  parent_type: entity.entity_type,
49
68
  task_owner: entity.created_by,
50
69
  user_id: entity.lead_owner,
51
- stage_id: entity.stageId,
70
+ stage_id: getStage.stage_id,
52
71
  status: config.status,
53
72
  due_date: dueDate,
54
- due_time: Date.now(),
73
+ due_time: dueTime,
55
74
  description: config.description,
56
75
  is_mandatory: config.is_mandatory,
57
76
  name: config.name,