law-common 1.2.20 → 1.2.22

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.
@@ -1,11 +1,22 @@
1
- import { IApiEntity, IProjectEntity, IProjectEntityDependent } from "../../entities";
1
+ import { IApiEntity, IDesignationApiEntity, IProjectCreateDtoExtra, IProjectEntity, IProjectEntityDependent } from "../../entities";
2
+ import { IClientApiEntity } from "./client.entity.response";
3
+ import { IRateApiEntity } from "./rate.entity.response";
2
4
  import { IUserApiEntity } from "./user.entity.api";
3
5
  export type IProjectApiEntity = IApiEntity<IProjectEntity>;
4
6
  export type IProjectApiEntityArray = IProjectApiEntity[];
5
- export type IProjectApiEntityDependent = IProjectApiEntity & IProjectEntityDependent;
7
+ export type IProjectApiEntityDependent = IProjectApiEntity & IProjectEntityDependent & IProjectCreateDtoExtra;
6
8
  export type IProjectEntityGet = {
7
9
  projects: IProjectApiEntityDependent[];
8
10
  users: {
9
11
  [key: string]: IUserApiEntity;
10
12
  };
13
+ clients: {
14
+ [key: string]: IClientApiEntity;
15
+ };
16
+ designations?: {
17
+ [key: string]: IDesignationApiEntity;
18
+ };
19
+ rates?: {
20
+ [key: string]: IRateApiEntity;
21
+ };
11
22
  };
@@ -22,12 +22,16 @@ export interface IProjectEntityDependent {
22
22
  resourceIds: number[];
23
23
  }
24
24
  export type IProjectExclude = "organizationId" | "billingRate";
25
+ export interface IProjectExcludeT extends Pick<IProjectEntity, "organizationId" | "billingRate"> {
26
+ }
25
27
  export interface IProjectHourlyRate {
26
28
  id: number;
27
29
  rate: number;
28
30
  unit: TimeUnitEnum.HOUR;
29
31
  }
30
- export type IProjectHourlyRates = IProjectHourlyRate[];
32
+ export interface IProjectCreateDtoExtra {
33
+ projectBillingRate: IProjectHourlyRate[] | IProjectFixedMonthlyRate | IProjectAdhocRate;
34
+ }
31
35
  export interface IProjectFixedMonthlyRate {
32
36
  rate: number;
33
37
  unit: TimeUnitEnum.MONTH;
@@ -37,10 +41,9 @@ export interface IProjectAdhocRate {
37
41
  rate: number;
38
42
  maxEstimatedHours: number;
39
43
  }
40
- export interface IProjectEntityCreateDto extends Omit<IEntityCreateDto<IProjectEntity>, IProjectExclude>, IProjectEntityDependent {
41
- projectBillingRate?: IProjectHourlyRates | IProjectFixedMonthlyRate | IProjectAdhocRate;
44
+ export interface IProjectEntityCreateDto extends Omit<IEntityCreateDto<IProjectEntity>, IProjectExclude>, IProjectEntityDependent, IProjectCreateDtoExtra {
42
45
  }
43
- export interface IProjectEntityUpdateDto extends Omit<IEntityUpdateDto<IProjectEntity>, IProjectExclude>, Partial<IProjectEntityDependent> {
46
+ export interface IProjectEntityUpdateDto extends Omit<IEntityUpdateDto<IProjectEntity>, IProjectExclude>, Partial<IProjectEntityDependent>, Partial<IProjectCreateDtoExtra> {
44
47
  }
45
48
  export interface IProjectEntityFilterDto extends IEntityFilterData<IProjectEntity> {
46
49
  }
@@ -38,6 +38,10 @@ function convertMapToObject(map) {
38
38
  }
39
39
  function removeSamePropertyValues(source, target) {
40
40
  for (let key in target) {
41
+ // remove if null in source and target
42
+ if (source[key] === null && target[key] === null) {
43
+ delete target[key];
44
+ }
41
45
  if (source[key] && source[key] === target[key]) {
42
46
  delete target[key];
43
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "1.2.20",
3
+ "version": "1.2.22",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [