rez_core 4.0.230 → 4.0.232

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": "4.0.230",
3
+ "version": "4.0.232",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -215,30 +215,31 @@ export class EntityJSONService extends EntityServiceImpl {
215
215
  // 5. Merge linked attributes using saved filters
216
216
  for (const linkAttr of safeAttributes.linkedAttributes) {
217
217
  const childEntityType = linkAttr.fla_applicable_entity_type;
218
- const childAttributeKey = linkAttr.attr_attribute_key;
218
+ const sourceKey = linkAttr.applicable_attribute_key; // source column = middle_name
219
+ const targetKey = linkAttr.attribute_key; // final JSON key = father_middle_name
219
220
 
220
- if (!childEntityType || !childAttributeKey) continue;
221
+ if (!childEntityType || !sourceKey || !targetKey) continue;
221
222
 
222
- // mappingValue can come from mainData or relatedData if you have parent key
223
- const mappingValue = mainData?.[childAttributeKey] ?? null;
223
+ // value must be taken from applicable_attribute_key
224
+ const mappingValue = mainData?.[sourceKey] ?? null;
224
225
 
225
226
  const value = await this.applyLinkedFilterUsingSavedFilter(
226
227
  childEntityType,
227
- linkAttr.fla_saved_filter_code, // make sure this column exists in your query
228
- childAttributeKey,
228
+ linkAttr.fla_saved_filter_code,
229
+ sourceKey,
229
230
  mappingValue,
230
- childAttributeKey, // target attribute in flatJson
231
+ targetKey, // IMPORTANT write to father_middle_name
231
232
  loggedInUser,
232
233
  entityId
233
234
  );
234
235
 
235
236
  if (value !== null && value !== undefined) {
236
- // Use attrMap if flat_json_key exists
237
- const flatKey = attrMap[childAttributeKey] || childAttributeKey;
237
+ const flatKey = targetKey; // do NOT use childAttributeKey
238
238
  flatJson[flatKey] = value;
239
239
  }
240
240
  }
241
241
 
242
+
242
243
  // 6. Save JSON
243
244
  await this.dataSource.query(
244
245
  `INSERT INTO frm_entity_json (entity_type, entity_id, json_data, created_by)