law-common 10.18.1-beta.2 → 10.18.1-beta.21
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/billing.update.dto.interface.d.ts +5 -3
- 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 +17 -0
- package/dist/src/entities/index.js +17 -0
- package/dist/src/entities/interface/entity.utils.interface.d.ts +23 -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 +4 -1
- package/dist/src/entities/model/bank.entity.model.js +10 -4
- 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-timesheet.entity.model.d.ts +26 -0
- package/dist/src/entities/model/billing-timesheet.entity.model.js +36 -0
- package/dist/src/entities/model/billing.entity.model.d.ts +85 -0
- package/dist/src/entities/model/billing.entity.model.js +246 -0
- package/dist/src/entities/model/client-affiliate.entity.model.d.ts +19 -0
- package/dist/src/entities/model/client-affiliate.entity.model.js +30 -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 +11 -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 +84 -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
package/dist/src/api/index.d.ts
CHANGED
|
@@ -82,3 +82,4 @@ export * from "./interface/cron-job.entity.response";
|
|
|
82
82
|
export * from "./interface/to-do.entity.api";
|
|
83
83
|
export * from "./interface/billing-reimbursement-expense.api";
|
|
84
84
|
export * from "./interface/billing-reimbursement-expense-history.api";
|
|
85
|
+
export * from "./interface/project-user-mapping.entity.api";
|
package/dist/src/api/index.js
CHANGED
|
@@ -98,3 +98,4 @@ __exportStar(require("./interface/cron-job.entity.response"), exports);
|
|
|
98
98
|
__exportStar(require("./interface/to-do.entity.api"), exports);
|
|
99
99
|
__exportStar(require("./interface/billing-reimbursement-expense.api"), exports);
|
|
100
100
|
__exportStar(require("./interface/billing-reimbursement-expense-history.api"), exports);
|
|
101
|
+
__exportStar(require("./interface/project-user-mapping.entity.api"), exports);
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { BillingActionsEnum, IBillingEntity, IBillingTimesheetUpdateDto, IEntityUpdateDto } from "../../entities";
|
|
2
|
-
import { IBillingEntityCreateDtoValidationData } from "./billing.create.dto.interface";
|
|
1
|
+
import { BillingActionsEnum, IBillingEntity, IBillingReimbursementExpenseUpdateDto, IBillingTimesheetUpdateDto, IEntityUpdateDto } from "../../entities";
|
|
2
|
+
import { IBillingEntityCreateDtoValidationData, IBillingParticulars } from "./billing.create.dto.interface";
|
|
3
3
|
export interface IBillingUpdateDto extends IEntityUpdateDto<IBillingEntity> {
|
|
4
4
|
}
|
|
5
|
-
export interface IUpdateBillingDto extends IBillingUpdateDto {
|
|
5
|
+
export interface IUpdateBillingDto extends Omit<IBillingUpdateDto, "particulars"> {
|
|
6
6
|
action?: BillingActionsEnum;
|
|
7
7
|
timesheets?: IBillingTimesheetUpdateDto[];
|
|
8
|
+
reimbursementExpenses?: IBillingReimbursementExpenseUpdateDto[];
|
|
9
|
+
particulars?: IBillingParticulars;
|
|
8
10
|
}
|
|
9
11
|
export interface IBillingUpdateDtoValidationData extends IBillingEntityCreateDtoValidationData {
|
|
10
12
|
billingEntity: IBillingEntity;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RelationType = void 0;
|
|
4
|
+
var RelationType;
|
|
5
|
+
(function (RelationType) {
|
|
6
|
+
RelationType["ONE"] = "one";
|
|
7
|
+
RelationType["MANY"] = "many";
|
|
8
|
+
})(RelationType || (exports.RelationType = RelationType = {}));
|
|
@@ -80,3 +80,20 @@ export * from "./enums/billing-reimbursement-expense-change-status.enum";
|
|
|
80
80
|
export * from "./interface/billing-reimbursement-expense-history.entity.interface";
|
|
81
81
|
export * from "./enums/billing-reimburement-expense-impact.enum";
|
|
82
82
|
export * from "./model/bank.entity.model";
|
|
83
|
+
export * from "./model/base.entity.model";
|
|
84
|
+
export * from "./model/billing-reimbursement-expense.entity.model";
|
|
85
|
+
export * from "./model/billing.entity.model";
|
|
86
|
+
export * from "./model/entity.model.interface";
|
|
87
|
+
export * from "./model/project-user-mapping.entity.model";
|
|
88
|
+
export * from "./model/project.entity.model";
|
|
89
|
+
export * from "./model/reimbursement-expense.entity.model";
|
|
90
|
+
export * from "./model/reimbursement.entity.model";
|
|
91
|
+
export * from "./model/task.entity.model";
|
|
92
|
+
export * from "./model/user.entity.model";
|
|
93
|
+
export * from "./model/client.entity.model";
|
|
94
|
+
export * from "./model/configuration.model";
|
|
95
|
+
export * from "./model/designation.entity.model";
|
|
96
|
+
export * from "./model/timesheet.entity.model";
|
|
97
|
+
export * from "./model/user.entity.model";
|
|
98
|
+
export * from "./model/client-affiliate.entity.model";
|
|
99
|
+
export * from "./model/billing-timesheet.entity.model";
|
|
@@ -97,3 +97,20 @@ __exportStar(require("./enums/billing-reimbursement-expense-change-status.enum")
|
|
|
97
97
|
__exportStar(require("./interface/billing-reimbursement-expense-history.entity.interface"), exports);
|
|
98
98
|
__exportStar(require("./enums/billing-reimburement-expense-impact.enum"), exports);
|
|
99
99
|
__exportStar(require("./model/bank.entity.model"), exports);
|
|
100
|
+
__exportStar(require("./model/base.entity.model"), exports);
|
|
101
|
+
__exportStar(require("./model/billing-reimbursement-expense.entity.model"), exports);
|
|
102
|
+
__exportStar(require("./model/billing.entity.model"), exports);
|
|
103
|
+
__exportStar(require("./model/entity.model.interface"), exports);
|
|
104
|
+
__exportStar(require("./model/project-user-mapping.entity.model"), exports);
|
|
105
|
+
__exportStar(require("./model/project.entity.model"), exports);
|
|
106
|
+
__exportStar(require("./model/reimbursement-expense.entity.model"), exports);
|
|
107
|
+
__exportStar(require("./model/reimbursement.entity.model"), exports);
|
|
108
|
+
__exportStar(require("./model/task.entity.model"), exports);
|
|
109
|
+
__exportStar(require("./model/user.entity.model"), exports);
|
|
110
|
+
__exportStar(require("./model/client.entity.model"), exports);
|
|
111
|
+
__exportStar(require("./model/configuration.model"), exports);
|
|
112
|
+
__exportStar(require("./model/designation.entity.model"), exports);
|
|
113
|
+
__exportStar(require("./model/timesheet.entity.model"), exports);
|
|
114
|
+
__exportStar(require("./model/user.entity.model"), exports);
|
|
115
|
+
__exportStar(require("./model/client-affiliate.entity.model"), exports);
|
|
116
|
+
__exportStar(require("./model/billing-timesheet.entity.model"), exports);
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import { IBaseResponse } from "../../api";
|
|
2
2
|
import { ConvertToArray } from "../../misc";
|
|
3
3
|
import { Modify } from "../../misc/interface/modify.interface";
|
|
4
|
+
import { TimesheetEntityModel } from "../../model/entities/timesheet.model";
|
|
4
5
|
import { EntitySearchConstraintTypeEnum } from "../enums/entity_search_constraint_type.enum";
|
|
5
6
|
import { HistoryOperationEnum } from "../enums/history_operation.enum";
|
|
7
|
+
import { BankEntityModel } from "../model/bank.entity.model";
|
|
8
|
+
import { BillingReimbursementExpneseEntityModel } from "../model/billing-reimbursement-expense.entity.model";
|
|
9
|
+
import { BillingTimesheetEntityModel } from "../model/billing-timesheet.entity.model";
|
|
10
|
+
import { BillingEntityModel } from "../model/billing.entity.model";
|
|
11
|
+
import { ClientAffiliateEntityModel } from "../model/client-affiliate.entity.model";
|
|
12
|
+
import { ClientEntityModel } from "../model/client.entity.model";
|
|
13
|
+
import { ConfigurationEntityModel } from "../model/configuration.model";
|
|
14
|
+
import { ProjectUserMappingEntityModel } from "../model/project-user-mapping.entity.model";
|
|
15
|
+
import { ProjectEntityModel } from "../model/project.entity.model";
|
|
16
|
+
import { ReimbursementExpenseEntityModel } from "../model/reimbursement-expense.entity.model";
|
|
17
|
+
import { ReimbursementEntityModel } from "../model/reimbursement.entity.model";
|
|
18
|
+
import { TaskEntityModel } from "../model/task.entity.model";
|
|
19
|
+
import { UserEntityModel } from "../model/user.entity.model";
|
|
6
20
|
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
7
21
|
import { IBankEntity } from "./bank.entity.interface";
|
|
8
22
|
import { IBankHistoryEntity } from "./bank_history.entity.interface";
|
|
@@ -267,3 +281,12 @@ export declare enum VirtualEntityEnum {
|
|
|
267
281
|
}
|
|
268
282
|
export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
|
|
269
283
|
export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
|
|
284
|
+
export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : T extends EntityEnum.CLIENT ? ClientEntityModel : T extends EntityEnum.PROJECT ? ProjectEntityModel : T extends EntityEnum.PROJECT_USER_MAPPING ? ProjectUserMappingEntityModel : T extends EntityEnum.REIMBURSEMENT ? ReimbursementEntityModel : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? ReimbursementExpenseEntityModel : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? BillingReimbursementExpneseEntityModel : T extends EntityEnum.CLIENT_AFFILIATE ? ClientAffiliateEntityModel : T extends EntityEnum.BANK ? BankEntityModel : T extends EntityEnum.CONFIGURATION ? ConfigurationEntityModel : T extends EntityEnum.TASK ? TaskEntityModel : T extends EntityEnum.BILLING_TIMESHEET ? BillingTimesheetEntityModel : T extends EntityEnum.TIMESHEET ? TimesheetEntityModel : UserEntityModel;
|
|
285
|
+
export type EntityMap = {
|
|
286
|
+
[key in EntityEnum]: EnumToModel<key>[];
|
|
287
|
+
};
|
|
288
|
+
export type EntityIndexMap = {
|
|
289
|
+
[key in EntityEnum]: {
|
|
290
|
+
[id: number]: EnumToModel<key>;
|
|
291
|
+
};
|
|
292
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RelationType } from "../enums/relation-type.enum";
|
|
2
|
+
import { EntityEnum, EnumEntityType, VirtualEntityEnum } from "./entity.utils.interface";
|
|
3
|
+
type SourcePath<T> = (keyof T & string) | `${string}.${string}`;
|
|
4
|
+
export type IRelationConfig<T extends EntityEnum | VirtualEntityEnum, K extends EnumEntityType<EntityEnum | VirtualEntityEnum>> = {
|
|
5
|
+
name: T;
|
|
6
|
+
relation: RelationType;
|
|
7
|
+
key: string;
|
|
8
|
+
mapKeyConfig: {
|
|
9
|
+
relationKey: SourcePath<EnumEntityType<T>>;
|
|
10
|
+
key: keyof K;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type RelationConfigs<T extends readonly (EntityEnum | VirtualEntityEnum)[], E extends EnumEntityType<EntityEnum>> = {
|
|
14
|
+
[K in keyof T]: T[K] extends EntityEnum | VirtualEntityEnum ? IRelationConfig<T[K], E> : never;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { IBankApiEntity } from "../../api";
|
|
2
2
|
import { BankStatusEnum } from "../enums/bank_status.enum";
|
|
3
|
-
|
|
3
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
4
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
5
|
+
export declare class BankEntityModel extends BaseEntityModel<EntityEnum.BANK> implements IBankApiEntity {
|
|
4
6
|
id: number;
|
|
5
7
|
accountName: string;
|
|
6
8
|
organizationId: number;
|
|
@@ -17,4 +19,5 @@ export declare class BankEntityModel implements IBankApiEntity {
|
|
|
17
19
|
createdOn: string;
|
|
18
20
|
updatedOn: string;
|
|
19
21
|
static fromApiEntity(apiEntity: IBankApiEntity): BankEntityModel;
|
|
22
|
+
getRelationConfigs(): any[];
|
|
20
23
|
}
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BankEntityModel = void 0;
|
|
4
4
|
const bank_status_enum_1 = require("../enums/bank_status.enum");
|
|
5
|
-
|
|
5
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
6
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
7
|
+
class BankEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
6
8
|
constructor() {
|
|
9
|
+
super(...arguments);
|
|
7
10
|
this.id = 0;
|
|
8
11
|
this.accountName = "";
|
|
9
12
|
this.organizationId = 0;
|
|
@@ -15,13 +18,16 @@ class BankEntityModel {
|
|
|
15
18
|
this.status = bank_status_enum_1.BankStatusEnum.CREATE_APPROVAL;
|
|
16
19
|
this.createdBy = 0;
|
|
17
20
|
this.updatedBy = 0;
|
|
18
|
-
this.createdOn =
|
|
19
|
-
this.updatedOn =
|
|
21
|
+
this.createdOn = "";
|
|
22
|
+
this.updatedOn = "";
|
|
20
23
|
}
|
|
21
24
|
static fromApiEntity(apiEntity) {
|
|
22
|
-
const entity = new BankEntityModel();
|
|
25
|
+
const entity = new BankEntityModel(entity_utils_interface_1.EntityEnum.BANK);
|
|
23
26
|
Object.assign(entity, apiEntity);
|
|
24
27
|
return entity;
|
|
25
28
|
}
|
|
29
|
+
getRelationConfigs() {
|
|
30
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
31
|
+
}
|
|
26
32
|
}
|
|
27
33
|
exports.BankEntityModel = BankEntityModel;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EntityEnum, EntityIndexMap } from "../interface/entity.utils.interface";
|
|
2
|
+
export declare abstract class BaseEntityModel<T extends EntityEnum> {
|
|
3
|
+
protected entityName: T;
|
|
4
|
+
constructor(entityName: T);
|
|
5
|
+
abstract getRelationConfigs(): any[];
|
|
6
|
+
populateRelationsByIndex(entityIndexMap: EntityIndexMap): void;
|
|
7
|
+
static populateRelationsForEntities(entityIndexMap: EntityIndexMap, entityType: EntityEnum): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseEntityModel = void 0;
|
|
4
|
+
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
5
|
+
class BaseEntityModel {
|
|
6
|
+
constructor(entityName) {
|
|
7
|
+
this.entityName = entityName;
|
|
8
|
+
}
|
|
9
|
+
populateRelationsByIndex(entityIndexMap) {
|
|
10
|
+
for (const relationConfig of this.getRelationConfigs() || []) {
|
|
11
|
+
if (relationConfig.relation === relation_type_enum_1.RelationType.ONE) {
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
const relatedEntities = entityIndexMap[relationConfig.name] || {};
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
let foundRelatedEntities = [];
|
|
16
|
+
if (relationConfig.mapKeyConfig.key.includes(".")) {
|
|
17
|
+
const [parentKey, childKey] = relationConfig.mapKeyConfig.key.split(".");
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
if (this[parentKey] && this[parentKey][childKey]) {
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
foundRelatedEntities = [relatedEntities[this[parentKey][childKey]]];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
foundRelatedEntities = relatedEntities[
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
this[relationConfig.mapKeyConfig.key]]
|
|
28
|
+
? // @ts-ignore
|
|
29
|
+
[relatedEntities[this[relationConfig.mapKeyConfig.key]]]
|
|
30
|
+
: [];
|
|
31
|
+
}
|
|
32
|
+
if (foundRelatedEntities.length > 1) {
|
|
33
|
+
throw new Error(`Expected one related entity for ${relationConfig.name} but found ${foundRelatedEntities.length}`);
|
|
34
|
+
}
|
|
35
|
+
if (foundRelatedEntities.length === 0) {
|
|
36
|
+
console.warn(`No related entity found for ${relationConfig.name} with ${relationConfig.mapKeyConfig.key
|
|
37
|
+
// @ts-ignore
|
|
38
|
+
}=${this[relationConfig.mapKeyConfig.foreignKey]}`);
|
|
39
|
+
}
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
this[relationConfig.key] = foundRelatedEntities[0];
|
|
42
|
+
}
|
|
43
|
+
else if (relationConfig.relation === relation_type_enum_1.RelationType.MANY) {
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
this[relationConfig.key] = [];
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
const relatedEntities = entityIndexMap[relationConfig.name] || {};
|
|
48
|
+
for (const relatedEntity of Object.values(relatedEntities)) {
|
|
49
|
+
if (
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
relatedEntity[relationConfig.mapKeyConfig.relationKey] ===
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
this[relationConfig.mapKeyConfig.key]) {
|
|
54
|
+
// @ts-ignore
|
|
55
|
+
this[relationConfig.key].push(relatedEntity);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
static populateRelationsForEntities(entityIndexMap, entityType) {
|
|
62
|
+
for (const key of Object.keys(entityIndexMap[entityType] || {})) {
|
|
63
|
+
// @ts-ignore
|
|
64
|
+
const entity = entityIndexMap[entityType][key];
|
|
65
|
+
entity.populateRelationsByIndex(entityIndexMap);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.BaseEntityModel = BaseEntityModel;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IBillingReimbursementExpenseApiEntity } from "../../api";
|
|
2
|
+
import { BillingReimbursementExpenseImpactEnum } from "../enums/billing-reimburement-expense-impact.enum";
|
|
3
|
+
import { BillingReimbursementExpenseChangedStatusEnum } from "../enums/billing-reimbursement-expense-change-status.enum";
|
|
4
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
5
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
6
|
+
export declare class BillingReimbursementExpneseEntityModel extends BaseEntityModel<EntityEnum.BILLING_REIMBURSEMENT_EXPENSE> implements IBillingReimbursementExpenseApiEntity {
|
|
7
|
+
id: number;
|
|
8
|
+
billingId: number;
|
|
9
|
+
userId: number;
|
|
10
|
+
reimbursementExpenseId: number;
|
|
11
|
+
projectId: number;
|
|
12
|
+
expenseType: string;
|
|
13
|
+
totalAmount: number;
|
|
14
|
+
expenseIncurredDate: string;
|
|
15
|
+
changedStatus: BillingReimbursementExpenseChangedStatusEnum;
|
|
16
|
+
amendmentPurpose?: string;
|
|
17
|
+
impact?: BillingReimbursementExpenseImpactEnum;
|
|
18
|
+
updatedBy: number;
|
|
19
|
+
createdBy: number;
|
|
20
|
+
createdOn: string;
|
|
21
|
+
updatedOn: string;
|
|
22
|
+
static relationConfigs: never[];
|
|
23
|
+
getRelationConfigs(): any[];
|
|
24
|
+
static fromApiEntity(apiEntity: IBillingReimbursementExpenseApiEntity): BillingReimbursementExpneseEntityModel;
|
|
25
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BillingReimbursementExpneseEntityModel = void 0;
|
|
4
|
+
const billing_reimbursement_expense_change_status_enum_1 = require("../enums/billing-reimbursement-expense-change-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 BillingReimbursementExpneseEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.id = 0;
|
|
11
|
+
this.billingId = 0;
|
|
12
|
+
this.userId = 0;
|
|
13
|
+
this.reimbursementExpenseId = 0;
|
|
14
|
+
this.projectId = 0;
|
|
15
|
+
this.expenseType = "";
|
|
16
|
+
this.totalAmount = 0;
|
|
17
|
+
this.expenseIncurredDate = "";
|
|
18
|
+
this.changedStatus = billing_reimbursement_expense_change_status_enum_1.BillingReimbursementExpenseChangedStatusEnum.UNCHANGED;
|
|
19
|
+
this.amendmentPurpose = "";
|
|
20
|
+
this.updatedBy = 0;
|
|
21
|
+
this.createdBy = 0;
|
|
22
|
+
this.createdOn = "";
|
|
23
|
+
this.updatedOn = "";
|
|
24
|
+
}
|
|
25
|
+
getRelationConfigs() {
|
|
26
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
27
|
+
}
|
|
28
|
+
static fromApiEntity(apiEntity) {
|
|
29
|
+
const entity = new BillingReimbursementExpneseEntityModel(entity_utils_interface_1.EntityEnum.BILLING_REIMBURSEMENT_EXPENSE);
|
|
30
|
+
Object.assign(entity, apiEntity);
|
|
31
|
+
return entity;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.BillingReimbursementExpneseEntityModel = BillingReimbursementExpneseEntityModel;
|
|
35
|
+
BillingReimbursementExpneseEntityModel.relationConfigs = [];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IBillingTimesheetApiEntity } from "../../api";
|
|
2
|
+
import { BillingImpactEnum } from "../enums/billing.impact.enum";
|
|
3
|
+
import { BillingTimesheetStatusEnum } from "../enums/billing.timesheet.change.status.enum";
|
|
4
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
5
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
6
|
+
export declare class BillingTimesheetEntityModel extends BaseEntityModel<EntityEnum.BILLING_TIMESHEET> implements IBillingTimesheetApiEntity {
|
|
7
|
+
id: number;
|
|
8
|
+
billingId: number;
|
|
9
|
+
dateCode: string;
|
|
10
|
+
timesheetId: number;
|
|
11
|
+
userId: number;
|
|
12
|
+
projectId: number;
|
|
13
|
+
task: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
totalDuration: number;
|
|
16
|
+
totalAmount: number;
|
|
17
|
+
impact: BillingImpactEnum;
|
|
18
|
+
amendmentPurpose?: string;
|
|
19
|
+
changedStatus: BillingTimesheetStatusEnum;
|
|
20
|
+
createdOn: string;
|
|
21
|
+
updatedOn: string;
|
|
22
|
+
createdBy: number;
|
|
23
|
+
updatedBy: number;
|
|
24
|
+
getRelationConfigs(): any;
|
|
25
|
+
static fromApiEntity(apiEntity: IBillingTimesheetApiEntity): BillingTimesheetEntityModel;
|
|
26
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BillingTimesheetEntityModel = void 0;
|
|
4
|
+
const billing_impact_enum_1 = require("../enums/billing.impact.enum");
|
|
5
|
+
const billing_timesheet_change_status_enum_1 = require("../enums/billing.timesheet.change.status.enum");
|
|
6
|
+
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
7
|
+
const base_entity_model_1 = require("./base.entity.model");
|
|
8
|
+
class BillingTimesheetEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.id = 0;
|
|
12
|
+
this.billingId = 0;
|
|
13
|
+
this.dateCode = "";
|
|
14
|
+
this.timesheetId = 0;
|
|
15
|
+
this.userId = 0;
|
|
16
|
+
this.projectId = 0;
|
|
17
|
+
this.task = "";
|
|
18
|
+
this.totalDuration = 0;
|
|
19
|
+
this.totalAmount = 0;
|
|
20
|
+
this.impact = billing_impact_enum_1.BillingImpactEnum.NEUTRAL; // adjust default if needed
|
|
21
|
+
this.changedStatus = billing_timesheet_change_status_enum_1.BillingTimesheetStatusEnum.UNCHANGED;
|
|
22
|
+
this.createdOn = "";
|
|
23
|
+
this.updatedOn = "";
|
|
24
|
+
this.createdBy = 0;
|
|
25
|
+
this.updatedBy = 0;
|
|
26
|
+
}
|
|
27
|
+
getRelationConfigs() {
|
|
28
|
+
return this.constructor.prototype.constructor.relationConfigs;
|
|
29
|
+
}
|
|
30
|
+
static fromApiEntity(apiEntity) {
|
|
31
|
+
const entity = new BillingTimesheetEntityModel(entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET);
|
|
32
|
+
Object.assign(entity, apiEntity);
|
|
33
|
+
return entity;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.BillingTimesheetEntityModel = BillingTimesheetEntityModel;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { IBillingApiEntity, IBillingFlowConfig } from "../../api";
|
|
2
|
+
import { CurrencyEnum } from "../../enums";
|
|
3
|
+
import { BillingTypeEnum } from "../enums/billing-type.enum";
|
|
4
|
+
import { BillingActionsEnum } from "../enums/billing.action.enum";
|
|
5
|
+
import { BillingStatusEnum } from "../enums/billing.status.enum";
|
|
6
|
+
import { BillingInvoiceTypeEnum } from "../enums/billing_invoice_type.enum";
|
|
7
|
+
import { PaymentStatusEnum } from "../enums/payment_status.enum";
|
|
8
|
+
import { EntityEnum, EnumEntityType } from "../interface/entity.utils.interface";
|
|
9
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
10
|
+
import { BankEntityModel } from "./bank.entity.model";
|
|
11
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
12
|
+
import { BillingReimbursementExpneseEntityModel } from "./billing-reimbursement-expense.entity.model";
|
|
13
|
+
import { BillingTimesheetEntityModel } from "./billing-timesheet.entity.model";
|
|
14
|
+
import { ClientEntityModel } from "./client.entity.model";
|
|
15
|
+
import { ProjectEntityModel } from "./project.entity.model";
|
|
16
|
+
import { ReimbursementExpenseEntityModel } from "./reimbursement-expense.entity.model";
|
|
17
|
+
import { UserEntityModel } from "./user.entity.model";
|
|
18
|
+
export interface BillingActions {
|
|
19
|
+
label: string;
|
|
20
|
+
value: BillingActionsEnum;
|
|
21
|
+
}
|
|
22
|
+
export declare enum BillingStatusCategoryEnumForUI {
|
|
23
|
+
INTERNAL_REVIEW_STATUS = "INTERNAL_REVIEW_STATUS",
|
|
24
|
+
CLIENT_REVIEW_STATUS = "CLIENT_REVIEW_STATUS",
|
|
25
|
+
PAYMENT_STATUS = "PAYMENT_STATUS"
|
|
26
|
+
}
|
|
27
|
+
export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLING> implements IBillingApiEntity {
|
|
28
|
+
id: number;
|
|
29
|
+
startDate: string;
|
|
30
|
+
endDate: string;
|
|
31
|
+
projectId: number;
|
|
32
|
+
totalAmount: number;
|
|
33
|
+
totalMinutes: number;
|
|
34
|
+
invoiceNumber: string;
|
|
35
|
+
paymentStatus: PaymentStatusEnum;
|
|
36
|
+
status: BillingStatusEnum;
|
|
37
|
+
writeoffAmount: number;
|
|
38
|
+
totalAmountPaid: number;
|
|
39
|
+
tdsAmount: number;
|
|
40
|
+
creditNoteAmount: number;
|
|
41
|
+
invoiceEntityId: number;
|
|
42
|
+
invoiceEntityType: BillingInvoiceTypeEnum;
|
|
43
|
+
invoicePdfUrl?: string | null;
|
|
44
|
+
invoiceContactName: string;
|
|
45
|
+
bankId: number;
|
|
46
|
+
conversionRate?: number;
|
|
47
|
+
particulars: string;
|
|
48
|
+
currency: CurrencyEnum;
|
|
49
|
+
createdBy: number;
|
|
50
|
+
updatedBy: number;
|
|
51
|
+
createdOn: string;
|
|
52
|
+
updatedOn: string;
|
|
53
|
+
type: BillingTypeEnum;
|
|
54
|
+
project?: ProjectEntityModel;
|
|
55
|
+
client?: ClientEntityModel;
|
|
56
|
+
updatedByUser?: UserEntityModel;
|
|
57
|
+
billOverdue?: boolean;
|
|
58
|
+
billingIdReimbursementExpense?: BillingReimbursementExpneseEntityModel[];
|
|
59
|
+
reimbursementExpense?: ReimbursementExpenseEntityModel[];
|
|
60
|
+
bank?: BankEntityModel[];
|
|
61
|
+
billingTimesheets?: BillingTimesheetEntityModel[];
|
|
62
|
+
static relationConfigs: RelationConfigs<[
|
|
63
|
+
EntityEnum.PROJECT,
|
|
64
|
+
EntityEnum.CLIENT,
|
|
65
|
+
EntityEnum.USER,
|
|
66
|
+
EntityEnum.REIMBURSEMENT_EXPENSE,
|
|
67
|
+
EntityEnum.BILLING_REIMBURSEMENT_EXPENSE,
|
|
68
|
+
EntityEnum.BILLING_TIMESHEET,
|
|
69
|
+
EntityEnum.BANK
|
|
70
|
+
], EnumEntityType<EntityEnum.BILLING>>;
|
|
71
|
+
static fromApiEntity(apiEntity: IBillingApiEntity): BillingEntityModel;
|
|
72
|
+
getStatusCategory(): BillingStatusCategoryEnumForUI;
|
|
73
|
+
getStatusLabel(): string;
|
|
74
|
+
getTotalAmountInINR(): number;
|
|
75
|
+
getDateRange(): string;
|
|
76
|
+
getBillDate(): Date;
|
|
77
|
+
mapOverdue(configValue: string | undefined): void;
|
|
78
|
+
mapStatusCategory(status: BillingStatusEnum): BillingStatusCategoryEnumForUI;
|
|
79
|
+
mapStatusLabel(status: BillingStatusEnum): string;
|
|
80
|
+
formatDate(dateStr: string, includeYear?: boolean): string;
|
|
81
|
+
getAvailableAction(currentUserPermissions: string[], billingConfigFlow: IBillingFlowConfig, getUpdateActionVisibility: (bill: BillingEntityModel) => {
|
|
82
|
+
[key: string]: () => boolean;
|
|
83
|
+
}): BillingActionsEnum[];
|
|
84
|
+
getRelationConfigs(): any;
|
|
85
|
+
}
|