law-common 10.19.1-beta.15 → 10.19.1-beta.17

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.
@@ -19,9 +19,15 @@ class BaseEntityModel {
19
19
  // debugger;
20
20
  if (relationConfig.relation === RelationType.ONE) {
21
21
  const relatedEntities = entityIndexMap[relationConfig.name] || {};
22
+ if (Object.is(relatedEntities, null))
23
+ continue;
22
24
  let foundRelatedEntities = [];
23
25
  if (thisMappingKey.includes(".")) {
24
26
  const [parentKey, childKey] = thisMappingKey.split(".");
27
+ console.log("parentKey", parentKey);
28
+ console.log("childKey", childKey);
29
+ if (!this[parentKey] || !this[parentKey[childKey]])
30
+ continue;
25
31
  foundRelatedEntities = [relatedEntities[this[parentKey][childKey]]];
26
32
  }
27
33
  else {
@@ -5,6 +5,7 @@ import { EntityEnum, EnumEntityType } from "../interface/entity.utils.interface"
5
5
  import { RelationConfigs } from "../interface/relation-config.interface";
6
6
  import { BankEntityModel } from "./bank.entity.model";
7
7
  import { BaseEntityModel } from "./base.entity.model";
8
+ import { BillingEntityModel } from "./billing.entity.model";
8
9
  import { UserEntityModel } from "./user.entity.model";
9
10
  export declare class BillingTransactionEntityModel extends BaseEntityModel<EntityEnum.BILLING_TRANSACTION> implements IBillingTransactionApiEntity {
10
11
  id: number;
@@ -25,11 +26,13 @@ export declare class BillingTransactionEntityModel extends BaseEntityModel<Entit
25
26
  createdByUser?: UserEntityModel;
26
27
  updatedByUser?: UserEntityModel;
27
28
  bank?: BankEntityModel;
29
+ billing?: BillingEntityModel;
28
30
  getRelationConfigs(): any;
29
31
  static relationConfigs: RelationConfigs<[
30
32
  EntityEnum.USER,
31
33
  EntityEnum.USER,
32
- EntityEnum.BANK
34
+ EntityEnum.BANK,
35
+ EntityEnum.BILLING
33
36
  ], EnumEntityType<EntityEnum.BILLING_TRANSACTION>>;
34
37
  static fromApiEntity(apiEntity: IBillingTransactionApiEntity): BillingTransactionEntityModel;
35
38
  }
@@ -59,4 +59,13 @@ BillingTransactionEntityModel.relationConfigs = [
59
59
  key: "bankId",
60
60
  },
61
61
  },
62
+ {
63
+ name: entity_utils_interface_1.EntityEnum.BILLING,
64
+ relation: base_entity_model_1.RelationType.ONE,
65
+ key: "billing",
66
+ mapKeyConfig: {
67
+ relationKey: "id",
68
+ key: "billingId",
69
+ },
70
+ },
62
71
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "10.19.1-beta.15",
3
+ "version": "10.19.1-beta.17",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [