law-common 10.39.0 → 10.40.0
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.
- package/dist/src/api/interface/address-book.create.dto.interface.d.ts +6 -4
- package/dist/src/entities/enums/address_book_status_enum.autocode.d.ts +5 -0
- package/dist/src/entities/enums/address_book_status_enum.autocode.js +9 -0
- package/dist/src/entities/enums/address_book_status_enum.d.ts +5 -0
- package/dist/src/entities/enums/address_book_status_enum.js +9 -0
- package/dist/src/entities/enums/address_book_status_enum.old.d.ts +5 -0
- package/dist/src/entities/enums/address_book_status_enum.old.js +9 -0
- package/dist/src/entities/index.d.ts +1 -0
- package/dist/src/entities/index.js +3 -0
- package/dist/src/entities/interface/address-book.entity.interface.autocode.d.ts +13 -0
- package/dist/src/entities/interface/address-book.entity.interface.autocode.js +2 -0
- package/dist/src/entities/interface/address-book.entity.interface.d.ts +5 -3
- package/dist/src/entities/interface/address-book.entity.interface.old.d.ts +13 -0
- package/dist/src/entities/interface/address-book.entity.interface.old.js +2 -0
- package/dist/src/entities/model/address_book.model.d.ts +3 -1
- package/dist/src/entities/model/address_book.model.js +3 -1
- package/dist/src/utils/helper.fn.util.d.ts +12 -0
- package/dist/src/utils/helper.fn.util.js +47 -0
- package/package.json +36 -35
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { IAddressBookEntity, IEntityCreateDto } from "../../entities";
|
|
2
|
-
|
|
3
|
-
export type IAddressBookCreateExclude = "contactDetails" | "address" | "organizationId";
|
|
2
|
+
export type IAddressBookCreateExclude = "contactDetail" | "address" | "organizationId" | "status";
|
|
4
3
|
export interface IAddressBookContactDetail {
|
|
5
4
|
id?: number;
|
|
6
5
|
name: string;
|
|
7
6
|
email?: string;
|
|
8
7
|
phone?: string;
|
|
9
|
-
|
|
8
|
+
}
|
|
9
|
+
export interface IContactDetail extends IAddressBookContactDetail {
|
|
10
10
|
}
|
|
11
11
|
export interface IAddressBookAddress {
|
|
12
12
|
addressLine1?: string;
|
|
@@ -15,7 +15,9 @@ export interface IAddressBookAddress {
|
|
|
15
15
|
state?: string;
|
|
16
16
|
zipCode?: string;
|
|
17
17
|
}
|
|
18
|
+
export interface IAddress extends IAddressBookAddress {
|
|
19
|
+
}
|
|
18
20
|
export interface IAddressBookCreateDto extends Omit<IEntityCreateDto<IAddressBookEntity>, IAddressBookCreateExclude> {
|
|
19
|
-
|
|
21
|
+
contactDetail: IAddressBookContactDetail[];
|
|
20
22
|
address?: IAddressBookAddress;
|
|
21
23
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddressBookStatusEnum = void 0;
|
|
4
|
+
var AddressBookStatusEnum;
|
|
5
|
+
(function (AddressBookStatusEnum) {
|
|
6
|
+
AddressBookStatusEnum["ACTIVE"] = "ACTIVE";
|
|
7
|
+
AddressBookStatusEnum["DEACTIVE"] = "DEACTIVE";
|
|
8
|
+
AddressBookStatusEnum["INACTIVE"] = "INACTIVE";
|
|
9
|
+
})(AddressBookStatusEnum || (exports.AddressBookStatusEnum = AddressBookStatusEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddressBookStatusEnum = void 0;
|
|
4
|
+
var AddressBookStatusEnum;
|
|
5
|
+
(function (AddressBookStatusEnum) {
|
|
6
|
+
AddressBookStatusEnum["ACTIVE"] = "ACTIVE";
|
|
7
|
+
AddressBookStatusEnum["DEACTIVE"] = "DEACTIVE";
|
|
8
|
+
AddressBookStatusEnum["INACTIVE"] = "INACTIVE";
|
|
9
|
+
})(AddressBookStatusEnum || (exports.AddressBookStatusEnum = AddressBookStatusEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddressBookStatusEnum = void 0;
|
|
4
|
+
var AddressBookStatusEnum;
|
|
5
|
+
(function (AddressBookStatusEnum) {
|
|
6
|
+
AddressBookStatusEnum["ACTIVE"] = "ACTIVE";
|
|
7
|
+
AddressBookStatusEnum["DEACTIVE"] = "DEACTIVE";
|
|
8
|
+
AddressBookStatusEnum["INACTIVE"] = "INACTIVE";
|
|
9
|
+
})(AddressBookStatusEnum || (exports.AddressBookStatusEnum = AddressBookStatusEnum = {}));
|
|
@@ -104,3 +104,4 @@ export * from "./enums/billing-transaction-status.enum";
|
|
|
104
104
|
export * from "./interface/billing-transaction-history.entity";
|
|
105
105
|
export * from "./model/billing-transaction.model";
|
|
106
106
|
export * from "./interface/address-book.entity.interface";
|
|
107
|
+
export * from "./enums/address_book_status_enum";
|
|
@@ -120,3 +120,6 @@ __exportStar(require("./enums/billing-transaction-status.enum"), exports);
|
|
|
120
120
|
__exportStar(require("./interface/billing-transaction-history.entity"), exports);
|
|
121
121
|
__exportStar(require("./model/billing-transaction.model"), exports);
|
|
122
122
|
__exportStar(require("./interface/address-book.entity.interface"), exports);
|
|
123
|
+
__exportStar(require("./enums/address_book_status_enum"), exports);
|
|
124
|
+
// export * from "./interface/address-book.entity.interface.autocode";
|
|
125
|
+
// export * from "./enums/address_book_status_enum.autocode";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
2
|
+
import { AddressBookStatusEnum } from "../enums/address_book_status_enum.autocode";
|
|
3
|
+
export interface IAddressBookEntity extends IEntityAuditColumn {
|
|
4
|
+
id: number;
|
|
5
|
+
organizationName: string;
|
|
6
|
+
contactDetail: string;
|
|
7
|
+
country: string;
|
|
8
|
+
notes?: string;
|
|
9
|
+
introducedBy?: number;
|
|
10
|
+
organizationId: number;
|
|
11
|
+
address?: string;
|
|
12
|
+
status: AddressBookStatusEnum;
|
|
13
|
+
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
2
|
+
import { AddressBookStatusEnum } from "../enums/address_book_status_enum";
|
|
2
3
|
export interface IAddressBookEntity extends IEntityAuditColumn {
|
|
3
4
|
id: number;
|
|
4
5
|
organizationName: string;
|
|
5
|
-
|
|
6
|
-
address?: string;
|
|
6
|
+
contactDetail: string;
|
|
7
7
|
country: string;
|
|
8
8
|
notes?: string;
|
|
9
|
-
organizationId: number;
|
|
10
9
|
introducedBy?: number;
|
|
10
|
+
organizationId: number;
|
|
11
|
+
address?: string;
|
|
12
|
+
status: AddressBookStatusEnum;
|
|
11
13
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AddressBookStatusEnum } from "../enums/address_book_status_enum";
|
|
2
|
+
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
3
|
+
export interface IAddressBookEntity extends IEntityAuditColumn {
|
|
4
|
+
id: number;
|
|
5
|
+
organizationName: string;
|
|
6
|
+
contactDetail: string;
|
|
7
|
+
address?: string;
|
|
8
|
+
country: string;
|
|
9
|
+
notes?: string;
|
|
10
|
+
organizationId: number;
|
|
11
|
+
introducedBy?: number;
|
|
12
|
+
status: AddressBookStatusEnum;
|
|
13
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AddressBookStatusEnum } from "../enums/address_book_status_enum";
|
|
1
2
|
import { RelationType } from "../enums/relation-type.enum";
|
|
2
3
|
import { IAddressBookEntity } from "../interface/address-book.entity.interface";
|
|
3
4
|
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
@@ -6,7 +7,7 @@ import { UserEntityModel } from "./user.entity.model";
|
|
|
6
7
|
export declare class AddressBookEntityModel extends BaseEntityModel<EntityEnum.ADDRESS_BOOK> implements IAddressBookEntity {
|
|
7
8
|
id: number;
|
|
8
9
|
organizationName: string;
|
|
9
|
-
|
|
10
|
+
contactDetail: string;
|
|
10
11
|
address?: string | undefined;
|
|
11
12
|
country: string;
|
|
12
13
|
notes?: string | undefined;
|
|
@@ -16,6 +17,7 @@ export declare class AddressBookEntityModel extends BaseEntityModel<EntityEnum.A
|
|
|
16
17
|
updatedOn: number;
|
|
17
18
|
createdBy: number;
|
|
18
19
|
updatedBy: number;
|
|
20
|
+
status: AddressBookStatusEnum;
|
|
19
21
|
introducedByUser?: UserEntityModel | undefined;
|
|
20
22
|
static fromEntity(entity: IAddressBookEntity): AddressBookEntityModel;
|
|
21
23
|
static relationConfigs: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AddressBookEntityModel = void 0;
|
|
4
|
+
const address_book_status_enum_1 = require("../enums/address_book_status_enum");
|
|
4
5
|
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
5
6
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
6
7
|
const base_entity_model_1 = require("./base.entity.model");
|
|
@@ -9,7 +10,7 @@ class AddressBookEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
9
10
|
super(...arguments);
|
|
10
11
|
this.id = 0;
|
|
11
12
|
this.organizationName = "";
|
|
12
|
-
this.
|
|
13
|
+
this.contactDetail = "";
|
|
13
14
|
this.address = "";
|
|
14
15
|
this.country = "";
|
|
15
16
|
this.notes = "";
|
|
@@ -19,6 +20,7 @@ class AddressBookEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
19
20
|
this.updatedOn = 0;
|
|
20
21
|
this.createdBy = 0;
|
|
21
22
|
this.updatedBy = 0;
|
|
23
|
+
this.status = address_book_status_enum_1.AddressBookStatusEnum.ACTIVE;
|
|
22
24
|
}
|
|
23
25
|
static fromEntity(entity) {
|
|
24
26
|
const result = new AddressBookEntityModel(entity_utils_interface_1.EntityEnum.ADDRESS_BOOK);
|
|
@@ -5,6 +5,18 @@ export declare function groupByOneToOneFunction<T, K>(list: T[], keyGetter: (inp
|
|
|
5
5
|
export declare function convertMapToObject<K, T>(map: Map<K, T>): {
|
|
6
6
|
[key: string]: T;
|
|
7
7
|
};
|
|
8
|
+
export type DiffEntry<T = unknown, U = unknown> = {
|
|
9
|
+
old: T;
|
|
10
|
+
new: U;
|
|
11
|
+
};
|
|
12
|
+
export type DiffObject<T extends Record<string, unknown>, U extends Record<string, unknown>> = {
|
|
13
|
+
[K in Exclude<keyof T, keyof U>]: DiffEntry<T[K], undefined>;
|
|
14
|
+
} & {
|
|
15
|
+
[K in Exclude<keyof U, keyof T>]: DiffEntry<undefined, U[K]>;
|
|
16
|
+
} & {
|
|
17
|
+
[K in Extract<keyof T, keyof U>]: DiffEntry<T[K], U[K]>;
|
|
18
|
+
};
|
|
19
|
+
export declare function getDifferingKeysWithValues<T extends Record<string, unknown>, U extends Record<string, unknown>>(obj1: T, obj2: U, keysToCompare?: (keyof T | keyof U)[]): DiffObject<T, U>;
|
|
8
20
|
export declare function removeSamePropertyValues(source: any, target: any): void;
|
|
9
21
|
export declare function getChangedProperties<T>(source: T, target: T): Partial<T>;
|
|
10
22
|
export declare function compareObjects<T extends Record<string, any>>(obj1: T, obj2: T): boolean;
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.groupByFunction = groupByFunction;
|
|
13
13
|
exports.groupByOneToOneFunction = groupByOneToOneFunction;
|
|
14
14
|
exports.convertMapToObject = convertMapToObject;
|
|
15
|
+
exports.getDifferingKeysWithValues = getDifferingKeysWithValues;
|
|
15
16
|
exports.removeSamePropertyValues = removeSamePropertyValues;
|
|
16
17
|
exports.getChangedProperties = getChangedProperties;
|
|
17
18
|
exports.compareObjects = compareObjects;
|
|
@@ -47,6 +48,7 @@ const date_fns_1 = require("date-fns");
|
|
|
47
48
|
const util_constants_1 = require("../constants/util.constants");
|
|
48
49
|
const error_key_enum_1 = require("../enums/error.key.enum");
|
|
49
50
|
const exceptions_1 = require("../exceptions");
|
|
51
|
+
const lodash_1 = require("lodash");
|
|
50
52
|
function groupByFunction(list, keyGetter) {
|
|
51
53
|
const map = new Map();
|
|
52
54
|
list.forEach((item) => {
|
|
@@ -72,6 +74,51 @@ function groupByOneToOneFunction(list, keyGetter) {
|
|
|
72
74
|
function convertMapToObject(map) {
|
|
73
75
|
return Object.fromEntries(map);
|
|
74
76
|
}
|
|
77
|
+
// Function signature with full TypeScript definition
|
|
78
|
+
function getDifferingKeysWithValues(obj1, obj2, keysToCompare) {
|
|
79
|
+
// @ts-ignore
|
|
80
|
+
const diff = {};
|
|
81
|
+
if (keysToCompare && keysToCompare.length > 0) {
|
|
82
|
+
// Compare only the specified keys (handles presence/absence via undefined values)
|
|
83
|
+
keysToCompare.forEach((key) => {
|
|
84
|
+
const val1 = obj1[key];
|
|
85
|
+
const val2 = obj2[key];
|
|
86
|
+
if (!(0, lodash_1.isEqual)(val1, val2)) {
|
|
87
|
+
diff[key] = { old: val1, new: val2 };
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
// Full comparison: handle all keys
|
|
93
|
+
// Handle keys in obj1 (common or only in obj1)
|
|
94
|
+
Object.keys(obj1).forEach((key) => {
|
|
95
|
+
if (key in obj2) {
|
|
96
|
+
// Common key: check for value difference
|
|
97
|
+
const val1 = obj1[key];
|
|
98
|
+
// @ts-ignore
|
|
99
|
+
const val2 = obj2[key]; // TypeScript narrows `key` to Extract<keyof T, keyof U> via `in` guard
|
|
100
|
+
if (!(0, lodash_1.isEqual)(val1, val2)) {
|
|
101
|
+
// @ts-ignore
|
|
102
|
+
diff[key] = { old: val1, new: val2 };
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
// Only in obj1: always differs (presence vs. absence)
|
|
107
|
+
// @ts-ignore
|
|
108
|
+
diff[key] = { old: obj1[key], new: undefined };
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
// Handle keys only in obj2
|
|
112
|
+
Object.keys(obj2).forEach((key) => {
|
|
113
|
+
if (!(key in obj1)) {
|
|
114
|
+
// Only in obj2: always differs (presence vs. absence)
|
|
115
|
+
// @ts-ignore
|
|
116
|
+
diff[key] = { old: undefined, new: obj2[key] };
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
return diff;
|
|
121
|
+
}
|
|
75
122
|
function removeSamePropertyValues(source, target) {
|
|
76
123
|
for (let key in target) {
|
|
77
124
|
// remove if null in source and target
|
package/package.json
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "law-common",
|
|
3
|
-
"version": "10.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"files": [
|
|
7
|
-
"dist/**/*"
|
|
8
|
-
],
|
|
9
|
-
"scripts": {
|
|
10
|
-
"clean": "rm -rf dist",
|
|
11
|
-
"build": "npm run clean && tsc",
|
|
12
|
-
"publish:beta": "npm version prerelease --preid beta && git push && npm run build && npm publish --tag beta",
|
|
13
|
-
"publish:patch": "npm version patch && git push && npm run build && npm publish",
|
|
14
|
-
"publish:minor": "npm version minor && git push && npm run build && npm publish",
|
|
15
|
-
"publish:major": "npm version major && git push && npm run build && npm publish",
|
|
16
|
-
"link": "npm run build && npm link",
|
|
17
|
-
"test": "jest"
|
|
18
|
-
},
|
|
19
|
-
"keywords": [],
|
|
20
|
-
"author": "",
|
|
21
|
-
"license": "ISC",
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@types/jest": "^29.5.13",
|
|
24
|
-
"@types/node": "^22.6.1",
|
|
25
|
-
"jest": "^29.7.0",
|
|
26
|
-
"ts-jest": "^29.2.5",
|
|
27
|
-
"ts-node": "^10.9.2",
|
|
28
|
-
"typescript": "^5.6.2"
|
|
29
|
-
},
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"@types/express": "^5.0.0",
|
|
32
|
-
"@types/multer": "^1.4.12",
|
|
33
|
-
"date-fns": "^4.1.0"
|
|
34
|
-
|
|
35
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "law-common",
|
|
3
|
+
"version": "10.40.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/**/*"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"clean": "rm -rf dist",
|
|
11
|
+
"build": "npm run clean && tsc",
|
|
12
|
+
"publish:beta": "npm version prerelease --preid beta && git push && npm run build && npm publish --tag beta",
|
|
13
|
+
"publish:patch": "npm version patch && git push && npm run build && npm publish",
|
|
14
|
+
"publish:minor": "npm version minor && git push && npm run build && npm publish",
|
|
15
|
+
"publish:major": "npm version major && git push && npm run build && npm publish",
|
|
16
|
+
"link": "npm run build && npm link",
|
|
17
|
+
"test": "jest"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [],
|
|
20
|
+
"author": "",
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/jest": "^29.5.13",
|
|
24
|
+
"@types/node": "^22.6.1",
|
|
25
|
+
"jest": "^29.7.0",
|
|
26
|
+
"ts-jest": "^29.2.5",
|
|
27
|
+
"ts-node": "^10.9.2",
|
|
28
|
+
"typescript": "^5.6.2"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@types/express": "^5.0.0",
|
|
32
|
+
"@types/multer": "^1.4.12",
|
|
33
|
+
"date-fns": "^4.1.0",
|
|
34
|
+
"lodash": "4.17.21"
|
|
35
|
+
}
|
|
36
|
+
}
|