law-common 9.1.1-beta.0 → 9.1.1-beta.2

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.
@@ -72,9 +72,12 @@ export declare enum EntityEnum {
72
72
  CLIENT_USER_MAPPING = "client_user_mapping",
73
73
  ROLE_PERMISSION_MAPPING = "role_permission_mapping"
74
74
  }
75
+ type EntityRelations = {
76
+ [K in EntityEnum]: K;
77
+ };
75
78
  export type ISearchIncludeEntity<T extends EntityEnum> = {
76
79
  name: T;
77
- relations?: ISearchIncludeEntity<T>[];
80
+ relations?: ISearchIncludeEntity<EntityRelations[T]>[];
78
81
  entities?: ISearchIncludeEntity<T>[];
79
82
  columnkeys?: EntityKeyType<T>[];
80
83
  mappingProperties?: EntityKeyType<T>[];
@@ -106,7 +109,7 @@ export type EntityRelationConfig<T extends EntityEnum> = {
106
109
  projectProperties?: EntityKeyType<K>[];
107
110
  };
108
111
  };
109
- export type EntityKeyType<K extends EntityEnum> = K extends EntityEnum.USER ? keyof IUserEntity : K extends EntityEnum.PROJECT ? keyof IProjectEntity : K extends EntityEnum.BILLING_TIMESHEET ? keyof IBillingTimesheetEntity : K extends EntityEnum.BILLING ? keyof IBillingEntity : K extends EntityEnum.TIMESHEET ? keyof ITimesheetEntity : K extends EntityEnum.CLIENT ? keyof IClientEntity : never;
112
+ export type EntityKeyType<K extends EntityEnum> = keyof EnumEntityType<K>;
110
113
  export type IEntityApiResponse<T extends {
111
114
  createdOn: Date;
112
115
  updatedOn: Date;
@@ -163,3 +166,4 @@ export type IHistoryEntityChangedLogs = {
163
166
  oldValue: string | number;
164
167
  timeStamp: string;
165
168
  };
169
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "9.1.1-beta.0",
3
+ "version": "9.1.1-beta.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [