law-common 10.23.1-beta.2 → 10.24.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/index.d.ts +0 -1
- package/dist/src/api/index.js +1 -1
- package/dist/src/api/interface/billing.entity.response.d.ts +2 -3
- package/dist/src/api/interface/project.entity.response.d.ts +2 -4
- package/dist/src/entities/interface/project.entity.interface.d.ts +3 -3
- package/dist/src/entities/model/entity.model.interface.js +2 -2
- package/dist/src/entities/model/project-user-mapping.entity.model.d.ts +5 -6
- package/dist/src/entities/model/project-user-mapping.entity.model.js +6 -6
- package/dist/src/entities/model/project.entity.model.d.ts +5 -6
- package/dist/src/entities/model/project.entity.model.js +22 -22
- package/package.json +35 -35
- package/dist/src/api/interface/project-user-mapping.entity.api.d.ts +0 -3
- package/dist/src/api/interface/project-user-mapping.entity.api.js +0 -2
package/dist/src/api/index.d.ts
CHANGED
|
@@ -70,4 +70,3 @@ export * from "./interface/cron-job.entity.response";
|
|
|
70
70
|
export * from "./interface/to-do.entity.api";
|
|
71
71
|
export * from "./interface/billing-reimbursement-expense.api";
|
|
72
72
|
export * from "./interface/billing-reimbursement-expense-history.api";
|
|
73
|
-
export * from "./interface/project-user-mapping.entity.api";
|
package/dist/src/api/index.js
CHANGED
|
@@ -86,4 +86,4 @@ __exportStar(require("./interface/cron-job.entity.response"), exports);
|
|
|
86
86
|
__exportStar(require("./interface/to-do.entity.api"), exports);
|
|
87
87
|
__exportStar(require("./interface/billing-reimbursement-expense.api"), exports);
|
|
88
88
|
__exportStar(require("./interface/billing-reimbursement-expense-history.api"), exports);
|
|
89
|
-
|
|
89
|
+
// export * from "./interface/project-user-mapping.entity.api";
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { BillingActionsEnum, BillingStatusEnum, IBillingEntity, IUserEntity } from "../../entities";
|
|
1
|
+
import { BillingActionsEnum, BillingStatusEnum, IBillingEntity, IProjectEntity, IUserEntity } from "../../entities";
|
|
2
2
|
import { IBillingReimbursementExpenseApiEntity } from "./billing-reimbursement-expense.api";
|
|
3
3
|
import { IBillingApiEntity } from "./billing.entity.api";
|
|
4
4
|
import { IBillingTimesheetApiEntity } from "./billing.timesheet.entity.api";
|
|
5
5
|
import { IUpdateBillingDto } from "./billing.update.dto.interface";
|
|
6
|
-
import { IProjectApiEntity } from "./project.entity.response";
|
|
7
6
|
export type IBillingEntityResponse = {
|
|
8
7
|
billing: IBillingApiEntity;
|
|
9
8
|
billingTimesheets?: IBillingTimesheetApiEntity[];
|
|
@@ -13,7 +12,7 @@ export interface IUserEntityRelation {
|
|
|
13
12
|
users?: IUserEntity[];
|
|
14
13
|
}
|
|
15
14
|
export interface IProjectEntityRelation {
|
|
16
|
-
projects?:
|
|
15
|
+
projects?: IProjectEntity[];
|
|
17
16
|
}
|
|
18
17
|
export interface IBillingRelatedEntities extends IUserEntityRelation, IProjectEntityRelation {
|
|
19
18
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type IProjectApiEntity = IApiEntity<IProjectEntity>;
|
|
3
|
-
export type IProjectApiEntityArray = IProjectApiEntity[];
|
|
1
|
+
import { IClientEntity, IDesignationEntity, IProjectCreateDtoExtra, IProjectEntity, IProjectUserDto, IRateEntity, IUserEntity } from "../../entities";
|
|
4
2
|
export interface IProjectUserDtoResponse extends IProjectUserDto {
|
|
5
3
|
updatedOn: string;
|
|
6
4
|
}
|
|
7
5
|
export interface IProjectEntityDependentResponse {
|
|
8
6
|
users: IProjectUserDtoResponse[];
|
|
9
7
|
}
|
|
10
|
-
export type IProjectApiEntityDependent =
|
|
8
|
+
export type IProjectApiEntityDependent = IProjectEntity & IProjectEntityDependentResponse & IProjectCreateDtoExtra;
|
|
11
9
|
export type IProjectEntityGet = {
|
|
12
10
|
projects: IProjectApiEntityDependent[];
|
|
13
11
|
users: {
|
|
@@ -2,11 +2,11 @@ import { CurrencyEnum, TimeUnitEnum } from "../../enums";
|
|
|
2
2
|
import { ProjectBillingTypeEnum, ProjectStatusEnum } from "../enums/project.entity.enum";
|
|
3
3
|
import { ProjectUserStatusEnum } from "../enums/project_user_status.enum";
|
|
4
4
|
import { UserRoleEnum } from "../enums/user.entity.enum";
|
|
5
|
-
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
6
5
|
import { IClientEntity } from "./client.entity.interface";
|
|
6
|
+
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
7
7
|
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
|
|
8
8
|
import { IUserEntity } from "./user.entity.interface";
|
|
9
|
-
export interface IProjectEntity extends
|
|
9
|
+
export interface IProjectEntity extends IEntityAuditColumn {
|
|
10
10
|
id: number;
|
|
11
11
|
name: string;
|
|
12
12
|
clientId: number;
|
|
@@ -57,7 +57,7 @@ export interface IProjectEntityUpdateDto extends Omit<IEntityUpdateDto<IProjectE
|
|
|
57
57
|
}
|
|
58
58
|
export interface IProjectEntityFilterDto extends IEntityFilterData<IProjectEntity> {
|
|
59
59
|
}
|
|
60
|
-
export interface IProjectUserMappingEntity extends
|
|
60
|
+
export interface IProjectUserMappingEntity extends IEntityAuditColumn {
|
|
61
61
|
id: number;
|
|
62
62
|
projectId: number;
|
|
63
63
|
userId: number;
|
|
@@ -50,11 +50,11 @@ function populateRelationsFor(entityIndexMap, enumEntities) {
|
|
|
50
50
|
function parseEntities(json, baseEntity, entityMap) {
|
|
51
51
|
var _a;
|
|
52
52
|
const entityFromJsonMappings = {
|
|
53
|
-
[entity_utils_interface_1.EntityEnum.PROJECT]: project_entity_model_1.ProjectEntityModel.
|
|
53
|
+
[entity_utils_interface_1.EntityEnum.PROJECT]: project_entity_model_1.ProjectEntityModel.fromEntity,
|
|
54
54
|
[entity_utils_interface_1.EntityEnum.CLIENT]: client_entity_model_1.ClientEntityModel.fromEntity,
|
|
55
55
|
[entity_utils_interface_1.EntityEnum.BILLING]: billing_entity_model_1.BillingEntityModel.fromApiEntity,
|
|
56
56
|
[entity_utils_interface_1.EntityEnum.USER]: user_entity_model_1.UserEntityModel.fromEntity,
|
|
57
|
-
[entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING]: project_user_mapping_entity_model_1.ProjectUserMappingEntityModel.
|
|
57
|
+
[entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING]: project_user_mapping_entity_model_1.ProjectUserMappingEntityModel.fromEntity,
|
|
58
58
|
[entity_utils_interface_1.EntityEnum.REIMBURSEMENT]: reimbursement_entity_model_1.ReimbursementEntityModel.fromApiEntity,
|
|
59
59
|
[entity_utils_interface_1.EntityEnum.REIMBURSEMENT_EXPENSE]: reimbursement_expense_entity_model_1.ReimbursementExpenseEntityModel.fromApiEntity,
|
|
60
60
|
[entity_utils_interface_1.EntityEnum.BILLING_REIMBURSEMENT_EXPENSE]: billing_reimbursement_expense_entity_model_1.BillingReimbursementExpneseEntityModel.fromApiEntity,
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { IProjectUserMappingApiEntity } from "../../api";
|
|
2
1
|
import { ProjectUserStatusEnum } from "../enums/project_user_status.enum";
|
|
3
|
-
import { EntityEnum, EnumEntityType
|
|
2
|
+
import { EntityEnum, EnumEntityType } from "../interface/entity.utils.interface";
|
|
4
3
|
import { IProjectUserMappingEntity } from "../interface/project.entity.interface";
|
|
5
4
|
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
6
5
|
import { BaseEntityModel } from "./base.entity.model";
|
|
7
6
|
import { ProjectEntityModel } from "./project.entity.model";
|
|
8
7
|
import { UserEntityModel } from "./user.entity.model";
|
|
9
|
-
export declare class ProjectUserMappingEntityModel extends BaseEntityModel<EntityEnum.PROJECT_USER_MAPPING> implements
|
|
8
|
+
export declare class ProjectUserMappingEntityModel extends BaseEntityModel<EntityEnum.PROJECT_USER_MAPPING> implements IProjectUserMappingEntity {
|
|
10
9
|
id: number;
|
|
11
10
|
projectId: number;
|
|
12
11
|
userId: number;
|
|
13
12
|
status: ProjectUserStatusEnum;
|
|
14
|
-
createdOn:
|
|
15
|
-
updatedOn:
|
|
13
|
+
createdOn: number;
|
|
14
|
+
updatedOn: number;
|
|
16
15
|
createdBy: number;
|
|
17
16
|
updatedBy: number;
|
|
18
17
|
user?: UserEntityModel;
|
|
19
18
|
project?: ProjectEntityModel;
|
|
20
|
-
static
|
|
19
|
+
static fromEntity(entity: IProjectUserMappingEntity): ProjectUserMappingEntityModel;
|
|
21
20
|
static relationConfigs: RelationConfigs<[
|
|
22
21
|
EntityEnum.USER,
|
|
23
22
|
EntityEnum.PROJECT
|
|
@@ -12,15 +12,15 @@ class ProjectUserMappingEntityModel extends base_entity_model_1.BaseEntityModel
|
|
|
12
12
|
this.projectId = 0;
|
|
13
13
|
this.userId = 0;
|
|
14
14
|
this.status = project_user_status_enum_1.ProjectUserStatusEnum.ACTIVE;
|
|
15
|
-
this.createdOn =
|
|
16
|
-
this.updatedOn =
|
|
15
|
+
this.createdOn = 0;
|
|
16
|
+
this.updatedOn = 0;
|
|
17
17
|
this.createdBy = 0;
|
|
18
18
|
this.updatedBy = 0;
|
|
19
19
|
}
|
|
20
|
-
static
|
|
21
|
-
const
|
|
22
|
-
Object.assign(
|
|
23
|
-
return
|
|
20
|
+
static fromEntity(entity) {
|
|
21
|
+
const result = new ProjectUserMappingEntityModel(entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING);
|
|
22
|
+
Object.assign(result, entity);
|
|
23
|
+
return result;
|
|
24
24
|
}
|
|
25
25
|
getRelationConfigs() {
|
|
26
26
|
return ProjectUserMappingEntityModel.relationConfigs;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { IProjectApiEntity } from "../../api";
|
|
2
1
|
import { CurrencyEnum } from "../../enums";
|
|
3
2
|
import { ProjectBillingTypeEnum, ProjectStatusEnum } from "../enums/project.entity.enum";
|
|
4
3
|
import { EntityEnum, EnumEntityType } from "../interface/entity.utils.interface";
|
|
5
|
-
import { IProjectUserDto } from "../interface/project.entity.interface";
|
|
4
|
+
import { IProjectEntity, IProjectUserDto } from "../interface/project.entity.interface";
|
|
6
5
|
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
7
6
|
import { BaseEntityModel } from "./base.entity.model";
|
|
8
7
|
import { ClientEntityModel } from "./client.entity.model";
|
|
9
8
|
import { ProjectUserMappingEntityModel } from "./project-user-mapping.entity.model";
|
|
10
9
|
import { UserEntityModel } from "./user.entity.model";
|
|
11
|
-
export declare class ProjectEntityModel extends BaseEntityModel<EntityEnum.PROJECT> implements
|
|
10
|
+
export declare class ProjectEntityModel extends BaseEntityModel<EntityEnum.PROJECT> implements IProjectEntity {
|
|
12
11
|
id: number;
|
|
13
12
|
name: string;
|
|
14
13
|
clientId: number;
|
|
@@ -23,14 +22,14 @@ export declare class ProjectEntityModel extends BaseEntityModel<EntityEnum.PROJE
|
|
|
23
22
|
actualEndDate?: string;
|
|
24
23
|
createdBy: number;
|
|
25
24
|
updatedBy: number;
|
|
26
|
-
createdOn:
|
|
27
|
-
updatedOn:
|
|
25
|
+
createdOn: number;
|
|
26
|
+
updatedOn: number;
|
|
28
27
|
users?: IProjectUserDto[];
|
|
29
28
|
billingOverdueDays?: number;
|
|
30
29
|
userMappings?: (UserEntityModel & ProjectUserMappingEntityModel)[];
|
|
31
30
|
projectUserMappings?: ProjectUserMappingEntityModel[];
|
|
32
31
|
client: ClientEntityModel;
|
|
33
|
-
static
|
|
32
|
+
static fromEntity(entity: IProjectEntity): ProjectEntityModel;
|
|
34
33
|
static relationConfigs: RelationConfigs<[
|
|
35
34
|
EntityEnum.PROJECT_USER_MAPPING,
|
|
36
35
|
EntityEnum.CLIENT
|
|
@@ -20,31 +20,31 @@ class ProjectEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
20
20
|
this.organizationId = 0;
|
|
21
21
|
this.createdBy = 0;
|
|
22
22
|
this.updatedBy = 0;
|
|
23
|
-
this.createdOn =
|
|
24
|
-
this.updatedOn =
|
|
23
|
+
this.createdOn = 0;
|
|
24
|
+
this.updatedOn = 0;
|
|
25
25
|
this.users = [];
|
|
26
26
|
this.client = {};
|
|
27
27
|
}
|
|
28
|
-
static
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return
|
|
28
|
+
static fromEntity(entity) {
|
|
29
|
+
const result = new ProjectEntityModel(entity_utils_interface_1.EntityEnum.PROJECT);
|
|
30
|
+
result.id = entity.id;
|
|
31
|
+
result.name = entity.name;
|
|
32
|
+
result.clientId = entity.clientId;
|
|
33
|
+
result.startDate = entity.startDate;
|
|
34
|
+
result.currency = entity.currency;
|
|
35
|
+
result.billingType = entity.billingType;
|
|
36
|
+
result.billingRate = entity.billingRate;
|
|
37
|
+
result.status = entity.status;
|
|
38
|
+
result.organizationId = entity.organizationId;
|
|
39
|
+
result.description = entity.description;
|
|
40
|
+
result.expectedEndDate = entity.expectedEndDate;
|
|
41
|
+
result.actualEndDate = entity.actualEndDate;
|
|
42
|
+
result.createdBy = entity.createdBy;
|
|
43
|
+
result.updatedBy = entity.updatedBy;
|
|
44
|
+
result.createdOn = entity.createdOn;
|
|
45
|
+
result.updatedOn = entity.updatedOn;
|
|
46
|
+
result.billingOverdueDays = entity.billingOverdueDays;
|
|
47
|
+
return result;
|
|
48
48
|
}
|
|
49
49
|
populateUsers(users, projectUserMapping) {
|
|
50
50
|
// const projectUserDto = projectUserMapping
|
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.24.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
|
+
}
|