law-common 1.2.4 → 1.2.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.
@@ -1,6 +1,6 @@
1
1
  import { CountryEnum } from "../enums/country.entity.enum";
2
2
  import { IAuditColumnEntity } from "./audit-column.entity.interface";
3
- import { IEntityCreateDto, IEntityFilterData } from "./entity.utils.interface";
3
+ import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
4
4
  export interface IClientEntity extends IAuditColumnEntity {
5
5
  id: number;
6
6
  name: string;
@@ -15,9 +15,12 @@ export interface IClientEntity extends IAuditColumnEntity {
15
15
  description?: string;
16
16
  organizationId: number;
17
17
  }
18
- export interface IClientEntityCreateDto extends Omit<IEntityCreateDto<IClientEntity>, "industry" | "organizationId"> {
18
+ export type IClientExclude = 'organizationId';
19
+ export interface IClientEntityCreateDto extends Omit<IEntityCreateDto<IClientEntity>, IClientExclude> {
19
20
  partnerIds: number[];
20
- industries?: string[];
21
+ }
22
+ export interface IClientEntityUpdateDto extends Omit<IEntityUpdateDto<IClientEntity>, IClientExclude> {
23
+ partnerIds?: number[];
21
24
  }
22
25
  export interface IClientEntityFilterDto extends IEntityFilterData<IClientEntity> {
23
26
  }
@@ -3,3 +3,4 @@ export declare function groupByOneToOneFunction<T, K>(list: T[], keyGetter: (inp
3
3
  export declare function convertMapToObject<K, T>(map: Map<K, T>): {
4
4
  [key: string]: T;
5
5
  };
6
+ export declare function removeSamePropertyValues(source: any, target: any): void;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.groupByFunction = groupByFunction;
4
4
  exports.groupByOneToOneFunction = groupByOneToOneFunction;
5
5
  exports.convertMapToObject = convertMapToObject;
6
+ exports.removeSamePropertyValues = removeSamePropertyValues;
6
7
  function groupByFunction(list, keyGetter) {
7
8
  const map = new Map();
8
9
  list.forEach((item) => {
@@ -28,3 +29,10 @@ function groupByOneToOneFunction(list, keyGetter) {
28
29
  function convertMapToObject(map) {
29
30
  return Object.fromEntries(map);
30
31
  }
32
+ function removeSamePropertyValues(source, target) {
33
+ for (let key in target) {
34
+ if (source[key] && source[key] === target[key]) {
35
+ delete target[key];
36
+ }
37
+ }
38
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [