law-common 10.18.1-beta.2 → 10.18.1-beta.4
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/entities/index.d.ts +15 -0
- package/dist/src/entities/index.js +15 -0
- package/dist/src/entities/model/base.entity.model.d.ts +13 -0
- package/dist/src/entities/model/base.entity.model.js +73 -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 +78 -0
- package/dist/src/entities/model/billing.entity.model.js +227 -0
- package/dist/src/entities/model/client.entity.model.d.ts +48 -0
- package/dist/src/entities/model/client.entity.model.js +49 -0
- package/dist/src/entities/model/configuration.model.d.ts +2 -0
- package/dist/src/entities/model/configuration.model.js +5 -0
- package/dist/src/entities/model/entity.model.interface.d.ts +25 -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/project-user-mapping.entity.model.d.ts +25 -0
- package/dist/src/entities/model/project-user-mapping.entity.model.js +48 -0
- package/dist/src/entities/model/project.entity.model.d.ts +39 -0
- package/dist/src/entities/model/project.entity.model.js +104 -0
- package/dist/src/entities/model/reimbursement-expense.entity.model.d.ts +27 -0
- package/dist/src/entities/model/reimbursement-expense.entity.model.js +42 -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 +14 -0
- package/dist/src/entities/model/task.entity.model.js +23 -0
- package/dist/src/entities/model/timesheet.entity.model.d.ts +18 -0
- package/dist/src/entities/model/timesheet.entity.model.js +25 -0
- package/dist/src/entities/model/user.entity.model.d.ts +43 -0
- package/dist/src/entities/model/user.entity.model.js +30 -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,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapToIndex = mapToIndex;
|
|
4
|
+
exports.getEntityIndexMap = getEntityIndexMap;
|
|
5
|
+
exports.populateRelationsFor = populateRelationsFor;
|
|
6
|
+
exports.parseEntities = parseEntities;
|
|
7
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
8
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
9
|
+
const billing_reimbursement_expense_entity_model_1 = require("./billing-reimbursement-expense.entity.model");
|
|
10
|
+
const billing_entity_model_1 = require("./billing.entity.model");
|
|
11
|
+
const client_entity_model_1 = require("./client.entity.model");
|
|
12
|
+
const project_user_mapping_entity_model_1 = require("./project-user-mapping.entity.model");
|
|
13
|
+
const project_entity_model_1 = require("./project.entity.model");
|
|
14
|
+
const reimbursement_expense_entity_model_1 = require("./reimbursement-expense.entity.model");
|
|
15
|
+
const reimbursement_entity_model_1 = require("./reimbursement.entity.model");
|
|
16
|
+
const user_entity_model_1 = require("./user.entity.model");
|
|
17
|
+
function mapToIndex(entityMap) {
|
|
18
|
+
return Object.keys(entityMap).reduce((acc, key) => {
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
acc[key] = entityMap[key].reduce((innerAcc, entity) => {
|
|
21
|
+
innerAcc[entity.id] = entity;
|
|
22
|
+
return innerAcc;
|
|
23
|
+
}, {});
|
|
24
|
+
return acc;
|
|
25
|
+
}, {});
|
|
26
|
+
}
|
|
27
|
+
function getEntityIndexMap(data, baseEntity, reusedConfig) {
|
|
28
|
+
const entityMap = {};
|
|
29
|
+
parseEntities(data, baseEntity, entityMap);
|
|
30
|
+
const entityIndexMap = mapToIndex(entityMap);
|
|
31
|
+
if (reusedConfig) {
|
|
32
|
+
for (const entity of reusedConfig.enumEntities) {
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
entityIndexMap[entity] = reusedConfig.existingEntityIndexMap[entity];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return entityIndexMap;
|
|
38
|
+
}
|
|
39
|
+
function populateRelationsFor(entityIndexMap, enumEntities) {
|
|
40
|
+
enumEntities.forEach((entity) => {
|
|
41
|
+
base_entity_model_1.BaseEntityModel.populateRelationsForEntities(entityIndexMap, entity);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function parseEntities(json, baseEntity, entityMap) {
|
|
45
|
+
var _a;
|
|
46
|
+
const entityFromJsonMappings = {
|
|
47
|
+
[entity_utils_interface_1.EntityEnum.PROJECT]: project_entity_model_1.ProjectEntity.fromApiEntity,
|
|
48
|
+
[entity_utils_interface_1.EntityEnum.CLIENT]: client_entity_model_1.ClientEntity.fromApiEntity,
|
|
49
|
+
[entity_utils_interface_1.EntityEnum.BILLING]: billing_entity_model_1.BillingEntityModel.fromApiEntity,
|
|
50
|
+
[entity_utils_interface_1.EntityEnum.USER]: user_entity_model_1.UserEntity.fromApiEntity,
|
|
51
|
+
[entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING]: project_user_mapping_entity_model_1.ProjectUserMappingEntity.fromApiEntity,
|
|
52
|
+
[entity_utils_interface_1.EntityEnum.REIMBURSEMENT]: reimbursement_entity_model_1.ReimbursementEntity.fromApiEntity,
|
|
53
|
+
[entity_utils_interface_1.EntityEnum.REIMBURSEMENT_EXPENSE]: reimbursement_expense_entity_model_1.ReimbursementExpenseEntity.fromApiEntity,
|
|
54
|
+
[entity_utils_interface_1.EntityEnum.BILLING_REIMBURSEMENT_EXPENSE]: billing_reimbursement_expense_entity_model_1.BillingReimbursementExpneseEntity.fromApiEntity,
|
|
55
|
+
};
|
|
56
|
+
if (!(baseEntity in entityFromJsonMappings)) {
|
|
57
|
+
throw new Error(`Unknown entity: ${baseEntity}`);
|
|
58
|
+
}
|
|
59
|
+
entityMap[baseEntity] = ((_a = json["baseEntities"]) !== null && _a !== void 0 ? _a : []).map((e) => entityFromJsonMappings[baseEntity](e));
|
|
60
|
+
if (json["relatedEntities"]) {
|
|
61
|
+
const relatedEntities = json["relatedEntities"];
|
|
62
|
+
for (const entityName in relatedEntities) {
|
|
63
|
+
parseEntities(
|
|
64
|
+
// @ts-ignore
|
|
65
|
+
relatedEntities[entityName], entityName, entityMap);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return entityMap;
|
|
69
|
+
}
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { IAuditColumnEntity } from "../interface/audit-column.entity.interface";
|
|
3
|
-
import { IHolidayEntity } from "../interface/holiday.entity.interface";
|
|
4
|
-
export declare class BaseEntityModel<T extends IAuditColumnEntity> {
|
|
5
|
-
createdOn: Date;
|
|
6
|
-
updatedOn: Date;
|
|
7
|
-
createdBy: number;
|
|
8
|
-
updatedBy: number;
|
|
9
|
-
constructor(data: T);
|
|
10
|
-
}
|
|
11
|
-
export declare class HolidayEntityModel extends BaseEntityModel<IHolidayEntity> implements IHolidayEntity {
|
|
12
|
-
id: number;
|
|
13
|
-
holidayListId: number;
|
|
14
|
-
dateCode: string;
|
|
15
|
-
private constructor();
|
|
16
|
-
getDateCodeModel(): DateCodeModel;
|
|
17
|
-
static fromEntity(data: IHolidayEntity): HolidayEntityModel;
|
|
18
|
-
static getDateCodeModelFromDate(models: HolidayEntityModel[]): DateCodeModel[];
|
|
19
|
-
}
|
|
1
|
+
export declare const toBeDeleted = "holiday";
|
|
@@ -1,31 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// import { DateCodeModel } from "../../utils";
|
|
3
|
+
// import { IAuditColumnEntity } from "../interface/audit-column.entity.interface";
|
|
4
|
+
// import { IHolidayEntity } from "../interface/holiday.entity.interface";
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
6
|
+
exports.toBeDeleted = void 0;
|
|
7
|
+
// export class BaseEntityModelV1<T extends IAuditColumnEntity> {
|
|
8
|
+
// createdOn: Date;
|
|
9
|
+
// updatedOn: Date;
|
|
10
|
+
// createdBy: number;
|
|
11
|
+
// updatedBy: number;
|
|
12
|
+
// constructor(data: T) {
|
|
13
|
+
// this.createdOn = data.createdOn;
|
|
14
|
+
// this.updatedOn = data.updatedOn;
|
|
15
|
+
// this.createdBy = data.createdBy;
|
|
16
|
+
// this.updatedBy = data.updatedBy;
|
|
17
|
+
// }
|
|
18
|
+
// }
|
|
19
|
+
// export class HolidayEntityModel
|
|
20
|
+
// extends BaseEntityModelV1<IHolidayEntity>
|
|
21
|
+
// implements IHolidayEntity
|
|
22
|
+
// {
|
|
23
|
+
// id: number;
|
|
24
|
+
// holidayListId: number;
|
|
25
|
+
// dateCode: string;
|
|
26
|
+
// private constructor(data: IHolidayEntity) {
|
|
27
|
+
// super(data);
|
|
28
|
+
// this.id = data.id;
|
|
29
|
+
// this.holidayListId = data.holidayListId;
|
|
30
|
+
// this.dateCode = data.dateCode;
|
|
31
|
+
// }
|
|
32
|
+
// getDateCodeModel(): DateCodeModel {
|
|
33
|
+
// return new DateCodeModel(this.dateCode);
|
|
34
|
+
// }
|
|
35
|
+
// static fromEntity(data: IHolidayEntity): HolidayEntityModel {
|
|
36
|
+
// return new HolidayEntityModel(data);
|
|
37
|
+
// }
|
|
38
|
+
// static getDateCodeModelFromDate(
|
|
39
|
+
// models: HolidayEntityModel[]
|
|
40
|
+
// ): DateCodeModel[] {
|
|
41
|
+
// return models.map((model) => model.getDateCodeModel());
|
|
42
|
+
// }
|
|
43
|
+
// }
|
|
44
|
+
exports.toBeDeleted = "holiday";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ProjectUserStatusEnum } from "../enums/project_user_status.enum";
|
|
2
|
+
import { EntityEnum, EnumEntityType, IEntityApiResponse } from "../interface/entity.utils.interface";
|
|
3
|
+
import { IProjectUserMappingEntity } from "../interface/project.entity.interface";
|
|
4
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
5
|
+
import { RelationConfigs } from "./client.entity.model";
|
|
6
|
+
import { ProjectEntity } from "./project.entity.model";
|
|
7
|
+
import { UserEntity } from "./user.entity.model";
|
|
8
|
+
export declare class ProjectUserMappingEntity extends BaseEntityModel<EntityEnum.PROJECT_USER_MAPPING> implements IEntityApiResponse<IProjectUserMappingEntity> {
|
|
9
|
+
id: number;
|
|
10
|
+
projectId: number;
|
|
11
|
+
userId: number;
|
|
12
|
+
status: ProjectUserStatusEnum;
|
|
13
|
+
createdOn: string;
|
|
14
|
+
updatedOn: string;
|
|
15
|
+
createdBy: number;
|
|
16
|
+
updatedBy: number;
|
|
17
|
+
user?: UserEntity;
|
|
18
|
+
project?: ProjectEntity;
|
|
19
|
+
static fromApiEntity(apiEntity: IEntityApiResponse<IProjectUserMappingEntity>): ProjectUserMappingEntity;
|
|
20
|
+
static relationConfigs: RelationConfigs<[
|
|
21
|
+
EntityEnum.USER,
|
|
22
|
+
EntityEnum.PROJECT
|
|
23
|
+
], EnumEntityType<EntityEnum.PROJECT_USER_MAPPING>>;
|
|
24
|
+
getRelationConfigs(): [import("./client.entity.model").IRelationConfig<EntityEnum.USER, EnumEntityType<EntityEnum.PROJECT_USER_MAPPING>>, import("./client.entity.model").IRelationConfig<EntityEnum.PROJECT, EnumEntityType<EntityEnum.PROJECT_USER_MAPPING>>];
|
|
25
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectUserMappingEntity = void 0;
|
|
4
|
+
const project_user_status_enum_1 = require("../enums/project_user_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 ProjectUserMappingEntity extends base_entity_model_1.BaseEntityModel {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.id = 0;
|
|
11
|
+
this.projectId = 0;
|
|
12
|
+
this.userId = 0;
|
|
13
|
+
this.status = project_user_status_enum_1.ProjectUserStatusEnum.ACTIVE;
|
|
14
|
+
this.createdOn = "";
|
|
15
|
+
this.updatedOn = "";
|
|
16
|
+
this.createdBy = 0;
|
|
17
|
+
this.updatedBy = 0;
|
|
18
|
+
}
|
|
19
|
+
static fromApiEntity(apiEntity) {
|
|
20
|
+
const entity = new ProjectUserMappingEntity(entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING);
|
|
21
|
+
Object.assign(entity, apiEntity);
|
|
22
|
+
return entity;
|
|
23
|
+
}
|
|
24
|
+
getRelationConfigs() {
|
|
25
|
+
return ProjectUserMappingEntity.relationConfigs;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.ProjectUserMappingEntity = ProjectUserMappingEntity;
|
|
29
|
+
ProjectUserMappingEntity.relationConfigs = [
|
|
30
|
+
{
|
|
31
|
+
name: entity_utils_interface_1.EntityEnum.USER,
|
|
32
|
+
relation: base_entity_model_1.RelationType.ONE,
|
|
33
|
+
key: "user",
|
|
34
|
+
mapKeyConfig: {
|
|
35
|
+
relationKey: "id",
|
|
36
|
+
key: "userId",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: entity_utils_interface_1.EntityEnum.PROJECT,
|
|
41
|
+
relation: base_entity_model_1.RelationType.ONE,
|
|
42
|
+
key: "project",
|
|
43
|
+
mapKeyConfig: {
|
|
44
|
+
relationKey: "id",
|
|
45
|
+
key: "projectId",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { IProjectApiEntity } from "../../api";
|
|
2
|
+
import { CurrencyEnum } from "../../enums";
|
|
3
|
+
import { ProjectBillingTypeEnum, ProjectStatusEnum } from "../enums/project.entity.enum";
|
|
4
|
+
import { EntityEnum, EnumEntityType } from "../interface/entity.utils.interface";
|
|
5
|
+
import { IProjectUserDto } from "../interface/project.entity.interface";
|
|
6
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
7
|
+
import { ClientEntity, RelationConfigs } from "./client.entity.model";
|
|
8
|
+
import { ProjectUserMappingEntity } from "./project-user-mapping.entity.model";
|
|
9
|
+
import { UserEntity } from "./user.entity.model";
|
|
10
|
+
export declare class ProjectEntity extends BaseEntityModel<EntityEnum.PROJECT> implements IProjectApiEntity {
|
|
11
|
+
id: number;
|
|
12
|
+
name: string;
|
|
13
|
+
clientId: number;
|
|
14
|
+
startDate: string;
|
|
15
|
+
currency: CurrencyEnum;
|
|
16
|
+
billingType: ProjectBillingTypeEnum;
|
|
17
|
+
billingRate: string;
|
|
18
|
+
status: ProjectStatusEnum;
|
|
19
|
+
organizationId: number;
|
|
20
|
+
description?: string;
|
|
21
|
+
expectedEndDate?: string;
|
|
22
|
+
actualEndDate?: string;
|
|
23
|
+
createdBy: number;
|
|
24
|
+
updatedBy: number;
|
|
25
|
+
createdOn: string;
|
|
26
|
+
updatedOn: string;
|
|
27
|
+
users?: IProjectUserDto[];
|
|
28
|
+
billingOverdueDays?: number;
|
|
29
|
+
userMappings?: (UserEntity & ProjectUserMappingEntity)[];
|
|
30
|
+
projectUserMappings?: ProjectUserMappingEntity[];
|
|
31
|
+
client: ClientEntity;
|
|
32
|
+
static fromApiEntity(apiEntity: IProjectApiEntity): ProjectEntity;
|
|
33
|
+
static relationConfigs: RelationConfigs<[
|
|
34
|
+
EntityEnum.PROJECT_USER_MAPPING,
|
|
35
|
+
EntityEnum.CLIENT
|
|
36
|
+
], EnumEntityType<EntityEnum.PROJECT>>;
|
|
37
|
+
populateUsers(users: UserEntity[], projectUserMapping: ProjectUserMappingEntity[]): void;
|
|
38
|
+
getRelationConfigs(): [import("./client.entity.model").IRelationConfig<EntityEnum.PROJECT_USER_MAPPING, EnumEntityType<EntityEnum.PROJECT>>, import("./client.entity.model").IRelationConfig<EntityEnum.CLIENT, EnumEntityType<EntityEnum.PROJECT>>];
|
|
39
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectEntity = void 0;
|
|
4
|
+
const enums_1 = require("../../enums");
|
|
5
|
+
const project_entity_enum_1 = require("../enums/project.entity.enum");
|
|
6
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
7
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
8
|
+
class ProjectEntity extends base_entity_model_1.BaseEntityModel {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.id = 0;
|
|
12
|
+
this.name = "";
|
|
13
|
+
this.clientId = 0;
|
|
14
|
+
this.startDate = "";
|
|
15
|
+
this.currency = enums_1.CurrencyEnum.INR;
|
|
16
|
+
this.billingType = project_entity_enum_1.ProjectBillingTypeEnum.HOURLY;
|
|
17
|
+
this.billingRate = "";
|
|
18
|
+
this.status = project_entity_enum_1.ProjectStatusEnum.ACTIVE;
|
|
19
|
+
this.organizationId = 0;
|
|
20
|
+
this.createdBy = 0;
|
|
21
|
+
this.updatedBy = 0;
|
|
22
|
+
this.createdOn = "";
|
|
23
|
+
this.updatedOn = "";
|
|
24
|
+
this.users = [];
|
|
25
|
+
this.client = {};
|
|
26
|
+
}
|
|
27
|
+
static fromApiEntity(apiEntity) {
|
|
28
|
+
const entity = new ProjectEntity(entity_utils_interface_1.EntityEnum.PROJECT);
|
|
29
|
+
entity.id = apiEntity.id;
|
|
30
|
+
entity.name = apiEntity.name;
|
|
31
|
+
entity.clientId = apiEntity.clientId;
|
|
32
|
+
entity.startDate = apiEntity.startDate;
|
|
33
|
+
entity.currency = apiEntity.currency;
|
|
34
|
+
entity.billingType = apiEntity.billingType;
|
|
35
|
+
entity.billingRate = apiEntity.billingRate;
|
|
36
|
+
entity.status = apiEntity.status;
|
|
37
|
+
entity.organizationId = apiEntity.organizationId;
|
|
38
|
+
entity.description = apiEntity.description;
|
|
39
|
+
entity.expectedEndDate = apiEntity.expectedEndDate;
|
|
40
|
+
entity.actualEndDate = apiEntity.actualEndDate;
|
|
41
|
+
entity.createdBy = apiEntity.createdBy;
|
|
42
|
+
entity.updatedBy = apiEntity.updatedBy;
|
|
43
|
+
entity.createdOn = apiEntity.createdOn;
|
|
44
|
+
entity.updatedOn = apiEntity.updatedOn;
|
|
45
|
+
entity.billingOverdueDays = apiEntity.billingOverdueDays;
|
|
46
|
+
return entity;
|
|
47
|
+
}
|
|
48
|
+
populateUsers(users, projectUserMapping) {
|
|
49
|
+
// const projectUserDto = projectUserMapping
|
|
50
|
+
// .filter((mapping) => mapping.projectId === this.id)
|
|
51
|
+
// .map((mapping) => {
|
|
52
|
+
// const user = users.find((u) => u.id === mapping.userId);
|
|
53
|
+
// if (user) {
|
|
54
|
+
// return {
|
|
55
|
+
// id: user.id,
|
|
56
|
+
// role: user.role,
|
|
57
|
+
// projectUserStatus: mapping.status,
|
|
58
|
+
// };
|
|
59
|
+
// } else {
|
|
60
|
+
// continue;
|
|
61
|
+
// }
|
|
62
|
+
// });
|
|
63
|
+
// this.users = projectUserDto;
|
|
64
|
+
const projectUserDto = projectUserMapping
|
|
65
|
+
.filter((mapping) => mapping.projectId === this.id)
|
|
66
|
+
.flatMap((mapping) => {
|
|
67
|
+
const user = users.find((u) => u.id === mapping.userId);
|
|
68
|
+
return user
|
|
69
|
+
? [
|
|
70
|
+
{
|
|
71
|
+
id: user.id,
|
|
72
|
+
role: user.role,
|
|
73
|
+
projectUserStatus: mapping.status,
|
|
74
|
+
},
|
|
75
|
+
]
|
|
76
|
+
: [];
|
|
77
|
+
});
|
|
78
|
+
this.users = projectUserDto;
|
|
79
|
+
}
|
|
80
|
+
getRelationConfigs() {
|
|
81
|
+
return ProjectEntity.relationConfigs;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.ProjectEntity = ProjectEntity;
|
|
85
|
+
ProjectEntity.relationConfigs = [
|
|
86
|
+
{
|
|
87
|
+
name: entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING,
|
|
88
|
+
relation: base_entity_model_1.RelationType.MANY,
|
|
89
|
+
key: "projectUserMappings",
|
|
90
|
+
mapKeyConfig: {
|
|
91
|
+
relationKey: "projectId",
|
|
92
|
+
key: "id",
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: entity_utils_interface_1.EntityEnum.CLIENT,
|
|
97
|
+
relation: base_entity_model_1.RelationType.ONE,
|
|
98
|
+
key: "client",
|
|
99
|
+
mapKeyConfig: {
|
|
100
|
+
relationKey: "id",
|
|
101
|
+
key: "clientId",
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReimbursementEntity } from "./reimbursement.entity.model";
|
|
2
|
+
import { RelationConfigs } from "./client.entity.model";
|
|
3
|
+
import { EntityEnum, EnumEntityType } from "../interface/entity.utils.interface";
|
|
4
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
5
|
+
import { ReimbursementExpenseState } from "../enums/reimbursement.entity.enum";
|
|
6
|
+
import { IReimbursementExpenseApiEntity } from "../../api";
|
|
7
|
+
export declare class ReimbursementExpenseEntity 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?: ReimbursementEntity;
|
|
22
|
+
static fromApiEntity(apiEntity: IReimbursementExpenseApiEntity): ReimbursementExpenseEntity;
|
|
23
|
+
static relationConfigs: RelationConfigs<[
|
|
24
|
+
EntityEnum.REIMBURSEMENT
|
|
25
|
+
], EnumEntityType<EntityEnum.REIMBURSEMENT_EXPENSE>>;
|
|
26
|
+
getRelationConfigs(): any;
|
|
27
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReimbursementExpenseEntity = void 0;
|
|
4
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
5
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
6
|
+
const reimbursement_entity_enum_1 = require("../enums/reimbursement.entity.enum");
|
|
7
|
+
class ReimbursementExpenseEntity extends base_entity_model_1.BaseEntityModel {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.id = 0;
|
|
11
|
+
this.reimbursementId = 0;
|
|
12
|
+
this.userId = 0;
|
|
13
|
+
this.projectId = 0;
|
|
14
|
+
this.expenseType = "";
|
|
15
|
+
this.amount = 0;
|
|
16
|
+
this.state = reimbursement_entity_enum_1.ReimbursementExpenseState.PENDING;
|
|
17
|
+
this.createdBy = 0;
|
|
18
|
+
this.updatedBy = 0;
|
|
19
|
+
this.createdOn = "";
|
|
20
|
+
this.updatedOn = "";
|
|
21
|
+
}
|
|
22
|
+
static fromApiEntity(apiEntity) {
|
|
23
|
+
const entity = new ReimbursementExpenseEntity(entity_utils_interface_1.EntityEnum.REIMBURSEMENT_EXPENSE);
|
|
24
|
+
Object.assign(entity, apiEntity);
|
|
25
|
+
return entity;
|
|
26
|
+
}
|
|
27
|
+
getRelationConfigs() {
|
|
28
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.ReimbursementExpenseEntity = ReimbursementExpenseEntity;
|
|
32
|
+
ReimbursementExpenseEntity.relationConfigs = [
|
|
33
|
+
{
|
|
34
|
+
name: entity_utils_interface_1.EntityEnum.REIMBURSEMENT,
|
|
35
|
+
key: "reimbursement",
|
|
36
|
+
relation: base_entity_model_1.RelationType.ONE,
|
|
37
|
+
mapKeyConfig: {
|
|
38
|
+
relationKey: "id",
|
|
39
|
+
key: "reimbursementId",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
];
|
|
@@ -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 ReimbursementEntity 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): ReimbursementEntity;
|
|
32
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReimbursementEntity = 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 ReimbursementEntity 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 ReimbursementEntity(entity_utils_interface_1.EntityEnum.REIMBURSEMENT);
|
|
29
|
+
Object.assign(entity, apiEntity);
|
|
30
|
+
return entity;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.ReimbursementEntity = ReimbursementEntity;
|
|
34
|
+
ReimbursementEntity.relationConfigs = [];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ITaskApiEntity } from "../../api";
|
|
2
|
+
import { TaskStatusEnum, TaskTypeEnum } from "../enums/task.entity.enum";
|
|
3
|
+
export declare class TaskEntity implements ITaskApiEntity {
|
|
4
|
+
id: number;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
status: TaskStatusEnum;
|
|
8
|
+
type: TaskTypeEnum;
|
|
9
|
+
createdBy: number;
|
|
10
|
+
updatedBy: number;
|
|
11
|
+
createdOn: string;
|
|
12
|
+
updatedOn: string;
|
|
13
|
+
static fromApiEntity(apiEntity: ITaskApiEntity): TaskEntity;
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskEntity = void 0;
|
|
4
|
+
const task_entity_enum_1 = require("../enums/task.entity.enum");
|
|
5
|
+
class TaskEntity {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.id = 0;
|
|
8
|
+
this.name = "";
|
|
9
|
+
this.description = "";
|
|
10
|
+
this.status = task_entity_enum_1.TaskStatusEnum.active;
|
|
11
|
+
this.type = task_entity_enum_1.TaskTypeEnum.billable;
|
|
12
|
+
this.createdBy = 0;
|
|
13
|
+
this.updatedBy = 0;
|
|
14
|
+
this.createdOn = "";
|
|
15
|
+
this.updatedOn = "";
|
|
16
|
+
}
|
|
17
|
+
static fromApiEntity(apiEntity) {
|
|
18
|
+
const entity = new TaskEntity();
|
|
19
|
+
Object.assign(entity, apiEntity);
|
|
20
|
+
return entity;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.TaskEntity = TaskEntity;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ITimesheetApiEntity } from "../../api";
|
|
2
|
+
import { TimesheetStatusEnum } from "../enums/timesheet.status.enum";
|
|
3
|
+
export declare class TimesheetEntity implements ITimesheetApiEntity {
|
|
4
|
+
id: number;
|
|
5
|
+
userId: number;
|
|
6
|
+
projectId: number;
|
|
7
|
+
task: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
dateCode: string;
|
|
10
|
+
totalDuration: number;
|
|
11
|
+
status: TimesheetStatusEnum;
|
|
12
|
+
remark?: string;
|
|
13
|
+
createdBy: number;
|
|
14
|
+
updatedBy: number;
|
|
15
|
+
createdOn: string;
|
|
16
|
+
updatedOn: string;
|
|
17
|
+
static fromApiEntity(apiEntity: ITimesheetApiEntity): TimesheetEntity;
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TimesheetEntity = void 0;
|
|
4
|
+
const timesheet_status_enum_1 = require("../enums/timesheet.status.enum");
|
|
5
|
+
class TimesheetEntity {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.id = 0;
|
|
8
|
+
this.userId = 0;
|
|
9
|
+
this.projectId = 0;
|
|
10
|
+
this.task = "";
|
|
11
|
+
this.dateCode = "";
|
|
12
|
+
this.totalDuration = 0;
|
|
13
|
+
this.status = timesheet_status_enum_1.TimesheetStatusEnum.CREATE_APPROVAL;
|
|
14
|
+
this.createdBy = 0;
|
|
15
|
+
this.updatedBy = 0;
|
|
16
|
+
this.createdOn = "";
|
|
17
|
+
this.updatedOn = "";
|
|
18
|
+
}
|
|
19
|
+
static fromApiEntity(apiEntity) {
|
|
20
|
+
const entity = new TimesheetEntity();
|
|
21
|
+
Object.assign(entity, apiEntity);
|
|
22
|
+
return entity;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.TimesheetEntity = TimesheetEntity;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { IUserApiEntity } from "../../api";
|
|
2
|
+
import { UserRoleEnum, UserStatusEnum } from "../enums/user.entity.enum";
|
|
3
|
+
export declare class UserEntity implements IUserApiEntity {
|
|
4
|
+
id: number;
|
|
5
|
+
name: string;
|
|
6
|
+
email: string;
|
|
7
|
+
contactNo: string;
|
|
8
|
+
secondaryContactNo?: string;
|
|
9
|
+
password?: string;
|
|
10
|
+
userCode?: string;
|
|
11
|
+
joiningDate?: string;
|
|
12
|
+
endDate?: string;
|
|
13
|
+
address?: string;
|
|
14
|
+
zipCode?: number;
|
|
15
|
+
country?: string;
|
|
16
|
+
designation: string;
|
|
17
|
+
panNo?: string;
|
|
18
|
+
panDocumentUrl?: string;
|
|
19
|
+
aadharNo?: string;
|
|
20
|
+
aadharDocumentUrl?: string;
|
|
21
|
+
role: UserRoleEnum;
|
|
22
|
+
status?: UserStatusEnum;
|
|
23
|
+
organizationId: number;
|
|
24
|
+
passportDocumentUrl?: string;
|
|
25
|
+
academicQualificationDocumentUrl?: string;
|
|
26
|
+
officeAllocation: number;
|
|
27
|
+
tempAddress?: string;
|
|
28
|
+
tempZipCode?: number;
|
|
29
|
+
tempCountry?: string;
|
|
30
|
+
tempAddressSameAsPrimary: boolean;
|
|
31
|
+
emergencyContactName: string;
|
|
32
|
+
emergencyContactNo: string;
|
|
33
|
+
emergencyContactRelation: string;
|
|
34
|
+
secondEmergencyContactName?: string;
|
|
35
|
+
secondaryEmergencyContactNo?: string;
|
|
36
|
+
secondaryEmergencyContactRelation?: string;
|
|
37
|
+
permissions?: string[];
|
|
38
|
+
createdBy: number;
|
|
39
|
+
updatedBy: number;
|
|
40
|
+
createdOn: string;
|
|
41
|
+
updatedOn: string;
|
|
42
|
+
static fromApiEntity(apiEntity: IUserApiEntity): UserEntity;
|
|
43
|
+
}
|