law-common 9.1.1-beta.4 → 9.1.1-beta.6

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.
@@ -78,8 +78,8 @@ export type EntityRelations = {
78
78
  export type ISearchIncludeEntity<T extends EntityEnum> = {
79
79
  name: T;
80
80
  relations?: ISearchIncludeEntity<EntityRelations[EntityEnum]>[];
81
- entities?: ISearchIncludeEntity<T>[];
82
- columnkeys?: EntityKeyType<T>[];
81
+ entities?: ISearchIncludeEntity<EntityRelations[EntityEnum]>[];
82
+ columnkeys?: EntityKeyType<EntityRelations[T]>[];
83
83
  mappingProperties?: EntityKeyType<T>[];
84
84
  searchProperty?: EntityKeyType<T>;
85
85
  };
@@ -90,13 +90,22 @@ export type IBaseEntityServiceResponse<T> = {
90
90
  baseEntities: T[];
91
91
  relatedEntities?: IEntityServiceResponse;
92
92
  };
93
+ export type IBaseEntityApiResponseOld<T extends {
94
+ createdOn: Date;
95
+ updatedOn: Date;
96
+ }> = {
97
+ baseEntities: IApiEntity<T>[];
98
+ relatedEntities?: {
99
+ [K in EntityEnum]?: K extends EntityEnum.BILLING ? IBaseEntityApiResponse<IBillingEntity> : K extends EntityEnum.BILLING_TIMESHEET ? IBaseEntityApiResponse<IBillingTimesheetEntity> : K extends EntityEnum.TIMESHEET ? IBaseEntityApiResponse<ITimesheetEntity> : K extends EntityEnum.USER ? IBaseEntityApiResponse<IUserEntity> : K extends EntityEnum.PROJECT ? IBaseEntityApiResponse<IProjectEntity> : K extends EntityEnum.CLIENT ? IBaseEntityApiResponse<IClientEntity> : K extends EntityEnum.TASK ? IBaseEntityApiResponse<ITaskEntity> : K extends EntityEnum.PROJECT_USER_MAPPING ? IBaseEntityApiResponse<IProjectUserMappingEntity> : never;
100
+ };
101
+ };
93
102
  export type IBaseEntityApiResponse<T extends {
94
103
  createdOn: Date;
95
104
  updatedOn: Date;
96
105
  }> = {
97
106
  baseEntities: IApiEntity<T>[];
98
107
  relatedEntities?: {
99
- [K in EntityEnum]?: K extends EntityEnum.BILLING ? IBaseEntityApiResponse<IBillingEntity> : K extends EntityEnum.BILLING_TIMESHEET ? IBaseEntityApiResponse<IBillingTimesheetEntity> : K extends EntityEnum.TIMESHEET ? IBaseEntityApiResponse<ITimesheetEntity> : K extends EntityEnum.USER ? IBaseEntityApiResponse<IUserEntity> : K extends EntityEnum.PROJECT ? IBaseEntityApiResponse<IProjectEntity> : K extends EntityEnum.CLIENT ? IBaseEntityApiResponse<IClientEntity> : never;
108
+ [K in EntityEnum]?: IBaseEntityApiResponse<EnumEntityType<K>>;
100
109
  };
101
110
  };
102
111
  export type EnumEntityType<T extends EntityEnum> = (T extends EntityEnum.BILLING ? IBillingEntity : T extends EntityEnum.BILLING_TIMESHEET ? IBillingTimesheetEntity : T extends EntityEnum.TIMESHEET ? ITimesheetEntity : T extends EntityEnum.USER ? IUserEntity : T extends EntityEnum.PROJECT ? IProjectEntity : T extends EntityEnum.CLIENT ? IClientEntity : T extends EntityEnum.LEAVE ? ILeaveEntity : T extends EntityEnum.BANK ? IBankEntity : T extends EntityEnum.BANK_HISTORY ? IBankHistoryEntity : T extends EntityEnum.BILLING_PAYMENT ? IBillingPaymentEntity : T extends EntityEnum.BILLING_TRANSACTION ? IBillingTransactionEntity : T extends EntityEnum.CLIENT_AFFILIATE ? IClientAffiliateEntity : T extends EntityEnum.CONFIGURATION ? IConfigurationEntity : T extends EntityEnum.COUNTRY ? ICountryEntity : T extends EntityEnum.EXPENSE_TYPE ? IExpenseTypeEntity : T extends EntityEnum.INDUSTRY ? IIndustryEntity : T extends EntityEnum.INTERMEDIARY_BANK ? IIntermediaryBankEntity : T extends EntityEnum.OFFICE_LOCATION ? IOfficeLocationEntity : T extends EntityEnum.PERMISSION ? IPermissionEntity : T extends EntityEnum.ROLE ? IRoleEntity : T extends EntityEnum.TASK ? ITaskEntity : T extends EntityEnum.DESIGNATION ? IDesignationEntity : T extends EntityEnum.RATE ? IRateEntity : T extends EntityEnum.REIMBURSEMENT ? IReimbursementEntity : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? IReimbursementExpenseEntity : T extends EntityEnum.WORK_FROM_HOME ? IWorkFromHomeEntity : T extends EntityEnum.ORGANIZATION ? IOrganizationEntity : T extends EntityEnum.PROJECT_USER_MAPPING ? IProjectUserMappingEntity : T extends EntityEnum.CLIENT_USER_MAPPING ? IClientUserMappingEntity : T extends EntityEnum.ROLE_PERMISSION_MAPPING ? IRolePermissionMappingEntity : never) & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "9.1.1-beta.4",
3
+ "version": "9.1.1-beta.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [