law-common 2.9.0 → 2.9.2-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.
@@ -64,3 +64,4 @@ export * from "./interface/billing_timesheet_history.api";
64
64
  export * from "./interface/reimbursement_history.api";
65
65
  export * from "./interface/reimbursement_expense.api";
66
66
  export * from "./interface/timesheet_history_entity.response";
67
+ export * from "./interface/bank_history.api";
@@ -80,3 +80,4 @@ __exportStar(require("./interface/billing_timesheet_history.api"), exports);
80
80
  __exportStar(require("./interface/reimbursement_history.api"), exports);
81
81
  __exportStar(require("./interface/reimbursement_expense.api"), exports);
82
82
  __exportStar(require("./interface/timesheet_history_entity.response"), exports);
83
+ __exportStar(require("./interface/bank_history.api"), exports);
@@ -1,4 +1,15 @@
1
+ import { BankActionEnum, BankStatusEnum } from "../../entities";
1
2
  import { IBankApiEntity } from "./bank.entity.api";
2
3
  import { IBaseResponse } from "./base.response.interface";
3
4
  export type IBankApiEntityResponse = IBaseResponse<IBankApiEntity>;
4
5
  export type IBankApiEntityResponseArray = IBaseResponse<IBankApiEntity[]>;
6
+ export type IBankFlowConfig = {
7
+ [key in BankStatusEnum]?: {
8
+ actions: {
9
+ [key in BankActionEnum]?: {
10
+ permissions: string[];
11
+ next: () => BankStatusEnum;
12
+ };
13
+ };
14
+ };
15
+ };
@@ -1,3 +1,4 @@
1
- import { IBankEntity, IEntityUpdateDto } from "../../entities";
1
+ import { IBankActionDataDto, IBankEntity, IEntityUpdateDto } from "../../entities";
2
2
  export interface IBankUpdateDto extends IEntityUpdateDto<IBankEntity> {
3
+ actionData?: IBankActionDataDto;
3
4
  }
