rez_core 2.2.75 → 2.2.77

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": "2.2.75",
3
+ "version": "2.2.77",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -53,3 +53,11 @@ export const STAGE_MOVEMENT_DATA = 'STMV';
53
53
 
54
54
  export const ENTITY_MODIFICATION = 'ENMD';
55
55
  export const ACTION_RESOURCES_MAPPING = 'ARMS';
56
+
57
+ // Form Status
58
+ export const FORM_STATUS_TO_BE_SENT = 'TO_BE_SENT';
59
+ export const FORM_STATUS_SENT = 'SENT';
60
+ export const FORM_STATUS_SAVED = 'SAVED';
61
+ export const FORM_STATUS_SUBMITTED = 'SUBMITTED';
62
+ export const FORM_STATUS_RESUBMIT_REQUESTED = 'RESUBMIT_REQUESTED';
63
+ export const FORM_STATUS_ACCEPTED = 'ACCEPTED';
@@ -5,9 +5,11 @@ import { DataSource, LessThan, Repository } from 'typeorm';
5
5
  import { UserData } from 'src/module/user/entity/user.entity';
6
6
  import { FormDataEntity } from '../entity/form.entity';
7
7
  import { TaskDataEntity } from '../entity/task-data.entity';
8
+ import { EntityServiceImpl } from 'src/module/meta/service/entity-service-impl.service';
9
+ import { FORM_STATUS_TO_BE_SENT } from 'src/constant/global.constant';
8
10
 
9
11
  @Injectable()
10
- export class ActionDataRepository {
12
+ export class ActionDataRepository extends EntityServiceImpl {
11
13
  constructor(
12
14
  @InjectRepository(ActionDataEntity)
13
15
  private readonly actionDataRepo: Repository<ActionDataEntity>,
@@ -16,7 +18,9 @@ export class ActionDataRepository {
16
18
  private readonly formRepo: Repository<FormDataEntity>,
17
19
  @InjectRepository(TaskDataEntity)
18
20
  private readonly TaskRepository: Repository<TaskDataEntity>,
19
- ) {}
21
+ ) {
22
+ super();
23
+ }
20
24
 
21
25
  async saveActionData(
22
26
  action: any,
@@ -50,18 +54,19 @@ export class ActionDataRepository {
50
54
  } as ActionDataEntity);
51
55
  await this.actionDataRepo.save(actionData);
52
56
 
53
- // SEND FORM related logic
57
+ // SEND LEAD FORM
54
58
  // if the action_category_code is 'SDFM', create a entry in cr_wf_form table
55
59
  if (act?.action_category_code === 'SDFM') {
56
- this.formRepo.insert({
60
+ const data = {
61
+ entity_type: 'LFO',
57
62
  mapped_entity_type,
58
63
  mapped_entity_id,
59
- entity_type: mapped_entity_type,
60
- entity_id: mapped_entity_id,
61
64
  view_id: act.form_id,
62
- status: 'N',
65
+ status: FORM_STATUS_TO_BE_SENT,
63
66
  action_id: act.id,
64
- });
67
+ };
68
+
69
+ super.createEntity(data as any, loggedInUser);
65
70
  }
66
71
  }
67
72
  }
@@ -135,7 +140,8 @@ export class ActionDataRepository {
135
140
  });
136
141
 
137
142
  if (!currentAction) {
138
- throw new Error('No active action found for resubmit.');
143
+ // skip
144
+ return;
139
145
  }
140
146
 
141
147
  // Find the immediate previous action in the sequence
@@ -152,7 +158,7 @@ export class ActionDataRepository {
152
158
 
153
159
  if (!previousAction) {
154
160
  // no previous action means we cannot resubmit
155
- throw new Error('No previous action available for resubmit.');
161
+ return;
156
162
  }
157
163
 
158
164
  // Unset current action