rez_core 4.0.199 → 4.0.202
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/core.module.js +3 -0
- package/dist/core.module.js.map +1 -1
- package/dist/module/entity_json/controller/entity_json.controller.d.ts +11 -1
- package/dist/module/entity_json/controller/entity_json.controller.js +14 -0
- package/dist/module/entity_json/controller/entity_json.controller.js.map +1 -1
- package/dist/module/entity_json/entity/entityJson.entity.d.ts +10 -0
- package/dist/module/entity_json/entity/entityJson.entity.js +55 -0
- package/dist/module/entity_json/entity/entityJson.entity.js.map +1 -0
- package/dist/module/entity_json/entity_json.module.js +2 -1
- package/dist/module/entity_json/entity_json.module.js.map +1 -1
- package/dist/module/entity_json/service/entity_json.service.d.ts +11 -3
- package/dist/module/entity_json/service/entity_json.service.js +92 -49
- package/dist/module/entity_json/service/entity_json.service.js.map +1 -1
- package/dist/module/meta/controller/attribute-master.controller.d.ts +2 -3
- package/dist/module/meta/controller/attribute-master.controller.js +2 -12
- package/dist/module/meta/controller/attribute-master.controller.js.map +1 -1
- package/dist/module/meta/entity/attribute-master.entity.d.ts +1 -0
- package/dist/module/meta/entity/attribute-master.entity.js +4 -0
- package/dist/module/meta/entity/attribute-master.entity.js.map +1 -1
- package/dist/table.config.d.ts +2 -1
- package/dist/table.config.js +4 -6
- package/dist/table.config.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/core.module.ts +3 -0
- package/src/module/entity_json/controller/entity_json.controller.ts +14 -14
- package/src/module/entity_json/entity/entityJson.entity.ts +39 -0
- package/src/module/entity_json/entity_json.module.ts +2 -1
- package/src/module/entity_json/service/entity_json.service.ts +151 -99
- package/src/module/meta/controller/attribute-master.controller.ts +11 -13
- package/src/module/meta/entity/attribute-master.entity.ts +3 -0
- package/src/resources/dev.properties.yaml +1 -1
- package/src/table.config.ts +4 -6
- package/.vscode/extensions.json +0 -5
package/package.json
CHANGED
package/src/core.module.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { WorkflowModule } from './module/workflow/workflow.module';
|
|
|
17
17
|
import { WorkflowAutomationModule } from './module/workflow-automation/workflow-automation.module';
|
|
18
18
|
import { MapperModule } from './module/mapper/mapper.module';
|
|
19
19
|
import { WorkflowScheduleModule } from './module/workflow-schedule/workflow-schedule.module';
|
|
20
|
+
import { EntityJSONModule } from './module/entity_json/entity_json.module';
|
|
20
21
|
|
|
21
22
|
@Global()
|
|
22
23
|
@Module({})
|
|
@@ -45,6 +46,7 @@ export class CoreModule {
|
|
|
45
46
|
WorkflowAutomationModule,
|
|
46
47
|
WorkflowScheduleModule.forRoot({ is_workflow: isWorkflow }),
|
|
47
48
|
MapperModule,
|
|
49
|
+
EntityJSONModule
|
|
48
50
|
];
|
|
49
51
|
|
|
50
52
|
const exportsArray = [
|
|
@@ -62,6 +64,7 @@ export class CoreModule {
|
|
|
62
64
|
WorkflowModule,
|
|
63
65
|
WorkflowAutomationModule,
|
|
64
66
|
WorkflowScheduleModule.forRoot({ is_workflow: isWorkflow }),
|
|
67
|
+
EntityJSONModule
|
|
65
68
|
];
|
|
66
69
|
|
|
67
70
|
if (isSso) {
|
|
@@ -29,19 +29,19 @@ export class EntityJSONController {
|
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
@Post('/update-json/:entityId')
|
|
33
|
+
@UseGuards(JwtAuthGuard)
|
|
34
|
+
async updateEntityJson(
|
|
35
|
+
@Param('entityId') entityId: string,
|
|
36
|
+
@Query('entityType') entityType: string,
|
|
37
|
+
@Req() req: Request & { user: any },
|
|
38
|
+
) {
|
|
39
|
+
const loggedInUser = req.user?.userData;
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
return this.entityJSONService.updateEntityJSON(
|
|
42
|
+
entityType,
|
|
43
|
+
Number(entityId),
|
|
44
|
+
loggedInUser,
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
47
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
PrimaryGeneratedColumn,
|
|
4
|
+
Column,
|
|
5
|
+
CreateDateColumn,
|
|
6
|
+
UpdateDateColumn,
|
|
7
|
+
Unique,
|
|
8
|
+
Index,
|
|
9
|
+
} from 'typeorm';
|
|
10
|
+
|
|
11
|
+
@Entity('frm_entity_json')
|
|
12
|
+
@Unique(['entity_type', 'entity_id'])
|
|
13
|
+
export class EntityJson {
|
|
14
|
+
@PrimaryGeneratedColumn()
|
|
15
|
+
id: number;
|
|
16
|
+
|
|
17
|
+
@Index()
|
|
18
|
+
@Column({ type: 'varchar', length: 100 })
|
|
19
|
+
entity_type: string;
|
|
20
|
+
|
|
21
|
+
@Index()
|
|
22
|
+
@Column({ type: 'int' })
|
|
23
|
+
entity_id: number;
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'json', nullable: false })
|
|
26
|
+
json_data: Record<string, any>;
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'int', nullable: true })
|
|
29
|
+
created_by: number;
|
|
30
|
+
|
|
31
|
+
@Column({ type: 'int', nullable: true })
|
|
32
|
+
updated_by: number;
|
|
33
|
+
|
|
34
|
+
@CreateDateColumn({ type: 'timestamp', nullable: true })
|
|
35
|
+
created_at: Date;
|
|
36
|
+
|
|
37
|
+
@UpdateDateColumn({ type: 'timestamp', nullable: true })
|
|
38
|
+
updated_at: Date;
|
|
39
|
+
}
|
|
@@ -5,9 +5,10 @@ import { EntityJSONService } from './service/entity_json.service';
|
|
|
5
5
|
import { EntityJSONController } from './controller/entity_json.controller';
|
|
6
6
|
import { FilterModule } from '../filter/filter.module';
|
|
7
7
|
import { UtilsModule } from 'src/utils/utils.module';
|
|
8
|
+
import { EntityJson } from './entity/entityJson.entity';
|
|
8
9
|
|
|
9
10
|
@Module({
|
|
10
|
-
imports: [EntityModule, TypeOrmModule.forFeature([]),FilterModule,UtilsModule],
|
|
11
|
+
imports: [EntityModule, TypeOrmModule.forFeature([EntityJson]),FilterModule,UtilsModule],
|
|
11
12
|
controllers: [EntityJSONController],
|
|
12
13
|
providers: [EntityJSONService],
|
|
13
14
|
exports: [],
|
|
@@ -19,7 +19,7 @@ export class EntityJSONService extends EntityServiceImpl {
|
|
|
19
19
|
async getAttributeForFlatJSON(
|
|
20
20
|
entityType: string,
|
|
21
21
|
loggedInUser: any,
|
|
22
|
-
flag?: 'flat_json' | 'dropdown',
|
|
22
|
+
flag?: 'flat_json' | 'dropdown' | 'all',
|
|
23
23
|
) {
|
|
24
24
|
const orgId = loggedInUser.organization_id;
|
|
25
25
|
await this.loggerService.log(
|
|
@@ -32,7 +32,7 @@ export class EntityJSONService extends EntityServiceImpl {
|
|
|
32
32
|
const mainAttributes = await this.dataSource
|
|
33
33
|
.getRepository(AttributeMaster)
|
|
34
34
|
.createQueryBuilder('attr')
|
|
35
|
-
.select(['attr.id', 'attr.name', 'attr.attribute_key'])
|
|
35
|
+
.select(['attr.id', 'attr.name', 'attr.flat_json_key','attr.attribute_key'])
|
|
36
36
|
.where('attr.mapped_entity_type = :entityType', { entityType })
|
|
37
37
|
.andWhere('attr.organization_id = :orgId', { orgId })
|
|
38
38
|
.getMany();
|
|
@@ -50,10 +50,14 @@ export class EntityJSONService extends EntityServiceImpl {
|
|
|
50
50
|
.select(['rel.target_entity_type'])
|
|
51
51
|
.where('rel.source_entity_type = :entityType', { entityType })
|
|
52
52
|
.andWhere('rel.organization_id = :orgId', { orgId })
|
|
53
|
-
.andWhere('rel.relation_type = :relationType', {
|
|
53
|
+
.andWhere('rel.relation_type = :relationType', {
|
|
54
|
+
relationType: 'ONE_TO_ONE',
|
|
55
|
+
})
|
|
54
56
|
.getRawMany();
|
|
55
57
|
|
|
56
|
-
const relatedTypesList = relatedEntityTypes.map(
|
|
58
|
+
const relatedTypesList = relatedEntityTypes.map(
|
|
59
|
+
(x) => x.rel_target_entity_type,
|
|
60
|
+
);
|
|
57
61
|
await this.loggerService.log(
|
|
58
62
|
'debug',
|
|
59
63
|
'EntityJSONService',
|
|
@@ -65,8 +69,16 @@ export class EntityJSONService extends EntityServiceImpl {
|
|
|
65
69
|
? await this.dataSource
|
|
66
70
|
.getRepository(AttributeMaster)
|
|
67
71
|
.createQueryBuilder('attr')
|
|
68
|
-
.select([
|
|
69
|
-
|
|
72
|
+
.select([
|
|
73
|
+
'attr.id',
|
|
74
|
+
'attr.name',
|
|
75
|
+
'attr.flat_json_key',
|
|
76
|
+
'attr.mapped_entity_type',
|
|
77
|
+
'attr.attribute_key',
|
|
78
|
+
])
|
|
79
|
+
.where('attr.mapped_entity_type IN (:...types)', {
|
|
80
|
+
types: relatedTypesList,
|
|
81
|
+
})
|
|
70
82
|
.andWhere('attr.organization_id = :orgId', { orgId })
|
|
71
83
|
.getMany()
|
|
72
84
|
: [];
|
|
@@ -100,36 +112,78 @@ export class EntityJSONService extends EntityServiceImpl {
|
|
|
100
112
|
`Loaded ${linkedAttributes.length} linked attributes`,
|
|
101
113
|
);
|
|
102
114
|
|
|
103
|
-
if (flag === 'flat_json') {
|
|
115
|
+
if (flag === 'flat_json' || flag === 'all') {
|
|
104
116
|
const result: Record<string, null> = {};
|
|
105
|
-
mainAttributes.forEach(attr => {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
117
|
+
mainAttributes.forEach((attr) => {
|
|
118
|
+
if (attr.flat_json_key) result[attr.flat_json_key] = null;
|
|
119
|
+
});
|
|
120
|
+
relatedAttributes.forEach((attr) => {
|
|
121
|
+
if (attr.flat_json_key) result[attr.flat_json_key] = null;
|
|
122
|
+
});
|
|
123
|
+
linkedAttributes.forEach((link) => {
|
|
124
|
+
if (link.applicable_attribute_key)
|
|
125
|
+
result[link.applicable_attribute_key] = null;
|
|
126
|
+
});
|
|
127
|
+
if(flag === 'all')
|
|
128
|
+
return {flat_json: result,attributes: {mainAttributes,relatedAttributes,linkedAttributes}};
|
|
129
|
+
|
|
130
|
+
return result;
|
|
109
131
|
}
|
|
110
132
|
|
|
111
133
|
const dropdown: any[] = [];
|
|
112
|
-
dropdown.push(
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
134
|
+
dropdown.push(
|
|
135
|
+
...mainAttributes.map((a) => ({ label: a.name, value: a.flat_json_key })),
|
|
136
|
+
);
|
|
137
|
+
dropdown.push(
|
|
138
|
+
...relatedAttributes.map((a) => ({
|
|
139
|
+
label: a.name,
|
|
140
|
+
value: a.flat_json_key,
|
|
141
|
+
})),
|
|
142
|
+
);
|
|
143
|
+
if (linkedAttributes.length > 0) {
|
|
144
|
+
dropdown.push({
|
|
145
|
+
...linkedAttributes.map((a) => ({
|
|
146
|
+
label: a.name,
|
|
147
|
+
value: a.attribute_key,
|
|
148
|
+
})),
|
|
149
|
+
});
|
|
150
|
+
}
|
|
117
151
|
return dropdown;
|
|
118
152
|
}
|
|
119
153
|
|
|
120
|
-
async updateEntityJSON(
|
|
121
|
-
entityType: string,
|
|
122
|
-
entityId: number,
|
|
123
|
-
loggedInUser,
|
|
124
|
-
) {
|
|
154
|
+
async updateEntityJSON(entityType: string, entityId: number, loggedInUser) {
|
|
125
155
|
await this.loggerService.log(
|
|
126
156
|
'info',
|
|
127
157
|
'EntityJSONService',
|
|
128
158
|
'updateEntityJSON',
|
|
129
159
|
`Building flat JSON for entity: ${entityType}#${entityId}`,
|
|
130
160
|
);
|
|
131
|
-
|
|
132
|
-
|
|
161
|
+
|
|
162
|
+
// 1. Load flat JSON template + attributes
|
|
163
|
+
const response = await this.getAttributeForFlatJSON(
|
|
164
|
+
entityType,
|
|
165
|
+
loggedInUser,
|
|
166
|
+
'all',
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
// ---- Structural validation ----
|
|
170
|
+
if (
|
|
171
|
+
!response ||
|
|
172
|
+
!('flat_json' in response) ||
|
|
173
|
+
!('attributes' in response) ||
|
|
174
|
+
!response.attributes
|
|
175
|
+
) {
|
|
176
|
+
await this.loggerService.log(
|
|
177
|
+
'error',
|
|
178
|
+
'EntityJSONService',
|
|
179
|
+
'updateEntityJSON',
|
|
180
|
+
`getAttributeForFlatJSON() did not return expected structure`,
|
|
181
|
+
);
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const { flat_json: flatJson, attributes } = response;
|
|
186
|
+
|
|
133
187
|
if (!flatJson) {
|
|
134
188
|
await this.loggerService.log(
|
|
135
189
|
'error',
|
|
@@ -137,98 +191,88 @@ export class EntityJSONService extends EntityServiceImpl {
|
|
|
137
191
|
'updateEntityJSON',
|
|
138
192
|
`Flat JSON template not found for entity: ${entityType}`,
|
|
139
193
|
);
|
|
140
|
-
|
|
194
|
+
return null;
|
|
141
195
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
196
|
+
|
|
197
|
+
// ---- Strong safety fix for TS ----
|
|
198
|
+
const safeAttributes = {
|
|
199
|
+
mainAttributes: attributes.mainAttributes || [],
|
|
200
|
+
relatedAttributes: attributes.relatedAttributes || [],
|
|
201
|
+
linkedAttributes: attributes.linkedAttributes || [],
|
|
202
|
+
};
|
|
203
|
+
// ----------------------------------
|
|
204
|
+
|
|
205
|
+
// 2. Build attribute_key → flat_json_key map
|
|
206
|
+
const attrMap: Record<string, string> = {};
|
|
207
|
+
const allAttrs = [
|
|
208
|
+
...safeAttributes.mainAttributes,
|
|
209
|
+
...safeAttributes.relatedAttributes,
|
|
210
|
+
...safeAttributes.linkedAttributes,
|
|
211
|
+
];
|
|
212
|
+
|
|
213
|
+
allAttrs.forEach(attr => {
|
|
214
|
+
if (attr.attribute_key) {
|
|
215
|
+
attrMap[attr.attribute_key] = attr.flat_json_key || attr.attribute_key;
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
// 3. Merge main entity data
|
|
220
|
+
const mainData = await this.getResolvedEntityData(
|
|
221
|
+
entityType,
|
|
222
|
+
entityId,
|
|
223
|
+
loggedInUser,
|
|
150
224
|
);
|
|
151
|
-
|
|
225
|
+
this.mergeEntityDataIntoFlatJson(flatJson, mainData, attrMap);
|
|
226
|
+
|
|
227
|
+
// 4. Merge ONE-TO-ONE related entities
|
|
152
228
|
const relations = await this.dataSource
|
|
153
229
|
.getRepository('frm_entity_relation_data')
|
|
154
230
|
.createQueryBuilder('erd')
|
|
155
|
-
.select([
|
|
231
|
+
.select([
|
|
232
|
+
'erd.target_entity_id AS target_entity_id',
|
|
233
|
+
'erd.target_entity_type AS target_entity_type',
|
|
234
|
+
])
|
|
156
235
|
.where('erd.source_entity_type = :entityType', { entityType })
|
|
157
236
|
.andWhere('erd.source_entity_id = :entityId', { entityId })
|
|
158
237
|
.andWhere('erd.relation_type = :rt', { rt: 'ONE_TO_ONE' })
|
|
159
238
|
.getRawMany();
|
|
160
|
-
|
|
161
|
-
'debug',
|
|
162
|
-
'EntityJSONService',
|
|
163
|
-
'updateEntityJSON',
|
|
164
|
-
`Found ${relations.length} ONE-TO-ONE relations`,
|
|
165
|
-
);
|
|
166
|
-
|
|
239
|
+
|
|
167
240
|
for (const rel of relations) {
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
'EntityJSONService',
|
|
173
|
-
'updateEntityJSON',
|
|
174
|
-
`Merged related entity ${rel.target_entity_type}#${rel.target_entity_id}`,
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
const linkedAttrs = await this.dataSource
|
|
179
|
-
.getRepository('frm_linked_attributes_table')
|
|
180
|
-
.createQueryBuilder('la')
|
|
181
|
-
.where('la.entity_type = :entityType', { entityType })
|
|
182
|
-
.getMany();
|
|
183
|
-
await this.loggerService.log(
|
|
184
|
-
'debug',
|
|
185
|
-
'EntityJSONService',
|
|
186
|
-
'updateEntityJSON',
|
|
187
|
-
`Found ${linkedAttrs.length} linked attributes`,
|
|
188
|
-
);
|
|
189
|
-
|
|
190
|
-
for (const la of linkedAttrs) {
|
|
191
|
-
const mappingValue = flatJson[la.mapping_attribute];
|
|
192
|
-
const result = await this.applyLinkedFilterUsingSavedFilter(
|
|
193
|
-
la.child_entity_type,
|
|
194
|
-
la.saved_filter_code,
|
|
195
|
-
la.filter_attribute,
|
|
196
|
-
mappingValue,
|
|
197
|
-
la.target_attribute,
|
|
198
|
-
loggedInUser
|
|
199
|
-
);
|
|
200
|
-
flatJson[la.target_attribute] = result;
|
|
201
|
-
await this.loggerService.log(
|
|
202
|
-
'debug',
|
|
203
|
-
'EntityJSONService',
|
|
204
|
-
'updateEntityJSON',
|
|
205
|
-
`Linked attribute ${la.target_attribute} set from child entity ${la.child_entity_type}`,
|
|
241
|
+
const relatedData = await this.getResolvedEntityData(
|
|
242
|
+
rel.target_entity_type,
|
|
243
|
+
rel.target_entity_id,
|
|
244
|
+
loggedInUser,
|
|
206
245
|
);
|
|
246
|
+
this.mergeEntityDataIntoFlatJson(flatJson, relatedData, attrMap);
|
|
207
247
|
}
|
|
208
|
-
|
|
248
|
+
|
|
249
|
+
// 5. Save JSON
|
|
209
250
|
await this.dataSource.query(
|
|
210
251
|
`INSERT INTO frm_entity_json (entity_type, entity_id, json_data, created_by)
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
[entityType, entityId, JSON.stringify(flatJson), loggedInUser.id]
|
|
214
|
-
);
|
|
215
|
-
await this.loggerService.log(
|
|
216
|
-
'info',
|
|
217
|
-
'EntityJSONService',
|
|
218
|
-
'updateEntityJSON',
|
|
219
|
-
`Flat JSON saved for entity: ${entityType}#${entityId}`,
|
|
252
|
+
VALUES (?, ?, ?, ?)
|
|
253
|
+
ON DUPLICATE KEY UPDATE json_data = VALUES(json_data), updated_by = VALUES(created_by)`,
|
|
254
|
+
[entityType, entityId, JSON.stringify(flatJson), loggedInUser.id],
|
|
220
255
|
);
|
|
221
|
-
|
|
256
|
+
|
|
222
257
|
return flatJson;
|
|
223
258
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
259
|
+
|
|
260
|
+
// Helper: Merge entity data using attribute_key → flat_json_key mapping
|
|
261
|
+
private mergeEntityDataIntoFlatJson(
|
|
262
|
+
flatJson: Record<string, any>,
|
|
263
|
+
entityData: any[],
|
|
264
|
+
attrMap: Record<string, string>,
|
|
265
|
+
) {
|
|
266
|
+
for (const record of entityData) {
|
|
267
|
+
for (const key of Object.keys(record)) {
|
|
268
|
+
const flatKey = attrMap[key] || key; // map to flat_json_key if exists
|
|
269
|
+
if (flatJson.hasOwnProperty(flatKey)) {
|
|
270
|
+
flatJson[flatKey] = record[key];
|
|
271
|
+
}
|
|
229
272
|
}
|
|
230
273
|
}
|
|
231
274
|
}
|
|
275
|
+
|
|
232
276
|
|
|
233
277
|
private async applyLinkedFilterUsingSavedFilter(
|
|
234
278
|
childEntityType: string,
|
|
@@ -238,7 +282,11 @@ export class EntityJSONService extends EntityServiceImpl {
|
|
|
238
282
|
targetAttribute: string,
|
|
239
283
|
loggedInUser,
|
|
240
284
|
) {
|
|
241
|
-
if (
|
|
285
|
+
if (
|
|
286
|
+
!savedFilterCode &&
|
|
287
|
+
(mappingValue === null || mappingValue === undefined)
|
|
288
|
+
)
|
|
289
|
+
return null;
|
|
242
290
|
|
|
243
291
|
const dto: any = {
|
|
244
292
|
entity_type: childEntityType,
|
|
@@ -248,18 +296,22 @@ export class EntityJSONService extends EntityServiceImpl {
|
|
|
248
296
|
size: 1,
|
|
249
297
|
};
|
|
250
298
|
|
|
251
|
-
if (
|
|
299
|
+
if (
|
|
300
|
+
mappingValue !== null &&
|
|
301
|
+
mappingValue !== undefined &&
|
|
302
|
+
mappingValue !== ''
|
|
303
|
+
) {
|
|
252
304
|
dto.quickFilter = [
|
|
253
305
|
{
|
|
254
306
|
filter_attribute: childFilterAttribute,
|
|
255
307
|
filter_operator: 'equal',
|
|
256
308
|
filter_value: mappingValue,
|
|
257
|
-
}
|
|
309
|
+
},
|
|
258
310
|
];
|
|
259
311
|
}
|
|
260
312
|
|
|
261
313
|
const result = await this.filterService.applyFilter(dto);
|
|
262
314
|
const rows = result?.data?.entity_list || [];
|
|
263
|
-
return rows.length ? rows[0][targetAttribute] ?? null : null;
|
|
315
|
+
return rows.length ? (rows[0][targetAttribute] ?? null) : null;
|
|
264
316
|
}
|
|
265
317
|
}
|
|
@@ -26,17 +26,14 @@ export class AttributeMasterController {
|
|
|
26
26
|
@Req() req: Request & { user: any },
|
|
27
27
|
) {
|
|
28
28
|
const loggedInUser = req.user.userData;
|
|
29
|
-
return await this.attributeMasterService.createAttribute(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
);
|
|
29
|
+
// return await this.attributeMasterService.createAttribute(
|
|
30
|
+
// attributeData,
|
|
31
|
+
// loggedInUser,
|
|
32
|
+
// );
|
|
33
|
+
return true
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
@Post('/updateAttributeValue')
|
|
36
|
-
async entityAttributeUpdate (@Body() payload:{}){
|
|
37
|
-
return this.entityUpdateService.execute(payload);
|
|
38
36
|
|
|
39
|
-
}
|
|
40
37
|
|
|
41
38
|
@Post('update/:id')
|
|
42
39
|
async updateAttribute(
|
|
@@ -45,11 +42,12 @@ export class AttributeMasterController {
|
|
|
45
42
|
@Req() req: Request & { user: any },
|
|
46
43
|
) {
|
|
47
44
|
const loggedInUser = req.user.userData;
|
|
48
|
-
return await this.attributeMasterService.updateAttribute(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
);
|
|
45
|
+
// return await this.attributeMasterService.updateAttribute(
|
|
46
|
+
// attributeData,
|
|
47
|
+
// id,
|
|
48
|
+
// loggedInUser,
|
|
49
|
+
// );
|
|
50
|
+
return true
|
|
53
51
|
}
|
|
54
52
|
|
|
55
53
|
@Get('getById/:id')
|
|
@@ -4,7 +4,7 @@ DB_HOST: '13.234.25.234'
|
|
|
4
4
|
DB_PORT: '3306'
|
|
5
5
|
DB_USER: 'root'
|
|
6
6
|
DB_PASS: 'Rezolut@123'
|
|
7
|
-
DB_NAME: '
|
|
7
|
+
DB_NAME: 'ether_package_db'
|
|
8
8
|
MASTER_KEY: '0QZ2eRJv5oVILYnyBlC+FbSGVQiWKReh'
|
|
9
9
|
MASTER_IV: 'heuUQf5uPVtkotrFAOKUVw=='
|
|
10
10
|
SECRET_KEY: '1hard_to_guess_secret7890a'
|
package/src/table.config.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { WidgetMaster } from "./module/dashboard/entity/widget_master.entity";
|
|
|
3
3
|
import { EnterpriseData } from "./module/enterprise/entity/enterprise.entity";
|
|
4
4
|
import { OrganizationAppMapping } from "./module/enterprise/entity/organization-app-mapping.entity";
|
|
5
5
|
import { OrganizationData } from "./module/enterprise/entity/organization.entity";
|
|
6
|
+
import { EntityJson } from "./module/entity_json/entity/entityJson.entity";
|
|
6
7
|
import { SavedFilterDetail } from "./module/filter/entity/saved-filter-detail.entity";
|
|
7
8
|
import { SavedFilterMaster } from "./module/filter/entity/saved-filter-master.entity";
|
|
8
9
|
import { IntegrationConfig } from "./module/integration/entity/integration-config.entity";
|
|
@@ -39,8 +40,6 @@ import { UserSession } from "./module/user/entity/user-session.entity";
|
|
|
39
40
|
import { UserData } from "./module/user/entity/user.entity";
|
|
40
41
|
import { WorkflowAutomationActionEntity } from "./module/workflow-automation/entity/workflow-automation-action.entity";
|
|
41
42
|
import { WorkflowAutomation } from "./module/workflow-automation/entity/workflow-automation.entity";
|
|
42
|
-
import { ScheduledWorkflow } from "./module/workflow-schedule/entities/scheduled-workflow.entity";
|
|
43
|
-
import { WorkflowExecutionLog } from "./module/workflow-schedule/entities/workflow-execution-log.entity";
|
|
44
43
|
import { ActionCategory } from "./module/workflow/entity/action-category.entity";
|
|
45
44
|
import { ActionDataEntity } from "./module/workflow/entity/action-data.entity";
|
|
46
45
|
import { ActionResourcesMapping } from "./module/workflow/entity/action-resources-mapping.entity";
|
|
@@ -84,7 +83,8 @@ export const frameworkTables = [
|
|
|
84
83
|
SavedFilterDetail,
|
|
85
84
|
SavedFilterMaster,
|
|
86
85
|
UserIntegration,
|
|
87
|
-
ViewMaster
|
|
86
|
+
ViewMaster,
|
|
87
|
+
EntityJson
|
|
88
88
|
]
|
|
89
89
|
|
|
90
90
|
export const workflowTables = [
|
|
@@ -107,9 +107,7 @@ export const workflowTables = [
|
|
|
107
107
|
WorkflowAutomation,
|
|
108
108
|
WorkflowAutomationActionEntity,
|
|
109
109
|
WorkflowLevelMappingEntity,
|
|
110
|
-
WorkFlowData
|
|
111
|
-
WorkflowExecutionLog,
|
|
112
|
-
ScheduledWorkflow
|
|
110
|
+
WorkFlowData
|
|
113
111
|
]
|
|
114
112
|
|
|
115
113
|
export const SSOTables = [
|