@@ -0,0 +1,3 @@
1
+ import { IApiEntity, IBankHistoryEntity } from "../../entities";
2
+ export type IBankHistoryApiEntity = IApiEntity<IBankHistoryEntity>;
3
+ export type IBankHistoryApiEntityArray = IBankHistoryApiEntity[];
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ export declare enum BankActionEnum {
2
+ VIEW = "view",
3
+ EDIT = "edit",
4
+ DELETE = "delete",
5
+ CREATE = "create",
6
+ APPROVE = "approve",
7
+ REJECT = "reject",
8
+ RECALL = "recall"
9
+ }
10
+ export declare namespace BankActionEnum {
11
+ function getLabel(action: BankActionEnum): string;
12
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BankActionEnum = void 0;
4
+ const error_key_enum_1 = require("../../enums/error.key.enum");
5
+ const exceptions_1 = require("../../exceptions");
6
+ var BankActionEnum;
7
+ (function (BankActionEnum) {
8
+ BankActionEnum["VIEW"] = "view";
9
+ BankActionEnum["EDIT"] = "edit";
10
+ BankActionEnum["DELETE"] = "delete";
11
+ BankActionEnum["CREATE"] = "create";
12
+ BankActionEnum["APPROVE"] = "approve";
13
+ BankActionEnum["REJECT"] = "reject";
14
+ BankActionEnum["RECALL"] = "recall";
15
+ })(BankActionEnum || (exports.BankActionEnum = BankActionEnum = {}));
16
+ (function (BankActionEnum) {
17
+ const actionLabelMap = {
18
+ [BankActionEnum.APPROVE]: "Approve",
19
+ [BankActionEnum.VIEW]: "View",
20
+ [BankActionEnum.EDIT]: "Edit",
21
+ [BankActionEnum.DELETE]: "Delete",
22
+ [BankActionEnum.CREATE]: "Create",
23
+ [BankActionEnum.REJECT]: "Reject",
24
+ [BankActionEnum.RECALL]: "Recall",
25
+ };
26
+ function getLabel(action) {
27
+ if (!Object.values(BankActionEnum).includes(action)) {
28
+ throw new exceptions_1.AppBadRequestException({
29
+ key: error_key_enum_1.ErrorKeyEnum.BANK_FLOW_ACTION,
30
+ message: ["Invalid action value"],
31
+ });
32
+ }
33
+ const label = actionLabelMap[action];
34
+ if (!label) {
35
+ throw new exceptions_1.AppBadRequestException({
36
+ key: error_key_enum_1.ErrorKeyEnum.BANK_FLOW_ACTION,
37
+ message: ["Invalid action value"],
38
+ });
39
+ }
40
+ return label;
41
+ }
42
+ BankActionEnum.getLabel = getLabel;
43
+ })(BankActionEnum || (exports.BankActionEnum = BankActionEnum = {}));
@@ -0,0 +1,13 @@
1
+ export declare enum BankStatusEnum {
2
+ CREATE_APPROVAL = "create_approval",
3
+ EDIT_APPROVAL = "edit_approval",
4
+ DELETE_APPROVAL = "delete_approval",
5
+ REJECTED = "rejected",
6
+ APPROVED = "approved",
7
+ DELETED = "deleted",
8
+ RESOLVED_REJECTED = "resolved_rejected"
9
+ }
10
+ export declare namespace BankStatusEnum {
11
+ function getNames(): string[];
12
+ function parse(value: string): BankStatusEnum;
13
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BankStatusEnum = void 0;
4
+ var BankStatusEnum;
5
+ (function (BankStatusEnum) {
6
+ BankStatusEnum["CREATE_APPROVAL"] = "create_approval";
7
+ BankStatusEnum["EDIT_APPROVAL"] = "edit_approval";
8
+ BankStatusEnum["DELETE_APPROVAL"] = "delete_approval";
9
+ BankStatusEnum["REJECTED"] = "rejected";
10
+ BankStatusEnum["APPROVED"] = "approved";
11
+ BankStatusEnum["DELETED"] = "deleted";
12
+ BankStatusEnum["RESOLVED_REJECTED"] = "resolved_rejected";
13
+ })(BankStatusEnum || (exports.BankStatusEnum = BankStatusEnum = {}));
14
+ (function (BankStatusEnum) {
15
+ function getNames() {
16
+ return Object.values(BankStatusEnum).filter((value) => typeof value === "string");
17
+ }
18
+ BankStatusEnum.getNames = getNames;
19
+ function parse(value) {
20
+ if (Object.values(BankStatusEnum).includes(value)) {
21
+ return value;
22
+ }
23
+ throw new Error("Invalid bank details status");
24
+ }
25
+ BankStatusEnum.parse = parse;
26
+ })(BankStatusEnum || (exports.BankStatusEnum = BankStatusEnum = {}));
@@ -48,3 +48,6 @@ export * from "./interface/reimbursement_history.entity.interface";
48
48
  export * from "./interface/reimbursement_expense.entity.interface";
49
49
  export * from "./enums/entity_search_constraint_type.enum";
50
50
  export * from "./enums/timesheet_entity_keys.enum";
51
+ export * from "./enums/bank_action.enum";
52
+ export * from "./enums/bank_status.enum";
53
+ export * from "./interface/bank_history.entity.interface";
@@ -64,3 +64,6 @@ __exportStar(require("./interface/reimbursement_history.entity.interface"), expo
64
64
  __exportStar(require("./interface/reimbursement_expense.entity.interface"), exports);
65
65
  __exportStar(require("./enums/entity_search_constraint_type.enum"), exports);
66
66
  __exportStar(require("./enums/timesheet_entity_keys.enum"), exports);
67
+ __exportStar(require("./enums/bank_action.enum"), exports);
68
+ __exportStar(require("./enums/bank_status.enum"), exports);
69
+ __exportStar(require("./interface/bank_history.entity.interface"), exports);
@@ -1,3 +1,5 @@
1
+ import { BankActionEnum } from "../enums/bank_action.enum";
2
+ import { BankStatusEnum } from "../enums/bank_status.enum";
1
3
  import { IAuditColumnEntity } from "./audit-column.entity.interface";
2
4
  import { IEntityFilterData } from "./entity.utils.interface";
3
5
  export interface IBankEntity extends IAuditColumnEntity {
@@ -9,6 +11,12 @@ export interface IBankEntity extends IAuditColumnEntity {
9
11
  branchAddress: string;
10
12
  micrCode: string;
11
13
  ifscCode: string;
12
- emailForPaymentInfo: string;
14
+ emailForPaymentInfoCsv: string;
15
+ status?: BankStatusEnum;
16
+ remark?: string;
17
+ }
18
+ export interface IBankActionDataDto {
19
+ action: BankActionEnum;
20
+ remark?: string;
13
21
  }
14
22
  export type IBankEntityFilterData = IEntityFilterData<IBankEntity>;
@@ -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 IBankHistoryEntity extends IAuditColumnEntity {
5
+ id: number;
6
+ entityId: number;
7
+ operation: HistoryOperationEnum;
8
+ data: string;
9
+ }
10
+ export interface IBankHistoryCreateDto extends IEntityCreateDto<IBankHistoryEntity> {
11
+ }
12
+ export interface IBankHistorySearchDto extends IEntityFilterData<IBankHistoryEntity> {
13
+ }
14
+ export declare const bankHistoryExcludeKeys: string[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bankHistoryExcludeKeys = void 0;
4
+ const constants_1 = require("../../constants");
5
+ exports.bankHistoryExcludeKeys = [...constants_1.historyKeysToExclude];
@@ -5,5 +5,6 @@ export declare enum ErrorKeyEnum {
5
5
  BILLING_FLOW_ACTION = "BILLING_FLOW_ACTION",
6
6
  REIMBURSEMENT_FLOW_ACTION = "REIMBURSEMENT_FLOW_ACTION",
7
7
  REIMBURSEMENT_EXPENSE_FLOW_ACTION = "REIMBURSEMENT_EXPENSE_FLOW_ACTION",
8
- TIMESHEET_KEY = "TIMESHEET_KEY"
8
+ TIMESHEET_KEY = "TIMESHEET_KEY",
9
+ BANK_FLOW_ACTION = "BANK_FLOW_ACTION"
9
10
  }
@@ -10,4 +10,5 @@ var ErrorKeyEnum;
10
10
  ErrorKeyEnum["REIMBURSEMENT_FLOW_ACTION"] = "REIMBURSEMENT_FLOW_ACTION";
11
11
  ErrorKeyEnum["REIMBURSEMENT_EXPENSE_FLOW_ACTION"] = "REIMBURSEMENT_EXPENSE_FLOW_ACTION";
12
12
  ErrorKeyEnum["TIMESHEET_KEY"] = "TIMESHEET_KEY";
13
+ ErrorKeyEnum["BANK_FLOW_ACTION"] = "BANK_FLOW_ACTION";
13
14
  })(ErrorKeyEnum || (exports.ErrorKeyEnum = ErrorKeyEnum = {}));
package/package.json CHANGED
@@ -1,35 +1,35 @@
1
1
  {
2
- "name": "law-common",
3
- "version": "2.9.0",
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
- }
2
+ "name": "law-common",
3
+ "version": "2.9.2-beta.4",
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
35
  }