rez_core 2.2.21 → 2.2.23
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/module/notification/notification.module.js +6 -3
- package/dist/module/notification/notification.module.js.map +1 -1
- package/dist/module/workflow/controller/action.controller.d.ts +3 -0
- package/dist/module/workflow/repository/action-data.repository.js +2 -0
- package/dist/module/workflow/repository/action-data.repository.js.map +1 -1
- package/dist/module/workflow/repository/action.repository.d.ts +3 -0
- package/dist/module/workflow/repository/action.repository.js +8 -2
- package/dist/module/workflow/repository/action.repository.js.map +1 -1
- package/dist/module/workflow/repository/task.repository.js +2 -0
- package/dist/module/workflow/repository/task.repository.js.map +1 -1
- package/dist/module/workflow/service/action.service.d.ts +3 -0
- package/dist/module/workflow/service/workflow-meta.service.js +4 -4
- 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/module/notification/notification.module.ts +6 -3
- package/src/module/workflow/repository/action-data.repository.ts +5 -0
- package/src/module/workflow/repository/action.repository.ts +8 -1
- package/src/module/workflow/repository/task.repository.ts +9 -0
- package/src/module/workflow/service/workflow-meta.service.ts +4 -6
package/package.json
CHANGED
|
@@ -8,19 +8,22 @@ import { MailerModule } from '@nestjs-modules/mailer';
|
|
|
8
8
|
import { HandlebarsAdapter } from '@nestjs-modules/mailer/dist/adapters/handlebars.adapter';
|
|
9
9
|
import { EmailService } from './service/email.service';
|
|
10
10
|
import { join } from 'path';
|
|
11
|
+
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
11
12
|
|
|
12
13
|
@Module({
|
|
13
14
|
imports: [
|
|
14
15
|
TypeOrmModule.forFeature([Otp]),
|
|
15
16
|
MailerModule.forRootAsync({
|
|
16
|
-
|
|
17
|
+
imports: [ConfigModule],
|
|
18
|
+
inject: [ConfigService],
|
|
19
|
+
useFactory: (configService: ConfigService) => ({
|
|
17
20
|
transport: {
|
|
18
21
|
host: 'smtp.gmail.com',
|
|
19
22
|
port: 465,
|
|
20
23
|
secure: true,
|
|
21
24
|
auth: {
|
|
22
|
-
user:
|
|
23
|
-
pass:
|
|
25
|
+
user: configService.get('EMAIL_USER'),
|
|
26
|
+
pass: configService.get('EMAIL_PASSWORD'),
|
|
24
27
|
},
|
|
25
28
|
},
|
|
26
29
|
defaults: {
|
|
@@ -25,6 +25,10 @@ export class ActionDataRepository {
|
|
|
25
25
|
|
|
26
26
|
if (action.length > 0) {
|
|
27
27
|
for (const act of action) {
|
|
28
|
+
const is_mandatory = await this.dataSource.query(
|
|
29
|
+
`SELECT code FROM cr_list_master_items WHERE id = ? and organization_id = ? LIMIT 1;`,
|
|
30
|
+
[act.action_requirement, loggedInUser.organization_id],
|
|
31
|
+
);
|
|
28
32
|
const isFirst = act.sequence == minSequence;
|
|
29
33
|
const actionData = this.actionDataRepo.create({
|
|
30
34
|
stage_id: act.stage_id,
|
|
@@ -35,6 +39,7 @@ export class ActionDataRepository {
|
|
|
35
39
|
mapped_entity_type,
|
|
36
40
|
is_current: isFirst ? 'Y' : null,
|
|
37
41
|
start_time: isFirst ? new Date() : null,
|
|
42
|
+
is_mandatory: is_mandatory[0]?.code === 'mandatory' ? true : false,
|
|
38
43
|
} as ActionDataEntity);
|
|
39
44
|
await this.actionDataRepo.save(actionData);
|
|
40
45
|
}
|
|
@@ -29,7 +29,14 @@ export class ActionRepository {
|
|
|
29
29
|
[stage_id],
|
|
30
30
|
);
|
|
31
31
|
|
|
32
|
-
if (!stageActions?.length)
|
|
32
|
+
if (!stageActions?.length) {
|
|
33
|
+
return [
|
|
34
|
+
{
|
|
35
|
+
value: 0,
|
|
36
|
+
label: 'Generic',
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
}
|
|
33
40
|
|
|
34
41
|
const actionIds = stageActions.map((sa) => sa.action_id);
|
|
35
42
|
|
|
@@ -38,14 +38,23 @@ export class TaskRepository {
|
|
|
38
38
|
|
|
39
39
|
if (action.length > 0) {
|
|
40
40
|
for (const act of action) {
|
|
41
|
+
// search that is_mandatory is true or not in list_master_items for the given organization
|
|
42
|
+
|
|
43
|
+
const is_mandatory = await this.dataSource.query(
|
|
44
|
+
`SELECT code FROM cr_list_master_items WHERE id = ? and organization_id = ? LIMIT 1;`,
|
|
45
|
+
[act.action_requirement, loggedInUser.organization_id],
|
|
46
|
+
);
|
|
47
|
+
|
|
41
48
|
const taskData = this.TaskRepository.create({
|
|
42
49
|
stage_id: act.stage_id,
|
|
43
50
|
user_id: loggedInUser.id,
|
|
44
51
|
action_id: act.id,
|
|
45
52
|
name: act.name,
|
|
46
53
|
sequence: act.sequence,
|
|
54
|
+
is_mandatory: is_mandatory[0]?.code === 'mandatory' ? true : false,
|
|
47
55
|
mapped_entity_id,
|
|
48
56
|
mapped_entity_type,
|
|
57
|
+
|
|
49
58
|
is_system: true,
|
|
50
59
|
status: todoListMasterItemId[0]?.id,
|
|
51
60
|
} as TaskDataEntity);
|
|
@@ -151,13 +151,11 @@ export class WorkflowMetaService extends EntityServiceImpl {
|
|
|
151
151
|
return `Initialized workflow with first stage (Stage ID: ${firstStage.id}).`;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
//idhr
|
|
155
|
-
|
|
156
154
|
// Case 2: Has next stage – move forward
|
|
157
|
-
const
|
|
155
|
+
const stageData = await this.getNextStage(currentStage);
|
|
158
156
|
|
|
159
|
-
if (
|
|
160
|
-
const { nextStage } =
|
|
157
|
+
if (stageData.hasNextStage) {
|
|
158
|
+
const { nextStage } = stageData;
|
|
161
159
|
// Close current stage
|
|
162
160
|
currentStage.end_date = now;
|
|
163
161
|
currentStage.is_current = 'N';
|
|
@@ -179,7 +177,7 @@ export class WorkflowMetaService extends EntityServiceImpl {
|
|
|
179
177
|
});
|
|
180
178
|
|
|
181
179
|
this.populateActionService(
|
|
182
|
-
|
|
180
|
+
stageData.nextStage.id,
|
|
183
181
|
loggedInUser,
|
|
184
182
|
mapped_entity_id,
|
|
185
183
|
mapped_entity_type,
|