rez_core 2.2.25 → 2.2.27
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/workflow/repository/action.repository.js +1 -17
- package/dist/module/workflow/repository/action.repository.js.map +1 -1
- package/dist/module/workflow/service/action.service.js +9 -0
- package/dist/module/workflow/service/action.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/workflow/repository/action.repository.ts +1 -22
- package/src/module/workflow/service/action.service.ts +13 -0
package/package.json
CHANGED
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
import { InjectRepository } from '@nestjs/typeorm';
|
|
8
8
|
import { DataSource, Repository } from 'typeorm';
|
|
9
9
|
import { ActionEntity } from '../entity/action.entity';
|
|
10
|
-
import { UserData } from 'src/module/user/entity/user.entity';
|
|
11
10
|
|
|
12
11
|
@Injectable()
|
|
13
12
|
export class ActionRepository {
|
|
@@ -88,26 +87,6 @@ export class ActionRepository {
|
|
|
88
87
|
return acc;
|
|
89
88
|
}, {});
|
|
90
89
|
|
|
91
|
-
// Step 4: Resolve all default_reason_code values (regardless of default_value)
|
|
92
|
-
const allDefaultReasonIds = actions
|
|
93
|
-
.filter((row) => row.default_reason_code)
|
|
94
|
-
.map((row) => row.default_reason_code);
|
|
95
|
-
|
|
96
|
-
let defaultReasonMap = {};
|
|
97
|
-
if (allDefaultReasonIds.length > 0) {
|
|
98
|
-
const listItems = await this.dataSource
|
|
99
|
-
.createQueryBuilder()
|
|
100
|
-
.select(['id', 'name'])
|
|
101
|
-
.from('cr_list_master_items', 'li')
|
|
102
|
-
.where('li.id IN (:...ids)', { ids: allDefaultReasonIds })
|
|
103
|
-
.getRawMany();
|
|
104
|
-
|
|
105
|
-
defaultReasonMap = listItems.reduce((acc, item) => {
|
|
106
|
-
acc[item.id] = item.name;
|
|
107
|
-
return acc;
|
|
108
|
-
}, {});
|
|
109
|
-
}
|
|
110
|
-
|
|
111
90
|
// Step 5: Enrich actions
|
|
112
91
|
const enrichedResult = actions.map((row) => {
|
|
113
92
|
const data = actionIdToData[row.action_id];
|
|
@@ -124,7 +103,7 @@ export class ActionRepository {
|
|
|
124
103
|
logo: row.logo,
|
|
125
104
|
name: row.action_category_name,
|
|
126
105
|
reason_code,
|
|
127
|
-
default_reason_code:
|
|
106
|
+
default_reason_code: row.default_reason_code,
|
|
128
107
|
is_default: row.default_value === 1,
|
|
129
108
|
is_current: data?.is_current ?? false,
|
|
130
109
|
is_done: data?.is_done ?? false,
|
|
@@ -60,9 +60,14 @@ export class ActionService extends EntityServiceImpl {
|
|
|
60
60
|
const stageActionMapping = {
|
|
61
61
|
action_id: action.id,
|
|
62
62
|
stage_id: actionData.stage_id,
|
|
63
|
+
|
|
63
64
|
entity_type: 'STGM',
|
|
64
65
|
} as any;
|
|
65
66
|
|
|
67
|
+
if (entityData?.organization_id) {
|
|
68
|
+
stageActionMapping.organization_id = entityData.organization_id;
|
|
69
|
+
}
|
|
70
|
+
|
|
66
71
|
const stageActionMappingData = await super.createEntity(
|
|
67
72
|
stageActionMapping,
|
|
68
73
|
loggedInUser,
|
|
@@ -79,6 +84,10 @@ export class ActionService extends EntityServiceImpl {
|
|
|
79
84
|
entity_type: 'ARMS',
|
|
80
85
|
} as any;
|
|
81
86
|
|
|
87
|
+
if (entityData?.organization_id) {
|
|
88
|
+
resourceMapping.organization_id = entityData.organization_id;
|
|
89
|
+
}
|
|
90
|
+
|
|
82
91
|
await super.createEntity(resourceMapping, loggedInUser);
|
|
83
92
|
}
|
|
84
93
|
}
|
|
@@ -93,6 +102,10 @@ export class ActionService extends EntityServiceImpl {
|
|
|
93
102
|
entity_type: 'ARMS',
|
|
94
103
|
} as any;
|
|
95
104
|
|
|
105
|
+
if (entityData?.organization_id) {
|
|
106
|
+
resourceMapping.organization_id = entityData.organization_id;
|
|
107
|
+
}
|
|
108
|
+
|
|
96
109
|
await super.createEntity(resourceMapping, loggedInUser);
|
|
97
110
|
}
|
|
98
111
|
}
|