law-common 2.5.1-beta.7 → 2.6.1-beta.0
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.
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BillingActionsEnum = void 0;
|
|
4
|
+
const error_key_enum_1 = require("../../enums/error.key.enum");
|
|
5
|
+
const exceptions_1 = require("../../exceptions");
|
|
4
6
|
var BillingActionsEnum;
|
|
5
7
|
(function (BillingActionsEnum) {
|
|
6
8
|
BillingActionsEnum["APPROVE"] = "approve";
|
|
@@ -17,3 +19,37 @@ var BillingActionsEnum;
|
|
|
17
19
|
BillingActionsEnum["WRITE_OFF"] = "writeOff";
|
|
18
20
|
BillingActionsEnum["TDS"] = "tds";
|
|
19
21
|
})(BillingActionsEnum || (exports.BillingActionsEnum = BillingActionsEnum = {}));
|
|
22
|
+
(function (BillingActionsEnum) {
|
|
23
|
+
const actionLabelMap = {
|
|
24
|
+
[BillingActionsEnum.APPROVE]: "Approve",
|
|
25
|
+
[BillingActionsEnum.REJECT]: "Reject",
|
|
26
|
+
[BillingActionsEnum.EDIT]: "Edit",
|
|
27
|
+
[BillingActionsEnum.REQUEST_FOR_CHANGES]: "Request for Changes",
|
|
28
|
+
[BillingActionsEnum.SENT_FOR_APPROVAL]: "Sent for Approval",
|
|
29
|
+
[BillingActionsEnum.SEND_FOR_CLIENT_REVIEW]: "Send for Client Review",
|
|
30
|
+
[BillingActionsEnum.CLIENT_REVISION]: "Client Revision",
|
|
31
|
+
[BillingActionsEnum.SEND_INVOICE]: "Send Invoice",
|
|
32
|
+
[BillingActionsEnum.APPROVAL]: "Approval",
|
|
33
|
+
[BillingActionsEnum.UPDATE_PAYMENT]: "Update Payment",
|
|
34
|
+
[BillingActionsEnum.CREDIT_NOTE]: "Credit Note",
|
|
35
|
+
[BillingActionsEnum.WRITE_OFF]: "Write Off",
|
|
36
|
+
[BillingActionsEnum.TDS]: "TDS",
|
|
37
|
+
};
|
|
38
|
+
function getLabel(action) {
|
|
39
|
+
if (!Object.values(BillingActionsEnum).includes(action)) {
|
|
40
|
+
throw new exceptions_1.AppBadRequestException({
|
|
41
|
+
key: error_key_enum_1.ErrorKeyEnum.BILLING_FLOW_ACTION,
|
|
42
|
+
message: ["Invalid action value"],
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const label = actionLabelMap[action];
|
|
46
|
+
if (!label) {
|
|
47
|
+
throw new exceptions_1.AppBadRequestException({
|
|
48
|
+
key: error_key_enum_1.ErrorKeyEnum.BILLING_FLOW_ACTION,
|
|
49
|
+
message: ["Invalid action value"],
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return label;
|
|
53
|
+
}
|
|
54
|
+
BillingActionsEnum.getLabel = getLabel;
|
|
55
|
+
})(BillingActionsEnum || (exports.BillingActionsEnum = BillingActionsEnum = {}));
|
|
@@ -6,4 +6,5 @@ var ErrorKeyEnum;
|
|
|
6
6
|
ErrorKeyEnum["TIME_UNIT"] = "TIME_UNIT";
|
|
7
7
|
ErrorKeyEnum["CURRENCY"] = "CURRENCY";
|
|
8
8
|
ErrorKeyEnum["TIMESHEET_FLOW_ACTION"] = "TIMESHEET_FLOW_ACTION";
|
|
9
|
+
ErrorKeyEnum["BILLING_FLOW_ACTION"] = "BILLING_FLOW_ACTION";
|
|
9
10
|
})(ErrorKeyEnum || (exports.ErrorKeyEnum = ErrorKeyEnum = {}));
|