law-common 10.18.1-beta.1 → 10.18.1-beta.11
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 +1 -0
- package/dist/src/api/index.js +1 -0
- package/dist/src/api/interface/project-user-mapping.entity.api.d.ts +3 -0
- package/dist/src/api/interface/project-user-mapping.entity.api.js +2 -0
- package/dist/src/entities/enums/relation-type.enum.d.ts +4 -0
- package/dist/src/entities/enums/relation-type.enum.js +8 -0
- package/dist/src/entities/index.d.ts +16 -0
- package/dist/src/entities/index.js +16 -0
- package/dist/src/entities/interface/entity.utils.interface.d.ts +17 -0
- package/dist/src/entities/interface/relation-config.interface.d.ts +16 -0
- package/dist/src/entities/interface/relation-config.interface.js +2 -0
- package/dist/src/entities/model/bank.entity.model.d.ts +5 -2
- package/dist/src/entities/model/bank.entity.model.js +12 -6
- package/dist/src/entities/model/base.entity.model.d.ts +8 -0
- package/dist/src/entities/model/base.entity.model.js +69 -0
- package/dist/src/entities/model/billing-reimbursement-expense.entity.model.d.ts +25 -0
- package/dist/src/entities/model/billing-reimbursement-expense.entity.model.js +35 -0
- package/dist/src/entities/model/billing.entity.model.d.ts +79 -0
- package/dist/src/entities/model/billing.entity.model.js +228 -0
- package/dist/src/entities/model/client.entity.model.d.ts +35 -0
- package/dist/src/entities/model/client.entity.model.js +50 -0
- package/dist/src/entities/model/configuration.model.d.ts +8 -9
- package/dist/src/entities/model/configuration.model.js +10 -5
- package/dist/src/entities/model/designation.entity.model.d.ts +8 -5
- package/dist/src/entities/model/designation.entity.model.js +28 -9
- package/dist/src/entities/model/entity.model.interface.d.ts +8 -0
- package/dist/src/entities/model/entity.model.interface.js +69 -0
- package/dist/src/entities/model/holiday.entity.model.d.ts +1 -19
- package/dist/src/entities/model/holiday.entity.model.js +42 -29
- package/dist/src/entities/model/leave.entity.model.d.ts +5 -5
- package/dist/src/entities/model/leave.entity.model.js +4 -1
- package/dist/src/entities/model/project-user-mapping.entity.model.d.ts +26 -0
- package/dist/src/entities/model/project-user-mapping.entity.model.js +49 -0
- package/dist/src/entities/model/project.entity.model.d.ts +40 -0
- package/dist/src/entities/model/project.entity.model.js +105 -0
- package/dist/src/entities/model/reimbursement-expense.entity.model.d.ts +27 -0
- package/dist/src/entities/model/reimbursement-expense.entity.model.js +43 -0
- package/dist/src/entities/model/reimbursement.entity.model.d.ts +32 -0
- package/dist/src/entities/model/reimbursement.entity.model.js +34 -0
- package/dist/src/entities/model/task.entity.model.d.ts +17 -0
- package/dist/src/entities/model/task.entity.model.js +29 -0
- package/dist/src/entities/model/timesheet.entity.model.d.ts +21 -0
- package/dist/src/entities/model/timesheet.entity.model.js +31 -0
- package/dist/src/entities/model/user.entity.model.d.ts +46 -0
- package/dist/src/entities/model/user.entity.model.js +36 -0
- package/dist/src/model/entities/timesheet.model.d.ts +2 -0
- package/dist/src/model/entities/timesheet.model.js +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectEntityModel = void 0;
|
|
4
|
+
const enums_1 = require("../../enums");
|
|
5
|
+
const project_entity_enum_1 = require("../enums/project.entity.enum");
|
|
6
|
+
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
7
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
8
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
9
|
+
class ProjectEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.id = 0;
|
|
13
|
+
this.name = "";
|
|
14
|
+
this.clientId = 0;
|
|
15
|
+
this.startDate = "";
|
|
16
|
+
this.currency = enums_1.CurrencyEnum.INR;
|
|
17
|
+
this.billingType = project_entity_enum_1.ProjectBillingTypeEnum.HOURLY;
|
|
18
|
+
this.billingRate = "";
|
|
19
|
+
this.status = project_entity_enum_1.ProjectStatusEnum.ACTIVE;
|
|
20
|
+
this.organizationId = 0;
|
|
21
|
+
this.createdBy = 0;
|
|
22
|
+
this.updatedBy = 0;
|
|
23
|
+
this.createdOn = "";
|
|
24
|
+
this.updatedOn = "";
|
|
25
|
+
this.users = [];
|
|
26
|
+
this.client = {};
|
|
27
|
+
}
|
|
28
|
+
static fromApiEntity(apiEntity) {
|
|
29
|
+
const entity = new ProjectEntityModel(entity_utils_interface_1.EntityEnum.PROJECT);
|
|
30
|
+
entity.id = apiEntity.id;
|
|
31
|
+
entity.name = apiEntity.name;
|
|
32
|
+
entity.clientId = apiEntity.clientId;
|
|
33
|
+
entity.startDate = apiEntity.startDate;
|
|
34
|
+
entity.currency = apiEntity.currency;
|
|
35
|
+
entity.billingType = apiEntity.billingType;
|
|
36
|
+
entity.billingRate = apiEntity.billingRate;
|
|
37
|
+
entity.status = apiEntity.status;
|
|
38
|
+
entity.organizationId = apiEntity.organizationId;
|
|
39
|
+
entity.description = apiEntity.description;
|
|
40
|
+
entity.expectedEndDate = apiEntity.expectedEndDate;
|
|
41
|
+
entity.actualEndDate = apiEntity.actualEndDate;
|
|
42
|
+
entity.createdBy = apiEntity.createdBy;
|
|
43
|
+
entity.updatedBy = apiEntity.updatedBy;
|
|
44
|
+
entity.createdOn = apiEntity.createdOn;
|
|
45
|
+
entity.updatedOn = apiEntity.updatedOn;
|
|
46
|
+
entity.billingOverdueDays = apiEntity.billingOverdueDays;
|
|
47
|
+
return entity;
|
|
48
|
+
}
|
|
49
|
+
populateUsers(users, projectUserMapping) {
|
|
50
|
+
// const projectUserDto = projectUserMapping
|
|
51
|
+
// .filter((mapping) => mapping.projectId === this.id)
|
|
52
|
+
// .map((mapping) => {
|
|
53
|
+
// const user = users.find((u) => u.id === mapping.userId);
|
|
54
|
+
// if (user) {
|
|
55
|
+
// return {
|
|
56
|
+
// id: user.id,
|
|
57
|
+
// role: user.role,
|
|
58
|
+
// projectUserStatus: mapping.status,
|
|
59
|
+
// };
|
|
60
|
+
// } else {
|
|
61
|
+
// continue;
|
|
62
|
+
// }
|
|
63
|
+
// });
|
|
64
|
+
// this.users = projectUserDto;
|
|
65
|
+
const projectUserDto = projectUserMapping
|
|
66
|
+
.filter((mapping) => mapping.projectId === this.id)
|
|
67
|
+
.flatMap((mapping) => {
|
|
68
|
+
const user = users.find((u) => u.id === mapping.userId);
|
|
69
|
+
return user
|
|
70
|
+
? [
|
|
71
|
+
{
|
|
72
|
+
id: user.id,
|
|
73
|
+
role: user.role,
|
|
74
|
+
projectUserStatus: mapping.status,
|
|
75
|
+
},
|
|
76
|
+
]
|
|
77
|
+
: [];
|
|
78
|
+
});
|
|
79
|
+
this.users = projectUserDto;
|
|
80
|
+
}
|
|
81
|
+
getRelationConfigs() {
|
|
82
|
+
return ProjectEntityModel.relationConfigs;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.ProjectEntityModel = ProjectEntityModel;
|
|
86
|
+
ProjectEntityModel.relationConfigs = [
|
|
87
|
+
{
|
|
88
|
+
name: entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING,
|
|
89
|
+
relation: relation_type_enum_1.RelationType.MANY,
|
|
90
|
+
key: "projectUserMappings",
|
|
91
|
+
mapKeyConfig: {
|
|
92
|
+
relationKey: "projectId",
|
|
93
|
+
key: "id",
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: entity_utils_interface_1.EntityEnum.CLIENT,
|
|
98
|
+
relation: relation_type_enum_1.RelationType.ONE,
|
|
99
|
+
key: "client",
|
|
100
|
+
mapKeyConfig: {
|
|
101
|
+
relationKey: "id",
|
|
102
|
+
key: "clientId",
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IReimbursementExpenseApiEntity } from "../../api";
|
|
2
|
+
import { ReimbursementExpenseState } from "../enums/reimbursement.entity.enum";
|
|
3
|
+
import { EntityEnum, EnumEntityType } from "../interface/entity.utils.interface";
|
|
4
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
5
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
6
|
+
import { ReimbursementEntityModel } from "./reimbursement.entity.model";
|
|
7
|
+
export declare class ReimbursementExpenseEntityModel extends BaseEntityModel<EntityEnum.REIMBURSEMENT_EXPENSE> implements IReimbursementExpenseApiEntity {
|
|
8
|
+
id: number;
|
|
9
|
+
reimbursementId: number;
|
|
10
|
+
userId: number;
|
|
11
|
+
projectId: number;
|
|
12
|
+
expenseType: string;
|
|
13
|
+
amount: number;
|
|
14
|
+
state: ReimbursementExpenseState;
|
|
15
|
+
remark?: string;
|
|
16
|
+
sanctionedBy?: number;
|
|
17
|
+
createdBy: number;
|
|
18
|
+
updatedBy: number;
|
|
19
|
+
createdOn: string;
|
|
20
|
+
updatedOn: string;
|
|
21
|
+
reimbursement?: ReimbursementEntityModel;
|
|
22
|
+
static fromApiEntity(apiEntity: IReimbursementExpenseApiEntity): ReimbursementExpenseEntityModel;
|
|
23
|
+
static relationConfigs: RelationConfigs<[
|
|
24
|
+
EntityEnum.REIMBURSEMENT
|
|
25
|
+
], EnumEntityType<EntityEnum.REIMBURSEMENT_EXPENSE>>;
|
|
26
|
+
getRelationConfigs(): any;
|
|
27
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReimbursementExpenseEntityModel = void 0;
|
|
4
|
+
const reimbursement_entity_enum_1 = require("../enums/reimbursement.entity.enum");
|
|
5
|
+
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
6
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
7
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
8
|
+
class ReimbursementExpenseEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.id = 0;
|
|
12
|
+
this.reimbursementId = 0;
|
|
13
|
+
this.userId = 0;
|
|
14
|
+
this.projectId = 0;
|
|
15
|
+
this.expenseType = "";
|
|
16
|
+
this.amount = 0;
|
|
17
|
+
this.state = reimbursement_entity_enum_1.ReimbursementExpenseState.PENDING;
|
|
18
|
+
this.createdBy = 0;
|
|
19
|
+
this.updatedBy = 0;
|
|
20
|
+
this.createdOn = "";
|
|
21
|
+
this.updatedOn = "";
|
|
22
|
+
}
|
|
23
|
+
static fromApiEntity(apiEntity) {
|
|
24
|
+
const entity = new ReimbursementExpenseEntityModel(entity_utils_interface_1.EntityEnum.REIMBURSEMENT_EXPENSE);
|
|
25
|
+
Object.assign(entity, apiEntity);
|
|
26
|
+
return entity;
|
|
27
|
+
}
|
|
28
|
+
getRelationConfigs() {
|
|
29
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.ReimbursementExpenseEntityModel = ReimbursementExpenseEntityModel;
|
|
33
|
+
ReimbursementExpenseEntityModel.relationConfigs = [
|
|
34
|
+
{
|
|
35
|
+
name: entity_utils_interface_1.EntityEnum.REIMBURSEMENT,
|
|
36
|
+
key: "reimbursement",
|
|
37
|
+
relation: relation_type_enum_1.RelationType.ONE,
|
|
38
|
+
mapKeyConfig: {
|
|
39
|
+
relationKey: "id",
|
|
40
|
+
key: "reimbursementId",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { IReimbursementApiEntity } from "../../api";
|
|
2
|
+
import { ReimbursementBillingPresentEnum, ReimbursementBillingTypeEnum, ReimbursementIncurredByEnum, ReimbursementPaymentStatusEnum, ReimbursementStatusEnum } from "../enums/reimbursement.entity.enum";
|
|
3
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
4
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
5
|
+
export declare class ReimbursementEntityModel extends BaseEntityModel<EntityEnum.REIMBURSEMENT> implements IReimbursementApiEntity {
|
|
6
|
+
id: number;
|
|
7
|
+
billingType: ReimbursementBillingTypeEnum;
|
|
8
|
+
billDate: string;
|
|
9
|
+
amount: number;
|
|
10
|
+
billNo?: string;
|
|
11
|
+
expenseIncurredBy: ReimbursementIncurredByEnum;
|
|
12
|
+
billPresent: ReimbursementBillingPresentEnum;
|
|
13
|
+
description: string;
|
|
14
|
+
attachmentUrlsCsv?: string;
|
|
15
|
+
status: ReimbursementStatusEnum;
|
|
16
|
+
paymentStatus: ReimbursementPaymentStatusEnum;
|
|
17
|
+
amountReimbursed?: number;
|
|
18
|
+
processedBy?: number;
|
|
19
|
+
processedDate?: string;
|
|
20
|
+
paymentDetails?: string;
|
|
21
|
+
remark?: string;
|
|
22
|
+
disbursementDate?: string;
|
|
23
|
+
referenceNo?: string;
|
|
24
|
+
bankId?: number;
|
|
25
|
+
createdBy: number;
|
|
26
|
+
updatedBy: number;
|
|
27
|
+
createdOn: string;
|
|
28
|
+
updatedOn: string;
|
|
29
|
+
static relationConfigs: never[];
|
|
30
|
+
getRelationConfigs(): any[];
|
|
31
|
+
static fromApiEntity(apiEntity: IReimbursementApiEntity): ReimbursementEntityModel;
|
|
32
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReimbursementEntityModel = void 0;
|
|
4
|
+
const reimbursement_entity_enum_1 = require("../enums/reimbursement.entity.enum");
|
|
5
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
6
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
7
|
+
class ReimbursementEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.id = 0;
|
|
11
|
+
this.billingType = reimbursement_entity_enum_1.ReimbursementBillingTypeEnum.BILLABLE;
|
|
12
|
+
this.billDate = "";
|
|
13
|
+
this.amount = 0;
|
|
14
|
+
this.expenseIncurredBy = reimbursement_entity_enum_1.ReimbursementIncurredByEnum.SELF;
|
|
15
|
+
this.billPresent = reimbursement_entity_enum_1.ReimbursementBillingPresentEnum.NO;
|
|
16
|
+
this.description = "";
|
|
17
|
+
this.status = reimbursement_entity_enum_1.ReimbursementStatusEnum.APPROVAL_PENDING;
|
|
18
|
+
this.paymentStatus = reimbursement_entity_enum_1.ReimbursementPaymentStatusEnum.UNPAID;
|
|
19
|
+
this.createdBy = 0;
|
|
20
|
+
this.updatedBy = 0;
|
|
21
|
+
this.createdOn = "";
|
|
22
|
+
this.updatedOn = "";
|
|
23
|
+
}
|
|
24
|
+
getRelationConfigs() {
|
|
25
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
26
|
+
}
|
|
27
|
+
static fromApiEntity(apiEntity) {
|
|
28
|
+
const entity = new ReimbursementEntityModel(entity_utils_interface_1.EntityEnum.REIMBURSEMENT);
|
|
29
|
+
Object.assign(entity, apiEntity);
|
|
30
|
+
return entity;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.ReimbursementEntityModel = ReimbursementEntityModel;
|
|
34
|
+
ReimbursementEntityModel.relationConfigs = [];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ITaskApiEntity } from "../../api";
|
|
2
|
+
import { TaskStatusEnum, TaskTypeEnum } from "../enums/task.entity.enum";
|
|
3
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
4
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
5
|
+
export declare class TaskEntityModel extends BaseEntityModel<EntityEnum.TASK> implements ITaskApiEntity {
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
status: TaskStatusEnum;
|
|
10
|
+
type: TaskTypeEnum;
|
|
11
|
+
createdBy: number;
|
|
12
|
+
updatedBy: number;
|
|
13
|
+
createdOn: string;
|
|
14
|
+
updatedOn: string;
|
|
15
|
+
static fromApiEntity(apiEntity: ITaskApiEntity): TaskEntityModel;
|
|
16
|
+
getRelationConfigs(): any[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskEntityModel = void 0;
|
|
4
|
+
const task_entity_enum_1 = require("../enums/task.entity.enum");
|
|
5
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
6
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
7
|
+
class TaskEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.id = 0;
|
|
11
|
+
this.name = "";
|
|
12
|
+
this.description = "";
|
|
13
|
+
this.status = task_entity_enum_1.TaskStatusEnum.active;
|
|
14
|
+
this.type = task_entity_enum_1.TaskTypeEnum.billable;
|
|
15
|
+
this.createdBy = 0;
|
|
16
|
+
this.updatedBy = 0;
|
|
17
|
+
this.createdOn = "";
|
|
18
|
+
this.updatedOn = "";
|
|
19
|
+
}
|
|
20
|
+
static fromApiEntity(apiEntity) {
|
|
21
|
+
const entity = new TaskEntityModel(entity_utils_interface_1.EntityEnum.TASK);
|
|
22
|
+
Object.assign(entity, apiEntity);
|
|
23
|
+
return entity;
|
|
24
|
+
}
|
|
25
|
+
getRelationConfigs() {
|
|
26
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.TaskEntityModel = TaskEntityModel;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ITimesheetApiEntity } from "../../api";
|
|
2
|
+
import { TimesheetStatusEnum } from "../enums/timesheet.status.enum";
|
|
3
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
4
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
5
|
+
export declare class TimesheetEntityModel extends BaseEntityModel<EntityEnum.TIMESHEET> implements ITimesheetApiEntity {
|
|
6
|
+
id: number;
|
|
7
|
+
userId: number;
|
|
8
|
+
projectId: number;
|
|
9
|
+
task: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
dateCode: string;
|
|
12
|
+
totalDuration: number;
|
|
13
|
+
status: TimesheetStatusEnum;
|
|
14
|
+
remark?: string;
|
|
15
|
+
createdBy: number;
|
|
16
|
+
updatedBy: number;
|
|
17
|
+
createdOn: string;
|
|
18
|
+
updatedOn: string;
|
|
19
|
+
static fromApiEntity(apiEntity: ITimesheetApiEntity): TimesheetEntityModel;
|
|
20
|
+
getRelationConfigs(): any[];
|
|
21
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TimesheetEntityModel = void 0;
|
|
4
|
+
const timesheet_status_enum_1 = require("../enums/timesheet.status.enum");
|
|
5
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
6
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
7
|
+
class TimesheetEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.id = 0;
|
|
11
|
+
this.userId = 0;
|
|
12
|
+
this.projectId = 0;
|
|
13
|
+
this.task = "";
|
|
14
|
+
this.dateCode = "";
|
|
15
|
+
this.totalDuration = 0;
|
|
16
|
+
this.status = timesheet_status_enum_1.TimesheetStatusEnum.CREATE_APPROVAL;
|
|
17
|
+
this.createdBy = 0;
|
|
18
|
+
this.updatedBy = 0;
|
|
19
|
+
this.createdOn = "";
|
|
20
|
+
this.updatedOn = "";
|
|
21
|
+
}
|
|
22
|
+
static fromApiEntity(apiEntity) {
|
|
23
|
+
const entity = new TimesheetEntityModel(entity_utils_interface_1.EntityEnum.TIMESHEET);
|
|
24
|
+
Object.assign(entity, apiEntity);
|
|
25
|
+
return entity;
|
|
26
|
+
}
|
|
27
|
+
getRelationConfigs() {
|
|
28
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.TimesheetEntityModel = TimesheetEntityModel;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { IUserApiEntity } from "../../api";
|
|
2
|
+
import { UserRoleEnum, UserStatusEnum } from "../enums/user.entity.enum";
|
|
3
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
4
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
5
|
+
export declare class UserEntityModel extends BaseEntityModel<EntityEnum.USER> implements IUserApiEntity {
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
email: string;
|
|
9
|
+
contactNo: string;
|
|
10
|
+
secondaryContactNo?: string;
|
|
11
|
+
password?: string;
|
|
12
|
+
userCode?: string;
|
|
13
|
+
joiningDate?: string;
|
|
14
|
+
endDate?: string;
|
|
15
|
+
address?: string;
|
|
16
|
+
zipCode?: number;
|
|
17
|
+
country?: string;
|
|
18
|
+
designation: string;
|
|
19
|
+
panNo?: string;
|
|
20
|
+
panDocumentUrl?: string;
|
|
21
|
+
aadharNo?: string;
|
|
22
|
+
aadharDocumentUrl?: string;
|
|
23
|
+
role: UserRoleEnum;
|
|
24
|
+
status?: UserStatusEnum;
|
|
25
|
+
organizationId: number;
|
|
26
|
+
passportDocumentUrl?: string;
|
|
27
|
+
academicQualificationDocumentUrl?: string;
|
|
28
|
+
officeAllocation: number;
|
|
29
|
+
tempAddress?: string;
|
|
30
|
+
tempZipCode?: number;
|
|
31
|
+
tempCountry?: string;
|
|
32
|
+
tempAddressSameAsPrimary: boolean;
|
|
33
|
+
emergencyContactName: string;
|
|
34
|
+
emergencyContactNo: string;
|
|
35
|
+
emergencyContactRelation: string;
|
|
36
|
+
secondEmergencyContactName?: string;
|
|
37
|
+
secondaryEmergencyContactNo?: string;
|
|
38
|
+
secondaryEmergencyContactRelation?: string;
|
|
39
|
+
permissions?: string[];
|
|
40
|
+
createdBy: number;
|
|
41
|
+
updatedBy: number;
|
|
42
|
+
createdOn: string;
|
|
43
|
+
updatedOn: string;
|
|
44
|
+
getRelationConfigs(): any[];
|
|
45
|
+
static fromApiEntity(apiEntity: IUserApiEntity): UserEntityModel;
|
|
46
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserEntityModel = void 0;
|
|
4
|
+
const user_entity_enum_1 = require("../enums/user.entity.enum");
|
|
5
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
6
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
7
|
+
class UserEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.id = 0;
|
|
11
|
+
this.name = "";
|
|
12
|
+
this.email = "";
|
|
13
|
+
this.contactNo = "";
|
|
14
|
+
this.designation = "";
|
|
15
|
+
this.role = user_entity_enum_1.UserRoleEnum.employee;
|
|
16
|
+
this.organizationId = 0;
|
|
17
|
+
this.officeAllocation = 0;
|
|
18
|
+
this.tempAddressSameAsPrimary = true;
|
|
19
|
+
this.emergencyContactName = "";
|
|
20
|
+
this.emergencyContactNo = "";
|
|
21
|
+
this.emergencyContactRelation = "";
|
|
22
|
+
this.createdBy = 0;
|
|
23
|
+
this.updatedBy = 0;
|
|
24
|
+
this.createdOn = "";
|
|
25
|
+
this.updatedOn = "";
|
|
26
|
+
}
|
|
27
|
+
getRelationConfigs() {
|
|
28
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
29
|
+
}
|
|
30
|
+
static fromApiEntity(apiEntity) {
|
|
31
|
+
const entity = new UserEntityModel(entity_utils_interface_1.EntityEnum.USER);
|
|
32
|
+
Object.assign(entity, apiEntity);
|
|
33
|
+
return entity;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.UserEntityModel = UserEntityModel;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ITimesheetApiEntity } from "../../api";
|
|
1
2
|
import { ITimesheetEntity, TimesheetStatusEnum } from "../../entities";
|
|
2
3
|
import { ITimesheetEntityModel } from "./interface/timesheet.model.interface";
|
|
3
4
|
export declare class TimesheetEntityModel implements ITimesheetEntityModel {
|
|
@@ -24,4 +25,5 @@ export declare class TimesheetEntityModel implements ITimesheetEntityModel {
|
|
|
24
25
|
* @returns
|
|
25
26
|
*/
|
|
26
27
|
static getTotalDuration(timesheets: ITimesheetEntityModel[]): number;
|
|
28
|
+
static fromApiEntity(apiEntity: ITimesheetApiEntity): TimesheetEntityModel;
|
|
27
29
|
}
|
|
@@ -34,5 +34,10 @@ class TimesheetEntityModel {
|
|
|
34
34
|
const totalDurationOfEachTimesheet = timesheets.map((timesheet) => timesheet.totalDuration);
|
|
35
35
|
return totalDurationOfEachTimesheet.reduce((sum, duration) => sum + duration, 0);
|
|
36
36
|
}
|
|
37
|
+
static fromApiEntity(apiEntity) {
|
|
38
|
+
const entity = new TimesheetEntityModel();
|
|
39
|
+
Object.assign(entity, apiEntity);
|
|
40
|
+
return entity;
|
|
41
|
+
}
|
|
37
42
|
}
|
|
38
43
|
exports.TimesheetEntityModel = TimesheetEntityModel;
|