law-common 10.21.2-beta.1 → 10.22.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.
|
@@ -49,7 +49,7 @@ function populateRelationsFor(entityIndexMap, enumEntities) {
|
|
|
49
49
|
}
|
|
50
50
|
function parseEntities(json, baseEntity, entityMap, epoch) {
|
|
51
51
|
var _a;
|
|
52
|
-
const
|
|
52
|
+
const entityFromJsonMappings = {
|
|
53
53
|
[entity_utils_interface_1.EntityEnum.PROJECT]: project_entity_model_1.ProjectEntityModel.fromApiEntity,
|
|
54
54
|
[entity_utils_interface_1.EntityEnum.CLIENT]: client_entity_model_1.ClientEntityModel.fromApiEntity,
|
|
55
55
|
[entity_utils_interface_1.EntityEnum.BILLING]: billing_entity_model_1.BillingEntityModel.fromApiEntity,
|
|
@@ -61,37 +61,16 @@ function parseEntities(json, baseEntity, entityMap, epoch) {
|
|
|
61
61
|
[entity_utils_interface_1.EntityEnum.CLIENT_AFFILIATE]: client_affiliate_entity_model_1.ClientAffiliateEntityModel.fromApiEntity,
|
|
62
62
|
[entity_utils_interface_1.EntityEnum.BANK]: bank_entity_model_1.BankEntityModel.fromApiEntity,
|
|
63
63
|
[entity_utils_interface_1.EntityEnum.CONFIGURATION]: configuration_model_1.ConfigurationEntityModel.fromApiEntity,
|
|
64
|
-
|
|
64
|
+
[entity_utils_interface_1.EntityEnum.TASK]: task_entity_model_1.TaskEntityModel.fromEntity,
|
|
65
65
|
[entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET]: billing_timesheet_entity_model_1.BillingTimesheetEntityModel.fromApiEntity,
|
|
66
66
|
[entity_utils_interface_1.EntityEnum.TIMESHEET]: timesheet_entity_model_1.TimesheetEntityModel.fromApiEntity,
|
|
67
67
|
};
|
|
68
|
-
const epochEntityFromJsonMappings = {
|
|
69
|
-
// [EntityEnum.PROJECT]: ProjectEntityModel.fromApiEntity,
|
|
70
|
-
// [EntityEnum.CLIENT]: ClientEntityModel.fromApiEntity,
|
|
71
|
-
// [EntityEnum.BILLING]: BillingEntityModel.fromApiEntity,
|
|
72
|
-
// [EntityEnum.USER]: UserEntityModel.fromApiEntity,
|
|
73
|
-
// [EntityEnum.PROJECT_USER_MAPPING]:
|
|
74
|
-
// ProjectUserMappingEntityModel.fromApiEntity,
|
|
75
|
-
// [EntityEnum.REIMBURSEMENT]: ReimbursementEntityModel.fromApiEntity,
|
|
76
|
-
// [EntityEnum.REIMBURSEMENT_EXPENSE]:
|
|
77
|
-
// ReimbursementExpenseEntityModel.fromApiEntity,
|
|
78
|
-
// [EntityEnum.BILLING_REIMBURSEMENT_EXPENSE]:
|
|
79
|
-
// BillingReimbursementExpneseEntityModel.fromApiEntity,
|
|
80
|
-
// [EntityEnum.CLIENT_AFFILIATE]: ClientAffiliateEntityModel.fromApiEntity,
|
|
81
|
-
// [EntityEnum.BANK]: BankEntityModel.fromApiEntity,
|
|
82
|
-
// [EntityEnum.CONFIGURATION]: ConfigurationEntityModel.fromApiEntity,
|
|
83
|
-
[entity_utils_interface_1.EntityEnum.TASK]: task_entity_model_1.TaskEntityModel.fromApiEntity,
|
|
84
|
-
// [EntityEnum.BILLING_TIMESHEET]: BillingTimesheetEntityModel.fromApiEntity,
|
|
85
|
-
// [EntityEnum.TIMESHEET]: TimesheetEntityModel.fromApiEntity,
|
|
86
|
-
};
|
|
87
|
-
let entityFromJsonMappings = nonEpochEntityFromJsonMappings;
|
|
88
|
-
if (epoch) {
|
|
89
|
-
entityFromJsonMappings = epochEntityFromJsonMappings;
|
|
90
|
-
}
|
|
91
68
|
if (!(baseEntity in entityFromJsonMappings)) {
|
|
92
69
|
throw new Error(`Unknown entity: ${baseEntity}`);
|
|
93
70
|
}
|
|
94
|
-
entityMap[baseEntity] = ((_a = json["baseEntities"]) !== null && _a !== void 0 ? _a : []).map(
|
|
71
|
+
entityMap[baseEntity] = ((_a = json["baseEntities"]) !== null && _a !== void 0 ? _a : []).map(
|
|
72
|
+
// REVIEW: Needs to be fixed after audit column type conversion
|
|
73
|
+
(e) => entityFromJsonMappings[baseEntity](e));
|
|
95
74
|
if (json["relatedEntities"]) {
|
|
96
75
|
const relatedEntities = json["relatedEntities"];
|
|
97
76
|
for (const entityName in relatedEntities) {
|
|
@@ -12,6 +12,6 @@ export declare class TaskEntityModel extends BaseEntityModel<EntityEnum.TASK> im
|
|
|
12
12
|
updatedBy: number;
|
|
13
13
|
createdOn: number;
|
|
14
14
|
updatedOn: number;
|
|
15
|
-
static
|
|
15
|
+
static fromEntity(entity: ITaskEntity): TaskEntityModel;
|
|
16
16
|
getRelationConfigs(): any[];
|
|
17
17
|
}
|
|
@@ -17,10 +17,10 @@ class TaskEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
17
17
|
this.createdOn = 0;
|
|
18
18
|
this.updatedOn = 0;
|
|
19
19
|
}
|
|
20
|
-
static
|
|
21
|
-
const
|
|
22
|
-
Object.assign(
|
|
23
|
-
return
|
|
20
|
+
static fromEntity(entity) {
|
|
21
|
+
const model = new TaskEntityModel(entity_utils_interface_1.EntityEnum.TASK);
|
|
22
|
+
Object.assign(model, entity);
|
|
23
|
+
return model;
|
|
24
24
|
}
|
|
25
25
|
getRelationConfigs() {
|
|
26
26
|
return this.constructor.prototype.constructor.relationConfigs || [];
|
package/package.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
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.22.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
|
+
}
|
|
35
|
+
}
|