law-common 2.8.1-beta.9 → 2.9.2
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 +3 -0
- package/dist/src/api/index.js +3 -0
- package/dist/src/api/interface/reimbursement.entity.response.d.ts +13 -6
- package/dist/src/api/interface/reimbursement_expense.api.d.ts +3 -0
- package/dist/src/api/interface/reimbursement_expense.api.js +2 -0
- package/dist/src/api/interface/reimbursement_history.api.d.ts +3 -0
- package/dist/src/api/interface/reimbursement_history.api.js +2 -0
- package/dist/src/api/interface/timesheet_history_entity.response.d.ts +12 -0
- package/dist/src/api/interface/timesheet_history_entity.response.js +2 -0
- package/dist/src/entities/enums/entity_search_constraint_type.enum.d.ts +3 -0
- package/dist/src/entities/enums/entity_search_constraint_type.enum.js +7 -0
- package/dist/src/entities/enums/reimbursement.entity.enum.d.ts +10 -13
- package/dist/src/entities/enums/reimbursement.entity.enum.js +26 -29
- package/dist/src/entities/enums/timesheet_entity_keys.enum.d.ts +14 -0
- package/dist/src/entities/enums/timesheet_entity_keys.enum.js +45 -0
- package/dist/src/entities/index.d.ts +3 -0
- package/dist/src/entities/index.js +3 -0
- package/dist/src/entities/interface/reimbursement.entity.interface.d.ts +12 -17
- package/dist/src/entities/interface/reimbursement_expense.entity.interface.d.ts +23 -0
- package/dist/src/entities/interface/reimbursement_expense.entity.interface.js +2 -0
- package/dist/src/entities/interface/timesheet_history.entity.interface.d.ts +23 -0
- package/dist/src/enums/error.key.enum.d.ts +3 -1
- package/dist/src/enums/error.key.enum.js +2 -0
- package/dist/src/utils/helper.fn.util.d.ts +1 -0
- package/dist/src/utils/helper.fn.util.js +19 -0
- package/dist/src/utils/models/date-code.model.util.d.ts +1 -0
- package/dist/src/utils/models/date-code.model.util.js +3 -0
- package/package.json +35 -35
package/dist/src/api/index.d.ts
CHANGED
|
@@ -61,3 +61,6 @@ export * from "./interface/billing.flow.update.dto";
|
|
|
61
61
|
export * from "./interface/timesheet.history.api";
|
|
62
62
|
export * from "./interface/billing.history.api";
|
|
63
63
|
export * from "./interface/billing_timesheet_history.api";
|
|
64
|
+
export * from "./interface/reimbursement_history.api";
|
|
65
|
+
export * from "./interface/reimbursement_expense.api";
|
|
66
|
+
export * from "./interface/timesheet_history_entity.response";
|
package/dist/src/api/index.js
CHANGED
|
@@ -77,3 +77,6 @@ __exportStar(require("./interface/billing.flow.update.dto"), exports);
|
|
|
77
77
|
__exportStar(require("./interface/timesheet.history.api"), exports);
|
|
78
78
|
__exportStar(require("./interface/billing.history.api"), exports);
|
|
79
79
|
__exportStar(require("./interface/billing_timesheet_history.api"), exports);
|
|
80
|
+
__exportStar(require("./interface/reimbursement_history.api"), exports);
|
|
81
|
+
__exportStar(require("./interface/reimbursement_expense.api"), exports);
|
|
82
|
+
__exportStar(require("./interface/timesheet_history_entity.response"), exports);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { IApiEntity, IReimbursementEntity, ReimbursementActionEnum,
|
|
1
|
+
import { IApiEntity, IReimbursementEntity, IReimbursementExpenseEntity, ReimbursementActionEnum, ReimbursementExpenseActionEnum, ReimbursementExpenseState, ReimbursementStatusEnum } from "../../entities";
|
|
2
2
|
import { IProjectEntityGet } from "./project.entity.response";
|
|
3
|
+
import { IReimbursementExpenseApiEntityArray } from "./reimbursement_expense.api";
|
|
3
4
|
import { IUserApiEntity } from "./user.entity.api";
|
|
4
5
|
export type IReimbursementApiEntity = IApiEntity<IReimbursementEntity>;
|
|
5
6
|
export type IReimbursementApiEntityArray = IReimbursementApiEntity[];
|
|
6
7
|
export type IReimbursementEntityGet = {
|
|
7
|
-
reimbursements:
|
|
8
|
+
reimbursements: IReimbursementResponse[];
|
|
8
9
|
users: {
|
|
9
10
|
[key: string]: IUserApiEntity;
|
|
10
11
|
};
|
|
@@ -16,19 +17,25 @@ export type IReimbursementFlowConfig = {
|
|
|
16
17
|
actions: {
|
|
17
18
|
[key in ReimbursementActionEnum]?: {
|
|
18
19
|
permissions: string[];
|
|
19
|
-
next?: (
|
|
20
|
+
next?: (data: IReimbursementFlowContextData) => ReimbursementStatusEnum;
|
|
20
21
|
};
|
|
21
22
|
};
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
25
|
child: {
|
|
25
|
-
[key in
|
|
26
|
+
[key in ReimbursementExpenseState]?: {
|
|
26
27
|
actions: {
|
|
27
|
-
[key in
|
|
28
|
+
[key in ReimbursementExpenseActionEnum]?: {
|
|
28
29
|
permissions: string[];
|
|
29
|
-
next?: () =>
|
|
30
|
+
next?: () => ReimbursementExpenseState;
|
|
30
31
|
};
|
|
31
32
|
};
|
|
32
33
|
};
|
|
33
34
|
};
|
|
34
35
|
};
|
|
36
|
+
export type IReimbursementFlowContextData = {
|
|
37
|
+
expenseDetails: IReimbursementExpenseEntity[];
|
|
38
|
+
};
|
|
39
|
+
export type IReimbursementResponse = IReimbursementApiEntity & {
|
|
40
|
+
expenseDetails: IReimbursementExpenseApiEntityArray;
|
|
41
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ITimesheetHistoryEntitySearchByConstraintResponse = {
|
|
2
|
+
id: number;
|
|
3
|
+
createdBy: number;
|
|
4
|
+
changedLogs: ITimesheetHistoryEntityChangedLogs[];
|
|
5
|
+
};
|
|
6
|
+
export type ITimesheetHistoryEntityChangedLogs = {
|
|
7
|
+
key: string;
|
|
8
|
+
label: string;
|
|
9
|
+
newValue: string | number;
|
|
10
|
+
oldValue: string | number;
|
|
11
|
+
timeStamp: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntitySearchConstraintTypeEnum = void 0;
|
|
4
|
+
var EntitySearchConstraintTypeEnum;
|
|
5
|
+
(function (EntitySearchConstraintTypeEnum) {
|
|
6
|
+
EntitySearchConstraintTypeEnum["COLUMN_DEPTH"] = "column_depth";
|
|
7
|
+
})(EntitySearchConstraintTypeEnum || (exports.EntitySearchConstraintTypeEnum = EntitySearchConstraintTypeEnum = {}));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare enum ReimbursementBillingTypeEnum {
|
|
2
2
|
BILLABLE = "BILLABLE",
|
|
3
|
-
NON_BILLABLE = "NON_BILLABLE"
|
|
3
|
+
NON_BILLABLE = "NON_BILLABLE",
|
|
4
|
+
HYBRID = "HYBRID"
|
|
4
5
|
}
|
|
5
6
|
export declare enum ReimbursementBillingPresentEnum {
|
|
6
7
|
YES = "YES",
|
|
@@ -16,14 +17,14 @@ export declare enum ReimbursementStatusEnum {
|
|
|
16
17
|
APPROVED = "APPROVED",
|
|
17
18
|
REJECTED = "REJECTED",
|
|
18
19
|
PARTIALLY_APPROVED = "PARTIALLY_APPROVED",
|
|
19
|
-
PAYMENT_PENDING = "PAYMENT_PENDING",
|
|
20
20
|
PAYMENT_DISBURSE = "PAYMENT_DISBURSE",
|
|
21
21
|
DELETED = "DELETED"
|
|
22
22
|
}
|
|
23
|
-
export declare enum
|
|
23
|
+
export declare enum ReimbursementExpenseState {
|
|
24
24
|
PENDING = "pending",
|
|
25
25
|
APPROVED = "approved",
|
|
26
|
-
|
|
26
|
+
REJECTED = "rejected",
|
|
27
|
+
DELETED = "deleted"
|
|
27
28
|
}
|
|
28
29
|
export declare enum ReimbursementPaymentStatusEnum {
|
|
29
30
|
PAID = "PAID",
|
|
@@ -37,19 +38,15 @@ export declare enum ReimbursementActionEnum {
|
|
|
37
38
|
REJECT = "reject",
|
|
38
39
|
UPDATE_PAYMENT = "update_payment"
|
|
39
40
|
}
|
|
40
|
-
export declare enum
|
|
41
|
+
export declare enum ReimbursementExpenseActionEnum {
|
|
41
42
|
PENDING = "pending",
|
|
42
43
|
APPROVE = "approve",
|
|
43
|
-
REJECT = "reject"
|
|
44
|
-
|
|
45
|
-
export declare enum ReimbursementStatusSubRow {
|
|
46
|
-
APPROVED = "approved",
|
|
47
|
-
REJECTED = "rejected",
|
|
48
|
-
PENDING = "pending"
|
|
44
|
+
REJECT = "reject",
|
|
45
|
+
DELETE = "delete"
|
|
49
46
|
}
|
|
50
47
|
export declare namespace ReimbursementActionEnum {
|
|
51
48
|
function getLabel(action: ReimbursementActionEnum): string;
|
|
52
49
|
}
|
|
53
|
-
export declare namespace
|
|
54
|
-
function getLabel(action:
|
|
50
|
+
export declare namespace ReimbursementExpenseActionEnum {
|
|
51
|
+
function getLabel(action: ReimbursementExpenseActionEnum): string;
|
|
55
52
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ReimbursementExpenseActionEnum = exports.ReimbursementActionEnum = exports.ReimbursementPaymentStatusEnum = exports.ReimbursementExpenseState = exports.ReimbursementStatusEnum = exports.ReimbursementIncurredByEnum = exports.ReimbursementBillingPresentEnum = exports.ReimbursementBillingTypeEnum = void 0;
|
|
4
4
|
const error_key_enum_1 = require("../../enums/error.key.enum");
|
|
5
5
|
const exceptions_1 = require("../../exceptions");
|
|
6
6
|
var ReimbursementBillingTypeEnum;
|
|
7
7
|
(function (ReimbursementBillingTypeEnum) {
|
|
8
8
|
ReimbursementBillingTypeEnum["BILLABLE"] = "BILLABLE";
|
|
9
9
|
ReimbursementBillingTypeEnum["NON_BILLABLE"] = "NON_BILLABLE";
|
|
10
|
+
ReimbursementBillingTypeEnum["HYBRID"] = "HYBRID";
|
|
10
11
|
})(ReimbursementBillingTypeEnum || (exports.ReimbursementBillingTypeEnum = ReimbursementBillingTypeEnum = {}));
|
|
11
12
|
var ReimbursementBillingPresentEnum;
|
|
12
13
|
(function (ReimbursementBillingPresentEnum) {
|
|
@@ -25,16 +26,16 @@ var ReimbursementStatusEnum;
|
|
|
25
26
|
ReimbursementStatusEnum["APPROVED"] = "APPROVED";
|
|
26
27
|
ReimbursementStatusEnum["REJECTED"] = "REJECTED";
|
|
27
28
|
ReimbursementStatusEnum["PARTIALLY_APPROVED"] = "PARTIALLY_APPROVED";
|
|
28
|
-
ReimbursementStatusEnum["PAYMENT_PENDING"] = "PAYMENT_PENDING";
|
|
29
29
|
ReimbursementStatusEnum["PAYMENT_DISBURSE"] = "PAYMENT_DISBURSE";
|
|
30
30
|
ReimbursementStatusEnum["DELETED"] = "DELETED";
|
|
31
31
|
})(ReimbursementStatusEnum || (exports.ReimbursementStatusEnum = ReimbursementStatusEnum = {}));
|
|
32
|
-
var
|
|
33
|
-
(function (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
var ReimbursementExpenseState;
|
|
33
|
+
(function (ReimbursementExpenseState) {
|
|
34
|
+
ReimbursementExpenseState["PENDING"] = "pending";
|
|
35
|
+
ReimbursementExpenseState["APPROVED"] = "approved";
|
|
36
|
+
ReimbursementExpenseState["REJECTED"] = "rejected";
|
|
37
|
+
ReimbursementExpenseState["DELETED"] = "deleted";
|
|
38
|
+
})(ReimbursementExpenseState || (exports.ReimbursementExpenseState = ReimbursementExpenseState = {}));
|
|
38
39
|
var ReimbursementPaymentStatusEnum;
|
|
39
40
|
(function (ReimbursementPaymentStatusEnum) {
|
|
40
41
|
ReimbursementPaymentStatusEnum["PAID"] = "PAID";
|
|
@@ -49,18 +50,13 @@ var ReimbursementActionEnum;
|
|
|
49
50
|
ReimbursementActionEnum["REJECT"] = "reject";
|
|
50
51
|
ReimbursementActionEnum["UPDATE_PAYMENT"] = "update_payment";
|
|
51
52
|
})(ReimbursementActionEnum || (exports.ReimbursementActionEnum = ReimbursementActionEnum = {}));
|
|
52
|
-
var
|
|
53
|
-
(function (
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
(function (ReimbursementStatusSubRow) {
|
|
60
|
-
ReimbursementStatusSubRow["APPROVED"] = "approved";
|
|
61
|
-
ReimbursementStatusSubRow["REJECTED"] = "rejected";
|
|
62
|
-
ReimbursementStatusSubRow["PENDING"] = "pending";
|
|
63
|
-
})(ReimbursementStatusSubRow || (exports.ReimbursementStatusSubRow = ReimbursementStatusSubRow = {}));
|
|
53
|
+
var ReimbursementExpenseActionEnum;
|
|
54
|
+
(function (ReimbursementExpenseActionEnum) {
|
|
55
|
+
ReimbursementExpenseActionEnum["PENDING"] = "pending";
|
|
56
|
+
ReimbursementExpenseActionEnum["APPROVE"] = "approve";
|
|
57
|
+
ReimbursementExpenseActionEnum["REJECT"] = "reject";
|
|
58
|
+
ReimbursementExpenseActionEnum["DELETE"] = "delete";
|
|
59
|
+
})(ReimbursementExpenseActionEnum || (exports.ReimbursementExpenseActionEnum = ReimbursementExpenseActionEnum = {}));
|
|
64
60
|
(function (ReimbursementActionEnum) {
|
|
65
61
|
const actionLabelMap = {
|
|
66
62
|
[ReimbursementActionEnum.VIEW]: "View",
|
|
@@ -88,27 +84,28 @@ var ReimbursementStatusSubRow;
|
|
|
88
84
|
}
|
|
89
85
|
ReimbursementActionEnum.getLabel = getLabel;
|
|
90
86
|
})(ReimbursementActionEnum || (exports.ReimbursementActionEnum = ReimbursementActionEnum = {}));
|
|
91
|
-
(function (
|
|
87
|
+
(function (ReimbursementExpenseActionEnum) {
|
|
92
88
|
const actionLabelMap = {
|
|
93
|
-
[
|
|
94
|
-
[
|
|
95
|
-
[
|
|
89
|
+
[ReimbursementExpenseActionEnum.PENDING]: "Pending",
|
|
90
|
+
[ReimbursementExpenseActionEnum.APPROVE]: "Approve",
|
|
91
|
+
[ReimbursementExpenseActionEnum.REJECT]: "Reject",
|
|
92
|
+
[ReimbursementExpenseActionEnum.DELETE]: "delete",
|
|
96
93
|
};
|
|
97
94
|
function getLabel(action) {
|
|
98
|
-
if (!Object.values(
|
|
95
|
+
if (!Object.values(ReimbursementExpenseActionEnum).includes(action)) {
|
|
99
96
|
throw new exceptions_1.AppBadRequestException({
|
|
100
|
-
key: error_key_enum_1.ErrorKeyEnum.
|
|
97
|
+
key: error_key_enum_1.ErrorKeyEnum.REIMBURSEMENT_EXPENSE_FLOW_ACTION,
|
|
101
98
|
message: ["Invalid action value"],
|
|
102
99
|
});
|
|
103
100
|
}
|
|
104
101
|
const label = actionLabelMap[action];
|
|
105
102
|
if (!label) {
|
|
106
103
|
throw new exceptions_1.AppBadRequestException({
|
|
107
|
-
key: error_key_enum_1.ErrorKeyEnum.
|
|
104
|
+
key: error_key_enum_1.ErrorKeyEnum.REIMBURSEMENT_EXPENSE_FLOW_ACTION,
|
|
108
105
|
message: ["Invalid action value"],
|
|
109
106
|
});
|
|
110
107
|
}
|
|
111
108
|
return label;
|
|
112
109
|
}
|
|
113
|
-
|
|
114
|
-
})(
|
|
110
|
+
ReimbursementExpenseActionEnum.getLabel = getLabel;
|
|
111
|
+
})(ReimbursementExpenseActionEnum || (exports.ReimbursementExpenseActionEnum = ReimbursementExpenseActionEnum = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum TimesheetEntityKeysEnum {
|
|
2
|
+
userId = "userId",
|
|
3
|
+
projectId = "projectId",
|
|
4
|
+
task = "task",
|
|
5
|
+
description = "description",
|
|
6
|
+
dateCode = "dateCode",
|
|
7
|
+
totalDuration = "totalDuration",
|
|
8
|
+
status = "status",
|
|
9
|
+
remark = "remark"
|
|
10
|
+
}
|
|
11
|
+
export declare namespace TimesheetEntityKeysEnum {
|
|
12
|
+
const keyLabelMap: Record<TimesheetEntityKeysEnum, string>;
|
|
13
|
+
function getLabel(key: TimesheetEntityKeysEnum): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TimesheetEntityKeysEnum = void 0;
|
|
4
|
+
const error_key_enum_1 = require("../../enums/error.key.enum");
|
|
5
|
+
const exceptions_1 = require("../../exceptions");
|
|
6
|
+
var TimesheetEntityKeysEnum;
|
|
7
|
+
(function (TimesheetEntityKeysEnum) {
|
|
8
|
+
TimesheetEntityKeysEnum["userId"] = "userId";
|
|
9
|
+
TimesheetEntityKeysEnum["projectId"] = "projectId";
|
|
10
|
+
TimesheetEntityKeysEnum["task"] = "task";
|
|
11
|
+
TimesheetEntityKeysEnum["description"] = "description";
|
|
12
|
+
TimesheetEntityKeysEnum["dateCode"] = "dateCode";
|
|
13
|
+
TimesheetEntityKeysEnum["totalDuration"] = "totalDuration";
|
|
14
|
+
TimesheetEntityKeysEnum["status"] = "status";
|
|
15
|
+
TimesheetEntityKeysEnum["remark"] = "remark";
|
|
16
|
+
})(TimesheetEntityKeysEnum || (exports.TimesheetEntityKeysEnum = TimesheetEntityKeysEnum = {}));
|
|
17
|
+
(function (TimesheetEntityKeysEnum) {
|
|
18
|
+
TimesheetEntityKeysEnum.keyLabelMap = {
|
|
19
|
+
[TimesheetEntityKeysEnum.userId]: "User ID",
|
|
20
|
+
[TimesheetEntityKeysEnum.projectId]: "Project ID",
|
|
21
|
+
[TimesheetEntityKeysEnum.task]: "Task",
|
|
22
|
+
[TimesheetEntityKeysEnum.description]: "Description",
|
|
23
|
+
[TimesheetEntityKeysEnum.dateCode]: "Record Date",
|
|
24
|
+
[TimesheetEntityKeysEnum.totalDuration]: "Total Duration",
|
|
25
|
+
[TimesheetEntityKeysEnum.status]: "Status",
|
|
26
|
+
[TimesheetEntityKeysEnum.remark]: "Remark",
|
|
27
|
+
};
|
|
28
|
+
function getLabel(key) {
|
|
29
|
+
if (!Object.values(TimesheetEntityKeysEnum).includes(key)) {
|
|
30
|
+
throw new exceptions_1.AppBadRequestException({
|
|
31
|
+
key: error_key_enum_1.ErrorKeyEnum.TIMESHEET_KEY,
|
|
32
|
+
message: ["Invalid key name"],
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const label = TimesheetEntityKeysEnum.keyLabelMap[key];
|
|
36
|
+
if (!label) {
|
|
37
|
+
throw new exceptions_1.AppBadRequestException({
|
|
38
|
+
key: error_key_enum_1.ErrorKeyEnum.TIMESHEET_KEY,
|
|
39
|
+
message: ["Invalid key name"],
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return label;
|
|
43
|
+
}
|
|
44
|
+
TimesheetEntityKeysEnum.getLabel = getLabel;
|
|
45
|
+
})(TimesheetEntityKeysEnum || (exports.TimesheetEntityKeysEnum = TimesheetEntityKeysEnum = {}));
|
|
@@ -45,3 +45,6 @@ export * from "./enums/billing.action.enum";
|
|
|
45
45
|
export * from "./enums/configuration.type.enum";
|
|
46
46
|
export * from "./enums/project_user_status.enum";
|
|
47
47
|
export * from "./interface/reimbursement_history.entity.interface";
|
|
48
|
+
export * from "./interface/reimbursement_expense.entity.interface";
|
|
49
|
+
export * from "./enums/entity_search_constraint_type.enum";
|
|
50
|
+
export * from "./enums/timesheet_entity_keys.enum";
|
|
@@ -61,3 +61,6 @@ __exportStar(require("./enums/billing.action.enum"), exports);
|
|
|
61
61
|
__exportStar(require("./enums/configuration.type.enum"), exports);
|
|
62
62
|
__exportStar(require("./enums/project_user_status.enum"), exports);
|
|
63
63
|
__exportStar(require("./interface/reimbursement_history.entity.interface"), exports);
|
|
64
|
+
__exportStar(require("./interface/reimbursement_expense.entity.interface"), exports);
|
|
65
|
+
__exportStar(require("./enums/entity_search_constraint_type.enum"), exports);
|
|
66
|
+
__exportStar(require("./enums/timesheet_entity_keys.enum"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReimbursementActionEnum,
|
|
1
|
+
import { ReimbursementActionEnum, ReimbursementBillingPresentEnum, ReimbursementBillingTypeEnum, ReimbursementExpenseActionEnum, ReimbursementExpenseState, ReimbursementIncurredByEnum, ReimbursementPaymentStatusEnum, ReimbursementStatusEnum } from "../enums/reimbursement.entity.enum";
|
|
2
2
|
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
3
3
|
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
|
|
4
4
|
export interface IReimbursementEntity extends IAuditColumnEntity {
|
|
@@ -8,12 +8,7 @@ export interface IReimbursementEntity extends IAuditColumnEntity {
|
|
|
8
8
|
amount: number;
|
|
9
9
|
billNo?: string;
|
|
10
10
|
expenseIncurredBy: ReimbursementIncurredByEnum;
|
|
11
|
-
reimbursementType: string;
|
|
12
11
|
billPresent: ReimbursementBillingPresentEnum;
|
|
13
|
-
split: boolean;
|
|
14
|
-
expenseDetailsJson: string;
|
|
15
|
-
projectIdsCsv: string;
|
|
16
|
-
userIdsCsv: string;
|
|
17
12
|
description: string;
|
|
18
13
|
attachmentUrlsCsv?: string;
|
|
19
14
|
status: ReimbursementStatusEnum;
|
|
@@ -21,24 +16,23 @@ export interface IReimbursementEntity extends IAuditColumnEntity {
|
|
|
21
16
|
amountReimbursed?: number;
|
|
22
17
|
processedBy?: number;
|
|
23
18
|
processedDate?: string;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export interface IReimbursementExpenseDetails {
|
|
27
|
-
members: number[];
|
|
28
|
-
details?: IReimbursementExpenseAllocation[];
|
|
19
|
+
paymentDetails?: string;
|
|
20
|
+
remark?: string;
|
|
29
21
|
}
|
|
30
22
|
export interface IReimbursementExpenseAllocation {
|
|
31
|
-
userId: number
|
|
23
|
+
userId: number;
|
|
32
24
|
projectId: number;
|
|
33
25
|
amount: number;
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
expenseType: string;
|
|
27
|
+
state?: ReimbursementExpenseState;
|
|
28
|
+
action?: ReimbursementExpenseActionEnum;
|
|
29
|
+
remark?: string;
|
|
36
30
|
}
|
|
37
31
|
export interface IReimbursementCreateDtoExtra {
|
|
38
|
-
expenseDetails:
|
|
32
|
+
expenseDetails: IReimbursementExpenseAllocation[];
|
|
39
33
|
attachmentDocumentUrls?: string[];
|
|
40
34
|
}
|
|
41
|
-
export type IReimbursementExclude = "
|
|
35
|
+
export type IReimbursementExclude = "billingType" | "attachmentUrlsCsv" | "amountReimbursed" | "processedBy" | "processedDate";
|
|
42
36
|
export interface IReimbursementEntityCreateDto extends Omit<IEntityCreateDto<IReimbursementEntity>, IReimbursementExclude>, IReimbursementCreateDtoExtra {
|
|
43
37
|
}
|
|
44
38
|
export interface IReimbursementUpdateDto extends IEntityUpdateDto<IReimbursementEntity> {
|
|
@@ -51,5 +45,6 @@ export interface IReimbursementActionDataDto {
|
|
|
51
45
|
remark?: string;
|
|
52
46
|
}
|
|
53
47
|
export interface IReimbursementUpdateDto extends IEntityUpdateDto<IReimbursementEntity> {
|
|
54
|
-
|
|
48
|
+
expenseDetails: IReimbursementExpenseAllocation[];
|
|
49
|
+
actionData?: IReimbursementActionDataDto;
|
|
55
50
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReimbursementExpenseActionEnum, ReimbursementExpenseState } from "../enums/reimbursement.entity.enum";
|
|
2
|
+
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
3
|
+
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
|
|
4
|
+
export interface IReimbursementExpenseEntity extends IAuditColumnEntity {
|
|
5
|
+
id: number;
|
|
6
|
+
reimbursementId: number;
|
|
7
|
+
userId: number;
|
|
8
|
+
projectId: number;
|
|
9
|
+
expenseType: string;
|
|
10
|
+
amount: number;
|
|
11
|
+
state?: ReimbursementExpenseState;
|
|
12
|
+
remark?: string;
|
|
13
|
+
sanctionedBy?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface IReimbursementExpenseEntityCreateDto extends IEntityCreateDto<IReimbursementExpenseEntity> {
|
|
16
|
+
id?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface IReimbursementExpenseEntityUpdateDto extends IEntityUpdateDto<IReimbursementExpenseEntity> {
|
|
19
|
+
id?: number;
|
|
20
|
+
action?: ReimbursementExpenseActionEnum;
|
|
21
|
+
}
|
|
22
|
+
export interface IReimbursementExpenseEntityFilterDto extends IEntityFilterData<IReimbursementExpenseEntity> {
|
|
23
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EntitySearchConstraintTypeEnum } from "../enums/entity_search_constraint_type.enum";
|
|
1
2
|
import { HistoryOperationEnum } from "../enums/history_operation.enum";
|
|
2
3
|
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
3
4
|
import { IEntityCreateDto, IEntityFilterData } from "./entity.utils.interface";
|
|
@@ -14,3 +15,25 @@ export interface ITimesheetHistoryUpdateDto extends IEntityCreateDto<ITimesheetH
|
|
|
14
15
|
export interface ITimesheetHistorySearchDto extends IEntityFilterData<ITimesheetHistoryEntity> {
|
|
15
16
|
}
|
|
16
17
|
export declare const timesheetHistoryExcludeKeys: string[];
|
|
18
|
+
export type IEntitySearchConstraint = {
|
|
19
|
+
entityId: number[];
|
|
20
|
+
constraint: {
|
|
21
|
+
since: IEntitySearchSinceConstraint;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export type IEntitySearchSinceConstraint = {
|
|
25
|
+
type: EntitySearchConstraintTypeEnum;
|
|
26
|
+
columnKey: string;
|
|
27
|
+
value: number;
|
|
28
|
+
};
|
|
29
|
+
export type ITimesheetHistoryParsed = {
|
|
30
|
+
parsedData: any;
|
|
31
|
+
id: number;
|
|
32
|
+
entityId: number;
|
|
33
|
+
operation: HistoryOperationEnum;
|
|
34
|
+
data: string;
|
|
35
|
+
createdOn: Date;
|
|
36
|
+
updatedOn: Date;
|
|
37
|
+
createdBy: number;
|
|
38
|
+
updatedBy: number;
|
|
39
|
+
};
|
|
@@ -3,5 +3,7 @@ export declare enum ErrorKeyEnum {
|
|
|
3
3
|
CURRENCY = "CURRENCY",
|
|
4
4
|
TIMESHEET_FLOW_ACTION = "TIMESHEET_FLOW_ACTION",
|
|
5
5
|
BILLING_FLOW_ACTION = "BILLING_FLOW_ACTION",
|
|
6
|
-
REIMBURSEMENT_FLOW_ACTION = "REIMBURSEMENT_FLOW_ACTION"
|
|
6
|
+
REIMBURSEMENT_FLOW_ACTION = "REIMBURSEMENT_FLOW_ACTION",
|
|
7
|
+
REIMBURSEMENT_EXPENSE_FLOW_ACTION = "REIMBURSEMENT_EXPENSE_FLOW_ACTION",
|
|
8
|
+
TIMESHEET_KEY = "TIMESHEET_KEY"
|
|
7
9
|
}
|
|
@@ -8,4 +8,6 @@ var ErrorKeyEnum;
|
|
|
8
8
|
ErrorKeyEnum["TIMESHEET_FLOW_ACTION"] = "TIMESHEET_FLOW_ACTION";
|
|
9
9
|
ErrorKeyEnum["BILLING_FLOW_ACTION"] = "BILLING_FLOW_ACTION";
|
|
10
10
|
ErrorKeyEnum["REIMBURSEMENT_FLOW_ACTION"] = "REIMBURSEMENT_FLOW_ACTION";
|
|
11
|
+
ErrorKeyEnum["REIMBURSEMENT_EXPENSE_FLOW_ACTION"] = "REIMBURSEMENT_EXPENSE_FLOW_ACTION";
|
|
12
|
+
ErrorKeyEnum["TIMESHEET_KEY"] = "TIMESHEET_KEY";
|
|
11
13
|
})(ErrorKeyEnum || (exports.ErrorKeyEnum = ErrorKeyEnum = {}));
|
|
@@ -6,6 +6,7 @@ export declare function convertMapToObject<K, T>(map: Map<K, T>): {
|
|
|
6
6
|
};
|
|
7
7
|
export declare function removeSamePropertyValues(source: any, target: any): void;
|
|
8
8
|
export declare function getChangedProperties<T>(source: T, target: T): Partial<T>;
|
|
9
|
+
export declare function compareObjects<T extends Record<string, any>>(obj1: T, obj2: T): boolean;
|
|
9
10
|
/**
|
|
10
11
|
* Removes elements from the target array that are present in the source array.
|
|
11
12
|
*
|
|
@@ -14,6 +14,7 @@ exports.groupByOneToOneFunction = groupByOneToOneFunction;
|
|
|
14
14
|
exports.convertMapToObject = convertMapToObject;
|
|
15
15
|
exports.removeSamePropertyValues = removeSamePropertyValues;
|
|
16
16
|
exports.getChangedProperties = getChangedProperties;
|
|
17
|
+
exports.compareObjects = compareObjects;
|
|
17
18
|
exports.removeElementsFromArray = removeElementsFromArray;
|
|
18
19
|
exports.arrayDifference = arrayDifference;
|
|
19
20
|
exports.arrayIntersection = arrayIntersection;
|
|
@@ -70,6 +71,24 @@ function getChangedProperties(source, target) {
|
|
|
70
71
|
}
|
|
71
72
|
return result;
|
|
72
73
|
}
|
|
74
|
+
function compareObjects(obj1, obj2) {
|
|
75
|
+
if (!obj1 || !obj2) {
|
|
76
|
+
return obj1 === obj2;
|
|
77
|
+
}
|
|
78
|
+
const keys1 = Object.keys(obj1);
|
|
79
|
+
const keys2 = Object.keys(obj2);
|
|
80
|
+
if (keys1.length !== keys2.length) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
return keys1.every((key) => {
|
|
84
|
+
const val1 = obj1[key];
|
|
85
|
+
const val2 = obj2[key];
|
|
86
|
+
if (typeof val1 === "object" && typeof val2 === "object") {
|
|
87
|
+
return compareObjects(val1, val2);
|
|
88
|
+
}
|
|
89
|
+
return val1 === val2;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
73
92
|
/**
|
|
74
93
|
* Removes elements from the target array that are present in the source array.
|
|
75
94
|
*
|
|
@@ -35,6 +35,9 @@ class DateCodeModel {
|
|
|
35
35
|
}
|
|
36
36
|
return dateCodes;
|
|
37
37
|
}
|
|
38
|
+
static fromDate(date) {
|
|
39
|
+
return (0, date_fns_1.format)(date, "yyyyMMdd");
|
|
40
|
+
}
|
|
38
41
|
isWithinOffset(offsetInDays) {
|
|
39
42
|
const currentDate = new Date();
|
|
40
43
|
const diffInDays = Math.abs((currentDate.getTime() - this.getDate().getTime()) / (1000 * 3600 * 24));
|
package/package.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "law-common",
|
|
3
|
+
"version": "2.9.2",
|
|
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
|
+
}
|