law-common 2.8.1-beta.0 → 2.8.1-beta.10
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/reimbursement.entity.response.d.ts +23 -1
- 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/entities/enums/reimbursement.entity.enum.d.ts +31 -6
- package/dist/src/entities/enums/reimbursement.entity.enum.js +76 -1
- package/dist/src/entities/index.d.ts +1 -0
- package/dist/src/entities/index.js +1 -0
- package/dist/src/entities/interface/reimbursement.entity.interface.d.ts +11 -3
- package/dist/src/entities/interface/reimbursement_history.entity.interface.d.ts +14 -0
- package/dist/src/entities/interface/reimbursement_history.entity.interface.js +5 -0
- package/dist/src/enums/error.key.enum.d.ts +2 -1
- package/dist/src/enums/error.key.enum.js +1 -0
- package/package.json +1 -1
package/dist/src/api/index.d.ts
CHANGED
|
@@ -61,3 +61,4 @@ 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";
|
package/dist/src/api/index.js
CHANGED
|
@@ -77,3 +77,4 @@ __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);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IApiEntity, IReimbursementEntity } from "../../entities";
|
|
1
|
+
import { IApiEntity, IReimbursementEntity, ReimbursementActionEnum, ReimbursementActionSubRowEnum, ReimbursementStatusEnum, ReimbursementStatusSubRow } from "../../entities";
|
|
2
2
|
import { IProjectEntityGet } from "./project.entity.response";
|
|
3
3
|
import { IUserApiEntity } from "./user.entity.api";
|
|
4
4
|
export type IReimbursementApiEntity = IApiEntity<IReimbursementEntity>;
|
|
@@ -10,3 +10,25 @@ export type IReimbursementEntityGet = {
|
|
|
10
10
|
};
|
|
11
11
|
projects: IProjectEntityGet;
|
|
12
12
|
};
|
|
13
|
+
export type IReimbursementFlowConfig = {
|
|
14
|
+
parent: {
|
|
15
|
+
[key in ReimbursementStatusEnum]?: {
|
|
16
|
+
actions: {
|
|
17
|
+
[key in ReimbursementActionEnum]?: {
|
|
18
|
+
permissions: string[];
|
|
19
|
+
next?: (newReimbursementEntity: IReimbursementEntity) => ReimbursementStatusEnum;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
child: {
|
|
25
|
+
[key in ReimbursementStatusSubRow]?: {
|
|
26
|
+
actions: {
|
|
27
|
+
[key in ReimbursementActionSubRowEnum]?: {
|
|
28
|
+
permissions: string[];
|
|
29
|
+
next?: () => ReimbursementStatusSubRow;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -12,12 +12,13 @@ export declare enum ReimbursementIncurredByEnum {
|
|
|
12
12
|
OTHERS = "OTHERS"
|
|
13
13
|
}
|
|
14
14
|
export declare enum ReimbursementStatusEnum {
|
|
15
|
-
APPROVAL_PENDING = "APPROVAL_PENDING"
|
|
16
|
-
APPROVED = "APPROVED"
|
|
17
|
-
REJECTED = "REJECTED"
|
|
18
|
-
PARTIALLY_APPROVED = "PARTIALLY_APPROVED"
|
|
19
|
-
PAYMENT_PENDING = "PAYMENT_PENDING"
|
|
20
|
-
PAYMENT_DISBURSE = "PAYMENT_DISBURSE"
|
|
15
|
+
APPROVAL_PENDING = "APPROVAL_PENDING",
|
|
16
|
+
APPROVED = "APPROVED",
|
|
17
|
+
REJECTED = "REJECTED",
|
|
18
|
+
PARTIALLY_APPROVED = "PARTIALLY_APPROVED",
|
|
19
|
+
PAYMENT_PENDING = "PAYMENT_PENDING",
|
|
20
|
+
PAYMENT_DISBURSE = "PAYMENT_DISBURSE",
|
|
21
|
+
DELETED = "DELETED"
|
|
21
22
|
}
|
|
22
23
|
export declare enum ReimbursementSubRowState {
|
|
23
24
|
PENDING = "pending",
|
|
@@ -28,3 +29,27 @@ export declare enum ReimbursementPaymentStatusEnum {
|
|
|
28
29
|
PAID = "PAID",
|
|
29
30
|
UNPAID = "UNPAID"
|
|
30
31
|
}
|
|
32
|
+
export declare enum ReimbursementActionEnum {
|
|
33
|
+
VIEW = "view",
|
|
34
|
+
EDIT = "edit",
|
|
35
|
+
DELETE = "delete",
|
|
36
|
+
APPROVE = "approve",
|
|
37
|
+
REJECT = "reject",
|
|
38
|
+
UPDATE_PAYMENT = "update_payment"
|
|
39
|
+
}
|
|
40
|
+
export declare enum ReimbursementActionSubRowEnum {
|
|
41
|
+
PENDING = "pending",
|
|
42
|
+
APPROVE = "approve",
|
|
43
|
+
REJECT = "reject"
|
|
44
|
+
}
|
|
45
|
+
export declare enum ReimbursementStatusSubRow {
|
|
46
|
+
APPROVED = "approved",
|
|
47
|
+
REJECTED = "rejected",
|
|
48
|
+
PENDING = "pending"
|
|
49
|
+
}
|
|
50
|
+
export declare namespace ReimbursementActionEnum {
|
|
51
|
+
function getLabel(action: ReimbursementActionEnum): string;
|
|
52
|
+
}
|
|
53
|
+
export declare namespace ReimbursementActionSubRowEnum {
|
|
54
|
+
function getLabel(action: ReimbursementActionSubRowEnum): string;
|
|
55
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReimbursementPaymentStatusEnum = exports.ReimbursementSubRowState = exports.ReimbursementStatusEnum = exports.ReimbursementIncurredByEnum = exports.ReimbursementBillingPresentEnum = exports.ReimbursementBillingTypeEnum = void 0;
|
|
3
|
+
exports.ReimbursementStatusSubRow = exports.ReimbursementActionSubRowEnum = exports.ReimbursementActionEnum = exports.ReimbursementPaymentStatusEnum = exports.ReimbursementSubRowState = exports.ReimbursementStatusEnum = exports.ReimbursementIncurredByEnum = exports.ReimbursementBillingPresentEnum = exports.ReimbursementBillingTypeEnum = void 0;
|
|
4
|
+
const error_key_enum_1 = require("../../enums/error.key.enum");
|
|
5
|
+
const exceptions_1 = require("../../exceptions");
|
|
4
6
|
var ReimbursementBillingTypeEnum;
|
|
5
7
|
(function (ReimbursementBillingTypeEnum) {
|
|
6
8
|
ReimbursementBillingTypeEnum["BILLABLE"] = "BILLABLE";
|
|
@@ -25,6 +27,7 @@ var ReimbursementStatusEnum;
|
|
|
25
27
|
ReimbursementStatusEnum["PARTIALLY_APPROVED"] = "PARTIALLY_APPROVED";
|
|
26
28
|
ReimbursementStatusEnum["PAYMENT_PENDING"] = "PAYMENT_PENDING";
|
|
27
29
|
ReimbursementStatusEnum["PAYMENT_DISBURSE"] = "PAYMENT_DISBURSE";
|
|
30
|
+
ReimbursementStatusEnum["DELETED"] = "DELETED";
|
|
28
31
|
})(ReimbursementStatusEnum || (exports.ReimbursementStatusEnum = ReimbursementStatusEnum = {}));
|
|
29
32
|
var ReimbursementSubRowState;
|
|
30
33
|
(function (ReimbursementSubRowState) {
|
|
@@ -37,3 +40,75 @@ var ReimbursementPaymentStatusEnum;
|
|
|
37
40
|
ReimbursementPaymentStatusEnum["PAID"] = "PAID";
|
|
38
41
|
ReimbursementPaymentStatusEnum["UNPAID"] = "UNPAID";
|
|
39
42
|
})(ReimbursementPaymentStatusEnum || (exports.ReimbursementPaymentStatusEnum = ReimbursementPaymentStatusEnum = {}));
|
|
43
|
+
var ReimbursementActionEnum;
|
|
44
|
+
(function (ReimbursementActionEnum) {
|
|
45
|
+
ReimbursementActionEnum["VIEW"] = "view";
|
|
46
|
+
ReimbursementActionEnum["EDIT"] = "edit";
|
|
47
|
+
ReimbursementActionEnum["DELETE"] = "delete";
|
|
48
|
+
ReimbursementActionEnum["APPROVE"] = "approve";
|
|
49
|
+
ReimbursementActionEnum["REJECT"] = "reject";
|
|
50
|
+
ReimbursementActionEnum["UPDATE_PAYMENT"] = "update_payment";
|
|
51
|
+
})(ReimbursementActionEnum || (exports.ReimbursementActionEnum = ReimbursementActionEnum = {}));
|
|
52
|
+
var ReimbursementActionSubRowEnum;
|
|
53
|
+
(function (ReimbursementActionSubRowEnum) {
|
|
54
|
+
ReimbursementActionSubRowEnum["PENDING"] = "pending";
|
|
55
|
+
ReimbursementActionSubRowEnum["APPROVE"] = "approve";
|
|
56
|
+
ReimbursementActionSubRowEnum["REJECT"] = "reject";
|
|
57
|
+
})(ReimbursementActionSubRowEnum || (exports.ReimbursementActionSubRowEnum = ReimbursementActionSubRowEnum = {}));
|
|
58
|
+
var ReimbursementStatusSubRow;
|
|
59
|
+
(function (ReimbursementStatusSubRow) {
|
|
60
|
+
ReimbursementStatusSubRow["APPROVED"] = "approved";
|
|
61
|
+
ReimbursementStatusSubRow["REJECTED"] = "rejected";
|
|
62
|
+
ReimbursementStatusSubRow["PENDING"] = "pending";
|
|
63
|
+
})(ReimbursementStatusSubRow || (exports.ReimbursementStatusSubRow = ReimbursementStatusSubRow = {}));
|
|
64
|
+
(function (ReimbursementActionEnum) {
|
|
65
|
+
const actionLabelMap = {
|
|
66
|
+
[ReimbursementActionEnum.VIEW]: "View",
|
|
67
|
+
[ReimbursementActionEnum.EDIT]: "Edit",
|
|
68
|
+
[ReimbursementActionEnum.DELETE]: "Delete",
|
|
69
|
+
[ReimbursementActionEnum.APPROVE]: "Approve",
|
|
70
|
+
[ReimbursementActionEnum.REJECT]: "Reject",
|
|
71
|
+
[ReimbursementActionEnum.UPDATE_PAYMENT]: "Update Payment",
|
|
72
|
+
};
|
|
73
|
+
function getLabel(action) {
|
|
74
|
+
if (!Object.values(ReimbursementActionEnum).includes(action)) {
|
|
75
|
+
throw new exceptions_1.AppBadRequestException({
|
|
76
|
+
key: error_key_enum_1.ErrorKeyEnum.REIMBURSEMENT_FLOW_ACTION,
|
|
77
|
+
message: ["Invalid action value"],
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const label = actionLabelMap[action];
|
|
81
|
+
if (!label) {
|
|
82
|
+
throw new exceptions_1.AppBadRequestException({
|
|
83
|
+
key: error_key_enum_1.ErrorKeyEnum.REIMBURSEMENT_FLOW_ACTION,
|
|
84
|
+
message: ["Invalid action value"],
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return label;
|
|
88
|
+
}
|
|
89
|
+
ReimbursementActionEnum.getLabel = getLabel;
|
|
90
|
+
})(ReimbursementActionEnum || (exports.ReimbursementActionEnum = ReimbursementActionEnum = {}));
|
|
91
|
+
(function (ReimbursementActionSubRowEnum) {
|
|
92
|
+
const actionLabelMap = {
|
|
93
|
+
[ReimbursementActionSubRowEnum.PENDING]: "Pending",
|
|
94
|
+
[ReimbursementActionSubRowEnum.APPROVE]: "Approve",
|
|
95
|
+
[ReimbursementActionSubRowEnum.REJECT]: "Reject",
|
|
96
|
+
};
|
|
97
|
+
function getLabel(action) {
|
|
98
|
+
if (!Object.values(ReimbursementActionSubRowEnum).includes(action)) {
|
|
99
|
+
throw new exceptions_1.AppBadRequestException({
|
|
100
|
+
key: error_key_enum_1.ErrorKeyEnum.REIMBURSEMENT_FLOW_ACTION,
|
|
101
|
+
message: ["Invalid action value"],
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
const label = actionLabelMap[action];
|
|
105
|
+
if (!label) {
|
|
106
|
+
throw new exceptions_1.AppBadRequestException({
|
|
107
|
+
key: error_key_enum_1.ErrorKeyEnum.REIMBURSEMENT_FLOW_ACTION,
|
|
108
|
+
message: ["Invalid action value"],
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return label;
|
|
112
|
+
}
|
|
113
|
+
ReimbursementActionSubRowEnum.getLabel = getLabel;
|
|
114
|
+
})(ReimbursementActionSubRowEnum || (exports.ReimbursementActionSubRowEnum = ReimbursementActionSubRowEnum = {}));
|
|
@@ -60,3 +60,4 @@ __exportStar(require("./enums/timesheet.action.enum"), exports);
|
|
|
60
60
|
__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
|
+
__exportStar(require("./interface/reimbursement_history.entity.interface"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReimbursementBillingPresentEnum, ReimbursementBillingTypeEnum, ReimbursementIncurredByEnum, ReimbursementPaymentStatusEnum, ReimbursementStatusEnum, ReimbursementSubRowState } from "../enums/reimbursement.entity.enum";
|
|
1
|
+
import { ReimbursementActionEnum, ReimbursementActionSubRowEnum, ReimbursementBillingPresentEnum, ReimbursementBillingTypeEnum, ReimbursementIncurredByEnum, ReimbursementPaymentStatusEnum, ReimbursementStatusEnum, ReimbursementSubRowState } 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 {
|
|
@@ -28,10 +28,11 @@ export interface IReimbursementExpenseDetails {
|
|
|
28
28
|
details?: IReimbursementExpenseAllocation[];
|
|
29
29
|
}
|
|
30
30
|
export interface IReimbursementExpenseAllocation {
|
|
31
|
-
|
|
31
|
+
userId: number;
|
|
32
32
|
projectId: number;
|
|
33
33
|
amount: number;
|
|
34
|
-
state
|
|
34
|
+
state?: ReimbursementSubRowState;
|
|
35
|
+
action?: ReimbursementActionSubRowEnum;
|
|
35
36
|
}
|
|
36
37
|
export interface IReimbursementCreateDtoExtra {
|
|
37
38
|
expenseDetails: IReimbursementExpenseDetails;
|
|
@@ -45,3 +46,10 @@ export interface IReimbursementUpdateDto extends IEntityUpdateDto<IReimbursement
|
|
|
45
46
|
export interface IReimbursementEntityFilterDto extends IEntityFilterData<IReimbursementEntity> {
|
|
46
47
|
createdBy?: number[];
|
|
47
48
|
}
|
|
49
|
+
export interface IReimbursementActionDataDto {
|
|
50
|
+
action: ReimbursementActionEnum;
|
|
51
|
+
remark?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface IReimbursementUpdateDto extends IEntityUpdateDto<IReimbursementEntity> {
|
|
54
|
+
actionData: IReimbursementActionDataDto;
|
|
55
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HistoryOperationEnum } from "../enums/history_operation.enum";
|
|
2
|
+
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
3
|
+
import { IEntityCreateDto, IEntityFilterData } from "./entity.utils.interface";
|
|
4
|
+
export interface IReimbursementHistoryEntity extends IAuditColumnEntity {
|
|
5
|
+
id: number;
|
|
6
|
+
entityId: number;
|
|
7
|
+
operation: HistoryOperationEnum;
|
|
8
|
+
data: string;
|
|
9
|
+
}
|
|
10
|
+
export interface IReimbursementHistoryCreateDto extends IEntityCreateDto<IReimbursementHistoryEntity> {
|
|
11
|
+
}
|
|
12
|
+
export interface IReimbursementHistorySearchDto extends IEntityFilterData<IReimbursementHistoryEntity> {
|
|
13
|
+
}
|
|
14
|
+
export declare const reimbursementHistoryExcludeKeys: string[];
|
|
@@ -2,5 +2,6 @@ export declare enum ErrorKeyEnum {
|
|
|
2
2
|
TIME_UNIT = "TIME_UNIT",
|
|
3
3
|
CURRENCY = "CURRENCY",
|
|
4
4
|
TIMESHEET_FLOW_ACTION = "TIMESHEET_FLOW_ACTION",
|
|
5
|
-
BILLING_FLOW_ACTION = "BILLING_FLOW_ACTION"
|
|
5
|
+
BILLING_FLOW_ACTION = "BILLING_FLOW_ACTION",
|
|
6
|
+
REIMBURSEMENT_FLOW_ACTION = "REIMBURSEMENT_FLOW_ACTION"
|
|
6
7
|
}
|
|
@@ -7,4 +7,5 @@ var ErrorKeyEnum;
|
|
|
7
7
|
ErrorKeyEnum["CURRENCY"] = "CURRENCY";
|
|
8
8
|
ErrorKeyEnum["TIMESHEET_FLOW_ACTION"] = "TIMESHEET_FLOW_ACTION";
|
|
9
9
|
ErrorKeyEnum["BILLING_FLOW_ACTION"] = "BILLING_FLOW_ACTION";
|
|
10
|
+
ErrorKeyEnum["REIMBURSEMENT_FLOW_ACTION"] = "REIMBURSEMENT_FLOW_ACTION";
|
|
10
11
|
})(ErrorKeyEnum || (exports.ErrorKeyEnum = ErrorKeyEnum = {}));
|