law-common 14.1.4-beta.1 → 14.1.4-beta.11
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 +0 -4
- package/dist/src/api/index.js +0 -4
- package/dist/src/api/interface/bank.entity.response.d.ts +4 -4
- package/dist/src/api/v1/index.d.ts +4 -0
- package/dist/src/api/v1/index.js +4 -0
- package/dist/src/api/{interface → v1/interface}/bank.create.dto.interface.d.ts +1 -1
- package/dist/src/api/{interface → v1/interface}/bank.update.dto.interface.d.ts +1 -1
- package/dist/src/api/{interface → v1/interface}/intermediary_bank.create.dto.interface.d.ts +1 -1
- package/dist/src/api/{interface → v1/interface}/intermediary_bank.update.dto.interface.d.ts +1 -1
- package/dist/src/api/v2/index.d.ts +13 -5
- package/dist/src/api/v2/index.js +13 -7
- package/dist/src/api/v2/interface/bank.create.dto.interface.d.ts +7 -0
- package/dist/src/api/v2/interface/bank.create.dto.interface.js +2 -0
- package/dist/src/api/v2/interface/bank.update.dto.interface.d.ts +12 -0
- package/dist/src/api/v2/interface/bank.update.dto.interface.js +2 -0
- package/dist/src/api/v2/interface/intermediary_bank.create.dto.interface.d.ts +5 -0
- package/dist/src/api/v2/interface/intermediary_bank.create.dto.interface.js +2 -0
- package/dist/src/api/v2/interface/intermediary_bank.update.dto.interface.d.ts +12 -0
- package/dist/src/api/v2/interface/intermediary_bank.update.dto.interface.js +2 -0
- package/dist/src/api/v2/interface/task.create.dto.interface.d.ts +5 -0
- package/dist/src/api/v2/interface/task.create.dto.interface.js +2 -0
- package/dist/src/api/v2/interface/task.update.dto.interface.d.ts +12 -0
- package/dist/src/api/v2/interface/task.update.dto.interface.js +2 -0
- package/dist/src/entities/enums/bank_action_enum.d.ts +6 -2
- package/dist/src/entities/enums/bank_action_enum.js +10 -2
- package/dist/src/entities/enums/bank_status_enum.d.ts +3 -1
- package/dist/src/entities/enums/bank_status_enum.js +2 -0
- package/dist/src/entities/flow-configs/bank_flow.config.d.ts +61 -1
- package/dist/src/entities/flow-configs/bank_flow.config.js +44 -17
- package/dist/src/entities/flow-configs/country_flow.config.d.ts +33 -0
- package/dist/src/entities/flow-configs/country_flow.config.js +14 -3
- package/dist/src/entities/flow-configs/designation_flow.config.d.ts +33 -0
- package/dist/src/entities/flow-configs/designation_flow.config.js +14 -3
- package/dist/src/entities/flow-configs/industry_flow.config.d.ts +33 -0
- package/dist/src/entities/flow-configs/industry_flow.config.js +14 -3
- package/dist/src/entities/flow-configs/intermediary_bank_flow.config.d.ts +33 -0
- package/dist/src/entities/flow-configs/intermediary_bank_flow.config.js +13 -3
- package/dist/src/entities/flow-configs/office_location_flow.config.d.ts +33 -0
- package/dist/src/entities/flow-configs/office_location_flow.config.js +13 -3
- package/dist/src/entities/flow-configs/rate_flow.config.d.ts +33 -0
- package/dist/src/entities/flow-configs/rate_flow.config.js +14 -3
- package/dist/src/entities/flow-configs/task_flow.config.d.ts +33 -0
- package/dist/src/entities/flow-configs/task_flow.config.js +14 -3
- package/dist/src/entities/flow-configs/to_do_list_flow.config.d.ts +33 -0
- package/dist/src/entities/flow-configs/to_do_list_flow.config.js +16 -3
- package/dist/src/entities/flow-configs/utils/flow-config.utils.d.ts +313 -0
- package/dist/src/entities/flow-configs/utils/flow-config.utils.js +18 -0
- package/dist/src/entities/index.d.ts +9 -9
- package/dist/src/entities/index.js +28 -10
- package/dist/src/entities/interface/bank.entity.interface.d.ts +5 -4
- package/dist/src/entities/interface/field-constraint/bank_field_constraints.interface.d.ts +1 -1
- package/dist/src/entities/interface/field-constraint/bank_field_constraints.interface.js +7 -1
- package/dist/src/entities/model/bank.entity.model.d.ts +86 -7
- package/dist/src/entities/model/bank.entity.model.js +449 -8
- package/dist/src/entities/model/entity.model.interface.d.ts +10 -1
- package/dist/src/entities/model/entity.model.interface.js +29 -0
- package/dist/src/entities/model/intermediary_bank.entity.model.d.ts +62 -6
- package/dist/src/entities/model/intermediary_bank.entity.model.js +370 -10
- package/dist/src/entities/model/office_location.entity.model.d.ts +2 -0
- package/dist/src/entities/model/office_location.entity.model.js +13 -1
- package/package.json +1 -1
- /package/dist/src/api/{interface → v1/interface}/bank.create.dto.interface.js +0 -0
- /package/dist/src/api/{interface → v1/interface}/bank.update.dto.interface.js +0 -0
- /package/dist/src/api/{interface → v1/interface}/intermediary_bank.create.dto.interface.js +0 -0
- /package/dist/src/api/{interface → v1/interface}/intermediary_bank.update.dto.interface.js +0 -0
package/dist/src/api/index.d.ts
CHANGED
|
@@ -45,9 +45,7 @@ export * from "./interface/moving_timesheet.update.dto.interface";
|
|
|
45
45
|
export * from "./interface/timesheet.create.dto.interface";
|
|
46
46
|
export * from "./interface/timesheet.filter.dto.interface";
|
|
47
47
|
export * from "./interface/timesheet.update.dto.interface";
|
|
48
|
-
export * from "./interface/bank.create.dto.interface";
|
|
49
48
|
export * from "./interface/bank.entity.response";
|
|
50
|
-
export * from "./interface/bank.update.dto.interface";
|
|
51
49
|
export * from "./interface/client.filter.dto.interface";
|
|
52
50
|
export * from "./interface/client_affiliate.create.dto.interface";
|
|
53
51
|
export * from "./interface/client_affiliate.filter.dto.interface";
|
|
@@ -168,8 +166,6 @@ export * from "./interface/configuration.filter.dto.interface";
|
|
|
168
166
|
export * from "./interface/configuration.update.dto.interface";
|
|
169
167
|
export * from "./interface/leave.filter.dto.interface";
|
|
170
168
|
export * from "./interface/bank.filter.dto.interface";
|
|
171
|
-
export * from "./interface/intermediary_bank.create.dto.interface";
|
|
172
169
|
export * from "./interface/intermediary_bank.filter.dto.interface";
|
|
173
|
-
export * from "./interface/intermediary_bank.update.dto.interface";
|
|
174
170
|
export * as v1 from "./v1";
|
|
175
171
|
export * as v2 from "./v2";
|
package/dist/src/api/index.js
CHANGED
|
@@ -84,9 +84,7 @@ __exportStar(require("./interface/moving_timesheet.update.dto.interface"), expor
|
|
|
84
84
|
__exportStar(require("./interface/timesheet.create.dto.interface"), exports);
|
|
85
85
|
__exportStar(require("./interface/timesheet.filter.dto.interface"), exports);
|
|
86
86
|
__exportStar(require("./interface/timesheet.update.dto.interface"), exports);
|
|
87
|
-
__exportStar(require("./interface/bank.create.dto.interface"), exports);
|
|
88
87
|
__exportStar(require("./interface/bank.entity.response"), exports);
|
|
89
|
-
__exportStar(require("./interface/bank.update.dto.interface"), exports);
|
|
90
88
|
__exportStar(require("./interface/client.filter.dto.interface"), exports);
|
|
91
89
|
__exportStar(require("./interface/client_affiliate.create.dto.interface"), exports);
|
|
92
90
|
__exportStar(require("./interface/client_affiliate.filter.dto.interface"), exports);
|
|
@@ -209,9 +207,7 @@ __exportStar(require("./interface/configuration.filter.dto.interface"), exports)
|
|
|
209
207
|
__exportStar(require("./interface/configuration.update.dto.interface"), exports);
|
|
210
208
|
__exportStar(require("./interface/leave.filter.dto.interface"), exports);
|
|
211
209
|
__exportStar(require("./interface/bank.filter.dto.interface"), exports);
|
|
212
|
-
__exportStar(require("./interface/intermediary_bank.create.dto.interface"), exports);
|
|
213
210
|
__exportStar(require("./interface/intermediary_bank.filter.dto.interface"), exports);
|
|
214
|
-
__exportStar(require("./interface/intermediary_bank.update.dto.interface"), exports);
|
|
215
211
|
// Versioned contracts (checklist 12.4). Namespace re-exports only - never `export *` flat from
|
|
216
212
|
// v1 or v2: flat-exporting both is a duplicate-export error, and flat-exporting one reintroduces
|
|
217
213
|
// the ambiguity the fork exists to remove.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { BankActionEnum, BankStatusEnum, FlowConfig, IBankEntity, IIntermediaryBankEntity } from "../../entities";
|
|
1
|
+
import { BankActionEnum, BankStatusEnum, FlowConfig, IBankEntity, IBankFlowConfigContextData, IIntermediaryBankEntity } from "../../entities";
|
|
2
2
|
/**
|
|
3
3
|
* LW-828: this used to re-declare the flow-config shape by hand. It is now an alias of the shared
|
|
4
|
-
* `FlowConfig`, instantiated with `
|
|
5
|
-
*
|
|
4
|
+
* `FlowConfig`, instantiated with `IBankFlowConfigContextData` (empty, as generated) as the context type;
|
|
5
|
+
* `BankService.getBankNextStatus` calls `next({})`. Kept as a named type so every consumer — including
|
|
6
6
|
* law-admin-web, which receives this config over `GET /bank/flow-config` — keeps compiling unchanged.
|
|
7
7
|
*/
|
|
8
|
-
export type IBankFlowConfig = FlowConfig<BankStatusEnum, BankActionEnum,
|
|
8
|
+
export type IBankFlowConfig = FlowConfig<BankStatusEnum, BankActionEnum, IBankFlowConfigContextData>;
|
|
9
9
|
export interface IBankEntityGet extends IBankEntity {
|
|
10
10
|
intermediaryBankDetails?: IIntermediaryBankEntity[];
|
|
11
11
|
}
|
|
@@ -5,9 +5,13 @@
|
|
|
5
5
|
* generator never writes to this directory (checklist 12.4). An entity appears either in
|
|
6
6
|
* api/interface/ or in v1 + v2 - never both.
|
|
7
7
|
*/
|
|
8
|
+
export * from "./interface/bank.create.dto.interface";
|
|
9
|
+
export * from "./interface/bank.update.dto.interface";
|
|
8
10
|
export * from "./interface/expense_type.create.dto.interface";
|
|
9
11
|
export * from "./interface/expense_type.update.dto.interface";
|
|
10
12
|
export * from "./interface/office_location.create.dto.interface";
|
|
11
13
|
export * from "./interface/office_location.update.dto.interface";
|
|
14
|
+
export * from "./interface/intermediary_bank.create.dto.interface";
|
|
15
|
+
export * from "./interface/intermediary_bank.update.dto.interface";
|
|
12
16
|
export * from "./interface/to_do_list.create.dto.interface";
|
|
13
17
|
export * from "./interface/to_do_list.update.dto.interface";
|
package/dist/src/api/v1/index.js
CHANGED
|
@@ -21,9 +21,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
21
|
* generator never writes to this directory (checklist 12.4). An entity appears either in
|
|
22
22
|
* api/interface/ or in v1 + v2 - never both.
|
|
23
23
|
*/
|
|
24
|
+
__exportStar(require("./interface/bank.create.dto.interface"), exports);
|
|
25
|
+
__exportStar(require("./interface/bank.update.dto.interface"), exports);
|
|
24
26
|
__exportStar(require("./interface/expense_type.create.dto.interface"), exports);
|
|
25
27
|
__exportStar(require("./interface/expense_type.update.dto.interface"), exports);
|
|
26
28
|
__exportStar(require("./interface/office_location.create.dto.interface"), exports);
|
|
27
29
|
__exportStar(require("./interface/office_location.update.dto.interface"), exports);
|
|
30
|
+
__exportStar(require("./interface/intermediary_bank.create.dto.interface"), exports);
|
|
31
|
+
__exportStar(require("./interface/intermediary_bank.update.dto.interface"), exports);
|
|
28
32
|
__exportStar(require("./interface/to_do_list.create.dto.interface"), exports);
|
|
29
33
|
__exportStar(require("./interface/to_do_list.update.dto.interface"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BankStatusEnum, IBankEntity, IEntityCreateDto } from "
|
|
1
|
+
import { BankStatusEnum, IBankEntity, IEntityCreateDto } from "../../../entities";
|
|
2
2
|
import { IIntermediaryBankCreateDto } from "./intermediary_bank.create.dto.interface";
|
|
3
3
|
export interface IBankCreateDto extends Omit<IEntityCreateDto<IBankEntity>, IBankCreateExclude> {
|
|
4
4
|
status?: BankStatusEnum;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BankActionEnum, IBankEntity, IEntityUpdateDto } from "
|
|
1
|
+
import { BankActionEnum, IBankEntity, IEntityUpdateDto } from "../../../entities";
|
|
2
2
|
import { IIntermediaryBankUpdateDto } from "./intermediary_bank.update.dto.interface";
|
|
3
3
|
export interface IBankActionDataDto {
|
|
4
4
|
action: BankActionEnum;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IEntityCreateDto, IIntermediaryBankEntity } from "
|
|
1
|
+
import { IEntityCreateDto, IIntermediaryBankEntity } from "../../../entities";
|
|
2
2
|
/** status is set by the entity flow, never by the client */
|
|
3
3
|
export type IIntermediaryBankCreateExclude = "bankId" | "status";
|
|
4
4
|
export interface IIntermediaryBankCreateDto extends Omit<IEntityCreateDto<IIntermediaryBankEntity>, IIntermediaryBankCreateExclude> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IEntityUpdateDto, IIntermediaryBankEntity } from "
|
|
1
|
+
import { IEntityUpdateDto, IIntermediaryBankEntity } from "../../../entities";
|
|
2
2
|
export interface IIntermediaryBankUpdateDto extends Omit<IEntityUpdateDto<IIntermediaryBankEntity>, "status"> {
|
|
3
3
|
id?: number;
|
|
4
4
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* api/v2 - the new flow contracts.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* and
|
|
7
|
-
*
|
|
8
|
-
* The empty export keeps this a module so `export * as v2` in api/index.ts resolves.
|
|
4
|
+
* Namespaced under `v2` by the `export * as v2` in api/index.ts, so these deliberately reuse the
|
|
5
|
+
* same export names as the frozen api/v1 (and legacy api/interface) contracts — an entity's v1
|
|
6
|
+
* consumers and v2 consumers each resolve their own shape from their own module path.
|
|
9
7
|
*/
|
|
10
8
|
export * from "./interface/to_do_list.create.dto.interface";
|
|
11
9
|
export * from "./interface/to_do_list.update.dto.interface";
|
|
@@ -13,3 +11,13 @@ export * from "./interface/expense_type.create.dto.interface";
|
|
|
13
11
|
export * from "./interface/expense_type.update.dto.interface";
|
|
14
12
|
export * from "./interface/office_location.create.dto.interface";
|
|
15
13
|
export * from "./interface/office_location.update.dto.interface";
|
|
14
|
+
export * from "./interface/task.create.dto.interface";
|
|
15
|
+
export * from "./interface/task.update.dto.interface";
|
|
16
|
+
export * from "./interface/intermediary_bank.create.dto.interface";
|
|
17
|
+
export * from "./interface/intermediary_bank.update.dto.interface";
|
|
18
|
+
export * from "./interface/bank.create.dto.interface";
|
|
19
|
+
export * from "./interface/bank.update.dto.interface";
|
|
20
|
+
export * from "./interface/intermediary_bank.create.dto.interface";
|
|
21
|
+
export * from "./interface/intermediary_bank.update.dto.interface";
|
|
22
|
+
export * from "./interface/bank.create.dto.interface";
|
|
23
|
+
export * from "./interface/bank.update.dto.interface";
|
package/dist/src/api/v2/index.js
CHANGED
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* api/v2 - the new flow contracts.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* and
|
|
8
|
-
*
|
|
9
|
-
* The empty export keeps this a module so `export * as v2` in api/index.ts resolves.
|
|
5
|
+
* Namespaced under `v2` by the `export * as v2` in api/index.ts, so these deliberately reuse the
|
|
6
|
+
* same export names as the frozen api/v1 (and legacy api/interface) contracts — an entity's v1
|
|
7
|
+
* consumers and v2 consumers each resolve their own shape from their own module path.
|
|
10
8
|
*/
|
|
11
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
10
|
if (k2 === undefined) k2 = k;
|
|
@@ -23,11 +21,19 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
23
21
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
24
22
|
};
|
|
25
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
// export {
|
|
27
|
-
// };
|
|
28
24
|
__exportStar(require("./interface/to_do_list.create.dto.interface"), exports);
|
|
29
25
|
__exportStar(require("./interface/to_do_list.update.dto.interface"), exports);
|
|
30
26
|
__exportStar(require("./interface/expense_type.create.dto.interface"), exports);
|
|
31
27
|
__exportStar(require("./interface/expense_type.update.dto.interface"), exports);
|
|
32
28
|
__exportStar(require("./interface/office_location.create.dto.interface"), exports);
|
|
33
29
|
__exportStar(require("./interface/office_location.update.dto.interface"), exports);
|
|
30
|
+
__exportStar(require("./interface/task.create.dto.interface"), exports);
|
|
31
|
+
__exportStar(require("./interface/task.update.dto.interface"), exports);
|
|
32
|
+
__exportStar(require("./interface/intermediary_bank.create.dto.interface"), exports);
|
|
33
|
+
__exportStar(require("./interface/intermediary_bank.update.dto.interface"), exports);
|
|
34
|
+
__exportStar(require("./interface/bank.create.dto.interface"), exports);
|
|
35
|
+
__exportStar(require("./interface/bank.update.dto.interface"), exports);
|
|
36
|
+
__exportStar(require("./interface/intermediary_bank.create.dto.interface"), exports);
|
|
37
|
+
__exportStar(require("./interface/intermediary_bank.update.dto.interface"), exports);
|
|
38
|
+
__exportStar(require("./interface/bank.create.dto.interface"), exports);
|
|
39
|
+
__exportStar(require("./interface/bank.update.dto.interface"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IEntityCreateDto } from "../../../entities";
|
|
2
|
+
import { IBankEntity } from "../../../entities/interface/bank.entity.interface";
|
|
3
|
+
import { IIntermediaryBankCreateDto } from "./intermediary_bank.create.dto.interface";
|
|
4
|
+
export type IBankCreateExclude = "organizationId" | "remark" | "status";
|
|
5
|
+
export interface IBankCreateDto extends Omit<IEntityCreateDto<IBankEntity>, IBankCreateExclude> {
|
|
6
|
+
intermediaryBanks?: IIntermediaryBankCreateDto[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DeepPartialButRequired } from "../../interface/api.utils.interface";
|
|
2
|
+
import { BankActionEnum } from "../../../entities";
|
|
3
|
+
import { IBankCreateDto } from "./bank.create.dto.interface";
|
|
4
|
+
export type IBankUpdateDto = DeepPartialButRequired<IBankCreateDto, never> & {
|
|
5
|
+
actionData: IBankActionDataDto;
|
|
6
|
+
} & {
|
|
7
|
+
id?: number;
|
|
8
|
+
};
|
|
9
|
+
export interface IBankActionDataDto {
|
|
10
|
+
action: BankActionEnum;
|
|
11
|
+
remark?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IEntityCreateDto } from "../../../entities";
|
|
2
|
+
import { IIntermediaryBankEntity } from "../../../entities/interface/intermediary_bank.entity.interface";
|
|
3
|
+
export type IIntermediaryBankCreateExclude = "status";
|
|
4
|
+
export interface IIntermediaryBankCreateDto extends Omit<IEntityCreateDto<IIntermediaryBankEntity>, IIntermediaryBankCreateExclude> {
|
|
5
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DeepPartialButRequired } from "../../interface/api.utils.interface";
|
|
2
|
+
import { IntermediaryBankActionEnum } from "../../../entities";
|
|
3
|
+
import { IIntermediaryBankCreateDto } from "./intermediary_bank.create.dto.interface";
|
|
4
|
+
export type IIntermediaryBankUpdateDto = DeepPartialButRequired<IIntermediaryBankCreateDto, never> & {
|
|
5
|
+
actionData: IIntermediaryBankActionDataDto;
|
|
6
|
+
} & {
|
|
7
|
+
id?: number;
|
|
8
|
+
};
|
|
9
|
+
export interface IIntermediaryBankActionDataDto {
|
|
10
|
+
action: IntermediaryBankActionEnum;
|
|
11
|
+
remark?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IEntityCreateDto } from "../../../entities";
|
|
2
|
+
import { ITaskEntity } from "../../../entities/interface/task.entity.interface";
|
|
3
|
+
export type ITaskCreateExclude = "status";
|
|
4
|
+
export interface ITaskCreateDto extends Omit<IEntityCreateDto<ITaskEntity>, ITaskCreateExclude> {
|
|
5
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DeepPartialButRequired } from "../../interface/api.utils.interface";
|
|
2
|
+
import { TaskActionEnum } from "../../../entities";
|
|
3
|
+
import { ITaskCreateDto } from "./task.create.dto.interface";
|
|
4
|
+
export type ITaskUpdateDto = DeepPartialButRequired<ITaskCreateDto, never> & {
|
|
5
|
+
actionData: ITaskActionDataDto;
|
|
6
|
+
} & {
|
|
7
|
+
id?: number;
|
|
8
|
+
};
|
|
9
|
+
export interface ITaskActionDataDto {
|
|
10
|
+
action: TaskActionEnum;
|
|
11
|
+
remark?: string;
|
|
12
|
+
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
export declare enum BankActionEnum {
|
|
2
|
-
VIEW = "VIEW",
|
|
3
2
|
UPDATE = "UPDATE",
|
|
4
3
|
DELETE = "DELETE",
|
|
5
4
|
CREATE = "CREATE",
|
|
6
5
|
APPROVE = "APPROVE",
|
|
7
6
|
REJECT = "REJECT",
|
|
8
|
-
RECALL = "RECALL"
|
|
7
|
+
RECALL = "RECALL",
|
|
8
|
+
DEACTIVATE = "DEACTIVATE",
|
|
9
|
+
ACTIVATE = "ACTIVATE",
|
|
10
|
+
RESTORE = "RESTORE",
|
|
11
|
+
REQUEST_CHANGES = "REQUEST_CHANGES",
|
|
12
|
+
CHANGES_DONE = "CHANGES_DONE"
|
|
9
13
|
}
|
|
10
14
|
export declare namespace BankActionEnum {
|
|
11
15
|
function getLabel(action: BankActionEnum): string;
|
|
@@ -5,23 +5,31 @@ const enums_1 = require("../../enums");
|
|
|
5
5
|
const exceptions_1 = require("../../exceptions");
|
|
6
6
|
var BankActionEnum;
|
|
7
7
|
(function (BankActionEnum) {
|
|
8
|
-
BankActionEnum["VIEW"] = "VIEW";
|
|
9
8
|
BankActionEnum["UPDATE"] = "UPDATE";
|
|
10
9
|
BankActionEnum["DELETE"] = "DELETE";
|
|
11
10
|
BankActionEnum["CREATE"] = "CREATE";
|
|
12
11
|
BankActionEnum["APPROVE"] = "APPROVE";
|
|
13
12
|
BankActionEnum["REJECT"] = "REJECT";
|
|
14
13
|
BankActionEnum["RECALL"] = "RECALL";
|
|
14
|
+
BankActionEnum["DEACTIVATE"] = "DEACTIVATE";
|
|
15
|
+
BankActionEnum["ACTIVATE"] = "ACTIVATE";
|
|
16
|
+
BankActionEnum["RESTORE"] = "RESTORE";
|
|
17
|
+
BankActionEnum["REQUEST_CHANGES"] = "REQUEST_CHANGES";
|
|
18
|
+
BankActionEnum["CHANGES_DONE"] = "CHANGES_DONE";
|
|
15
19
|
})(BankActionEnum || (exports.BankActionEnum = BankActionEnum = {}));
|
|
16
20
|
(function (BankActionEnum) {
|
|
17
21
|
const actionLabelMap = {
|
|
18
22
|
[BankActionEnum.APPROVE]: "Approve",
|
|
19
|
-
[BankActionEnum.VIEW]: "View",
|
|
20
23
|
[BankActionEnum.UPDATE]: "Edit",
|
|
21
24
|
[BankActionEnum.DELETE]: "Delete",
|
|
22
25
|
[BankActionEnum.CREATE]: "Create",
|
|
23
26
|
[BankActionEnum.REJECT]: "Reject",
|
|
24
27
|
[BankActionEnum.RECALL]: "Recall",
|
|
28
|
+
[BankActionEnum.DEACTIVATE]: "Deactivate",
|
|
29
|
+
[BankActionEnum.ACTIVATE]: "Activate",
|
|
30
|
+
[BankActionEnum.RESTORE]: "Restore",
|
|
31
|
+
[BankActionEnum.REQUEST_CHANGES]: "Request Changes",
|
|
32
|
+
[BankActionEnum.CHANGES_DONE]: "Changes Done",
|
|
25
33
|
};
|
|
26
34
|
function getLabel(action) {
|
|
27
35
|
if (!Object.values(BankActionEnum).includes(action)) {
|
|
@@ -5,7 +5,9 @@ export declare enum BankStatusEnum {
|
|
|
5
5
|
REJECTED = "REJECTED",
|
|
6
6
|
APPROVED = "APPROVED",
|
|
7
7
|
DELETED = "DELETED",
|
|
8
|
-
RESOLVED_REJECTED = "RESOLVED_REJECTED"
|
|
8
|
+
RESOLVED_REJECTED = "RESOLVED_REJECTED",
|
|
9
|
+
DEACTIVATED = "DEACTIVATED",
|
|
10
|
+
CHANGE_REQUESTED = "CHANGE_REQUESTED"
|
|
9
11
|
}
|
|
10
12
|
export declare namespace BankStatusEnum {
|
|
11
13
|
function getNames(): string[];
|
|
@@ -12,6 +12,8 @@ var BankStatusEnum;
|
|
|
12
12
|
BankStatusEnum["APPROVED"] = "APPROVED";
|
|
13
13
|
BankStatusEnum["DELETED"] = "DELETED";
|
|
14
14
|
BankStatusEnum["RESOLVED_REJECTED"] = "RESOLVED_REJECTED";
|
|
15
|
+
BankStatusEnum["DEACTIVATED"] = "DEACTIVATED";
|
|
16
|
+
BankStatusEnum["CHANGE_REQUESTED"] = "CHANGE_REQUESTED";
|
|
15
17
|
})(BankStatusEnum || (exports.BankStatusEnum = BankStatusEnum = {}));
|
|
16
18
|
(function (BankStatusEnum) {
|
|
17
19
|
function getNames() {
|
|
@@ -1,9 +1,69 @@
|
|
|
1
1
|
import { BankActionEnum } from "../enums/bank_action_enum";
|
|
2
2
|
import { BankStatusEnum } from "../enums/bank_status_enum";
|
|
3
|
+
import { PermissionGroupEnum } from "../enums/permission_group_enum";
|
|
3
4
|
import { FlowConfig } from "./flow-config.type";
|
|
5
|
+
export interface IBankFlowConfigContextData {
|
|
6
|
+
}
|
|
7
|
+
export declare const ACTION_MAP: {
|
|
8
|
+
CREATE: {
|
|
9
|
+
reachableStatues: readonly [];
|
|
10
|
+
permissions: never[];
|
|
11
|
+
group: PermissionGroupEnum.CREATE;
|
|
12
|
+
};
|
|
13
|
+
UPDATE: {
|
|
14
|
+
reachableStatues: readonly [BankStatusEnum.CREATE_APPROVAL_PENDING, BankStatusEnum.UPDATE_APPROVAL_PENDING];
|
|
15
|
+
permissions: string[];
|
|
16
|
+
group: PermissionGroupEnum.UPDATE;
|
|
17
|
+
};
|
|
18
|
+
DELETE: {
|
|
19
|
+
reachableStatues: readonly [BankStatusEnum.DELETE_APPROVAL_PENDING, BankStatusEnum.DELETED];
|
|
20
|
+
permissions: string[];
|
|
21
|
+
group: PermissionGroupEnum.DELETE;
|
|
22
|
+
};
|
|
23
|
+
APPROVE: {
|
|
24
|
+
reachableStatues: readonly [BankStatusEnum.APPROVED, BankStatusEnum.DELETED];
|
|
25
|
+
permissions: string[];
|
|
26
|
+
group: PermissionGroupEnum.APPROVAL_FLOW;
|
|
27
|
+
};
|
|
28
|
+
REJECT: {
|
|
29
|
+
reachableStatues: readonly [BankStatusEnum.REJECTED, BankStatusEnum.RESOLVED_REJECTED];
|
|
30
|
+
permissions: string[];
|
|
31
|
+
group: PermissionGroupEnum.APPROVAL_FLOW;
|
|
32
|
+
};
|
|
33
|
+
RECALL: {
|
|
34
|
+
reachableStatues: readonly [BankStatusEnum.DELETED];
|
|
35
|
+
permissions: string[];
|
|
36
|
+
group: PermissionGroupEnum.UPDATE;
|
|
37
|
+
};
|
|
38
|
+
DEACTIVATE: {
|
|
39
|
+
reachableStatues: readonly [];
|
|
40
|
+
permissions: never[];
|
|
41
|
+
group: PermissionGroupEnum.UPDATE;
|
|
42
|
+
};
|
|
43
|
+
ACTIVATE: {
|
|
44
|
+
reachableStatues: readonly [];
|
|
45
|
+
permissions: never[];
|
|
46
|
+
group: PermissionGroupEnum.UPDATE;
|
|
47
|
+
};
|
|
48
|
+
RESTORE: {
|
|
49
|
+
reachableStatues: readonly [];
|
|
50
|
+
permissions: never[];
|
|
51
|
+
group: PermissionGroupEnum.UPDATE;
|
|
52
|
+
};
|
|
53
|
+
REQUEST_CHANGES: {
|
|
54
|
+
reachableStatues: readonly [];
|
|
55
|
+
permissions: never[];
|
|
56
|
+
group: PermissionGroupEnum.UPDATE;
|
|
57
|
+
};
|
|
58
|
+
CHANGES_DONE: {
|
|
59
|
+
reachableStatues: readonly [];
|
|
60
|
+
permissions: never[];
|
|
61
|
+
group: PermissionGroupEnum.UPDATE;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
4
64
|
/**
|
|
5
65
|
* Typed with `FlowConfig` directly rather than importing `IBankFlowConfig` from `src/api`, so that
|
|
6
66
|
* `entities` does not reach into `api` for a type it can express itself. `IBankFlowConfig` is now an
|
|
7
67
|
* alias of this same instantiation, so the two cannot drift.
|
|
8
68
|
*/
|
|
9
|
-
export declare const bankFlowConfig: FlowConfig<BankStatusEnum, BankActionEnum,
|
|
69
|
+
export declare const bankFlowConfig: FlowConfig<BankStatusEnum, BankActionEnum, IBankFlowConfigContextData>;
|
|
@@ -1,51 +1,78 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bankFlowConfig = void 0;
|
|
3
|
+
exports.bankFlowConfig = exports.ACTION_MAP = void 0;
|
|
4
4
|
const bank_action_enum_1 = require("../enums/bank_action_enum");
|
|
5
5
|
const bank_status_enum_1 = require("../enums/bank_status_enum");
|
|
6
|
+
const permission_group_enum_1 = require("../enums/permission_group_enum");
|
|
6
7
|
const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
7
8
|
const BANK_APPROVER_PERMISSION = ["BANK_APPROVER_ORG"];
|
|
8
9
|
const BANK_UPDATE_PERMISSION = ["BANK_UPDATE_ORG"];
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
const BANK_DELETE_PERMISSION = ["BANK_DELETE_ORG"];
|
|
11
|
+
// Every action declares its group; bank_bulk_update.transaction.ts reads `group` to pick the
|
|
12
|
+
// permission a dto is authorised under. The lifecycle + change-request actions share the UPDATE
|
|
13
|
+
// group because that is where `derivePermissionGroup` classifies them.
|
|
14
|
+
exports.ACTION_MAP = {
|
|
15
|
+
// CREATE, DEACTIVATE, ACTIVATE, RESTORE, REQUEST_CHANGES and CHANGES_DONE are declared on
|
|
16
|
+
// BankActionEnum but carry no transition in this flow yet. They are listed so the map covers every
|
|
17
|
+
// enum member; the empty reachable set makes createActionConfig uncallable for them. Permissions
|
|
18
|
+
// and transitions for the last five will be added when the flow needs them.
|
|
17
19
|
[bank_action_enum_1.BankActionEnum.CREATE]: {
|
|
18
20
|
reachableStatues: [],
|
|
19
21
|
permissions: [],
|
|
22
|
+
group: permission_group_enum_1.PermissionGroupEnum.CREATE,
|
|
20
23
|
},
|
|
21
24
|
[bank_action_enum_1.BankActionEnum.UPDATE]: {
|
|
22
25
|
reachableStatues: [bank_status_enum_1.BankStatusEnum.CREATE_APPROVAL_PENDING, bank_status_enum_1.BankStatusEnum.UPDATE_APPROVAL_PENDING],
|
|
23
26
|
permissions: BANK_UPDATE_PERMISSION,
|
|
27
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
24
28
|
},
|
|
25
29
|
[bank_action_enum_1.BankActionEnum.DELETE]: {
|
|
26
30
|
reachableStatues: [bank_status_enum_1.BankStatusEnum.DELETE_APPROVAL_PENDING, bank_status_enum_1.BankStatusEnum.DELETED],
|
|
27
|
-
permissions:
|
|
31
|
+
permissions: BANK_DELETE_PERMISSION,
|
|
32
|
+
group: permission_group_enum_1.PermissionGroupEnum.DELETE,
|
|
28
33
|
},
|
|
29
34
|
[bank_action_enum_1.BankActionEnum.APPROVE]: {
|
|
30
35
|
reachableStatues: [bank_status_enum_1.BankStatusEnum.APPROVED, bank_status_enum_1.BankStatusEnum.DELETED],
|
|
31
36
|
permissions: BANK_APPROVER_PERMISSION,
|
|
37
|
+
group: permission_group_enum_1.PermissionGroupEnum.APPROVAL_FLOW,
|
|
32
38
|
},
|
|
33
39
|
[bank_action_enum_1.BankActionEnum.REJECT]: {
|
|
34
40
|
reachableStatues: [bank_status_enum_1.BankStatusEnum.REJECTED, bank_status_enum_1.BankStatusEnum.RESOLVED_REJECTED],
|
|
35
41
|
permissions: BANK_APPROVER_PERMISSION,
|
|
42
|
+
group: permission_group_enum_1.PermissionGroupEnum.APPROVAL_FLOW,
|
|
36
43
|
},
|
|
37
44
|
[bank_action_enum_1.BankActionEnum.RECALL]: {
|
|
38
45
|
reachableStatues: [bank_status_enum_1.BankStatusEnum.DELETED],
|
|
39
46
|
permissions: BANK_UPDATE_PERMISSION,
|
|
47
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
48
|
+
},
|
|
49
|
+
[bank_action_enum_1.BankActionEnum.DEACTIVATE]: {
|
|
50
|
+
reachableStatues: [],
|
|
51
|
+
permissions: [],
|
|
52
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
53
|
+
},
|
|
54
|
+
[bank_action_enum_1.BankActionEnum.ACTIVATE]: {
|
|
55
|
+
reachableStatues: [],
|
|
56
|
+
permissions: [],
|
|
57
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
58
|
+
},
|
|
59
|
+
[bank_action_enum_1.BankActionEnum.RESTORE]: {
|
|
60
|
+
reachableStatues: [],
|
|
61
|
+
permissions: [],
|
|
62
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
63
|
+
},
|
|
64
|
+
[bank_action_enum_1.BankActionEnum.REQUEST_CHANGES]: {
|
|
65
|
+
reachableStatues: [],
|
|
66
|
+
permissions: [],
|
|
67
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
68
|
+
},
|
|
69
|
+
[bank_action_enum_1.BankActionEnum.CHANGES_DONE]: {
|
|
70
|
+
reachableStatues: [],
|
|
71
|
+
permissions: [],
|
|
72
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
40
73
|
},
|
|
41
74
|
};
|
|
42
|
-
|
|
43
|
-
* The context type is `void` rather than `never` or an empty interface, because `IBankFlowConfig`
|
|
44
|
-
* declares `next: () => BankStatusEnum` and `BankService.getBankNextStatus` calls
|
|
45
|
-
* `matchingPermissionConfig.next()` with no arguments. A `void` parameter may be omitted at the call
|
|
46
|
-
* site, so that call keeps compiling; `never` would have required an argument nobody can produce.
|
|
47
|
-
*/
|
|
48
|
-
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(ACTION_MAP);
|
|
75
|
+
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(exports.ACTION_MAP);
|
|
49
76
|
// CREATE_APPROVAL_PENDING status transitions
|
|
50
77
|
const transitionCreateApprovalPendingStatusApproveAction = createActionConfig(bank_action_enum_1.BankActionEnum.APPROVE, bank_status_enum_1.BankStatusEnum.APPROVED);
|
|
51
78
|
const transitionCreateApprovalPendingStatusUpdateAction = createActionConfig(bank_action_enum_1.BankActionEnum.UPDATE, bank_status_enum_1.BankStatusEnum.CREATE_APPROVAL_PENDING);
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
import { CountryActionEnum } from "../enums/country_action_enum";
|
|
2
2
|
import { CountryStatusEnum } from "../enums/country_status_enum";
|
|
3
|
+
import { PermissionGroupEnum } from "../enums/permission_group_enum";
|
|
3
4
|
import { FlowConfig } from "./flow-config.type";
|
|
4
5
|
export interface ICountryFlowConfigContextData {
|
|
5
6
|
}
|
|
7
|
+
export declare const ACTION_MAP: {
|
|
8
|
+
CREATE: {
|
|
9
|
+
reachableStatues: readonly [CountryStatusEnum.APPROVED];
|
|
10
|
+
permissions: string[];
|
|
11
|
+
group: PermissionGroupEnum.CREATE;
|
|
12
|
+
};
|
|
13
|
+
UPDATE: {
|
|
14
|
+
reachableStatues: readonly [CountryStatusEnum.APPROVED];
|
|
15
|
+
permissions: string[];
|
|
16
|
+
group: PermissionGroupEnum.UPDATE;
|
|
17
|
+
};
|
|
18
|
+
DELETE: {
|
|
19
|
+
reachableStatues: readonly [CountryStatusEnum.DELETED];
|
|
20
|
+
permissions: string[];
|
|
21
|
+
group: PermissionGroupEnum.DELETE;
|
|
22
|
+
};
|
|
23
|
+
DEACTIVATE: {
|
|
24
|
+
reachableStatues: readonly [CountryStatusEnum.DEACTIVATED];
|
|
25
|
+
permissions: string[];
|
|
26
|
+
group: PermissionGroupEnum.UPDATE;
|
|
27
|
+
};
|
|
28
|
+
ACTIVATE: {
|
|
29
|
+
reachableStatues: readonly [CountryStatusEnum.APPROVED];
|
|
30
|
+
permissions: string[];
|
|
31
|
+
group: PermissionGroupEnum.UPDATE;
|
|
32
|
+
};
|
|
33
|
+
RESTORE: {
|
|
34
|
+
reachableStatues: readonly [CountryStatusEnum.APPROVED];
|
|
35
|
+
permissions: string[];
|
|
36
|
+
group: PermissionGroupEnum.UPDATE;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
6
39
|
export declare const countryFlowConfig: FlowConfig<CountryStatusEnum, CountryActionEnum, ICountryFlowConfigContextData>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.countryFlowConfig = void 0;
|
|
3
|
+
exports.countryFlowConfig = exports.ACTION_MAP = void 0;
|
|
4
4
|
const country_action_enum_1 = require("../enums/country_action_enum");
|
|
5
5
|
const country_status_enum_1 = require("../enums/country_status_enum");
|
|
6
|
+
const permission_group_enum_1 = require("../enums/permission_group_enum");
|
|
6
7
|
const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
7
8
|
const COUNTRY_CREATE_PERMISSION = ["COUNTRY_CREATE"];
|
|
8
9
|
const COUNTRY_UPDATE_PERMISSION = ["COUNTRY_UPDATE"];
|
|
@@ -10,33 +11,43 @@ const COUNTRY_DELETE_PERMISSION = ["COUNTRY_DELETE"];
|
|
|
10
11
|
const COUNTRY_DEACTIVATE_PERMISSION = ["COUNTRY_DEACTIVATE"];
|
|
11
12
|
const COUNTRY_ACTIVATE_PERMISSION = ["COUNTRY_ACTIVATE"];
|
|
12
13
|
const COUNTRY_RESTORE_PERMISSION = ["COUNTRY_RESTORE"];
|
|
13
|
-
|
|
14
|
+
// Every action declares its group. country_bulk_update.transaction.ts reads `group` to pick the
|
|
15
|
+
// permission a dto is authorised under and refuses to default an absent one, so all six must be
|
|
16
|
+
// annotated for any transition to keep working. The three lifecycle actions share the UPDATE group
|
|
17
|
+
// because that is where `derivePermissionGroup` classifies them.
|
|
18
|
+
exports.ACTION_MAP = {
|
|
14
19
|
[country_action_enum_1.CountryActionEnum.CREATE]: {
|
|
15
20
|
reachableStatues: [country_status_enum_1.CountryStatusEnum.APPROVED],
|
|
16
21
|
permissions: COUNTRY_CREATE_PERMISSION,
|
|
22
|
+
group: permission_group_enum_1.PermissionGroupEnum.CREATE,
|
|
17
23
|
},
|
|
18
24
|
[country_action_enum_1.CountryActionEnum.UPDATE]: {
|
|
19
25
|
reachableStatues: [country_status_enum_1.CountryStatusEnum.APPROVED],
|
|
20
26
|
permissions: COUNTRY_UPDATE_PERMISSION,
|
|
27
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
21
28
|
},
|
|
22
29
|
[country_action_enum_1.CountryActionEnum.DELETE]: {
|
|
23
30
|
reachableStatues: [country_status_enum_1.CountryStatusEnum.DELETED],
|
|
24
31
|
permissions: COUNTRY_DELETE_PERMISSION,
|
|
32
|
+
group: permission_group_enum_1.PermissionGroupEnum.DELETE,
|
|
25
33
|
},
|
|
26
34
|
[country_action_enum_1.CountryActionEnum.DEACTIVATE]: {
|
|
27
35
|
reachableStatues: [country_status_enum_1.CountryStatusEnum.DEACTIVATED],
|
|
28
36
|
permissions: COUNTRY_DEACTIVATE_PERMISSION,
|
|
37
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
29
38
|
},
|
|
30
39
|
[country_action_enum_1.CountryActionEnum.ACTIVATE]: {
|
|
31
40
|
reachableStatues: [country_status_enum_1.CountryStatusEnum.APPROVED],
|
|
32
41
|
permissions: COUNTRY_ACTIVATE_PERMISSION,
|
|
42
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
33
43
|
},
|
|
34
44
|
[country_action_enum_1.CountryActionEnum.RESTORE]: {
|
|
35
45
|
reachableStatues: [country_status_enum_1.CountryStatusEnum.APPROVED],
|
|
36
46
|
permissions: COUNTRY_RESTORE_PERMISSION,
|
|
47
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
37
48
|
},
|
|
38
49
|
};
|
|
39
|
-
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(ACTION_MAP);
|
|
50
|
+
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(exports.ACTION_MAP);
|
|
40
51
|
// APPROVED status transitions
|
|
41
52
|
const transitionApprovedStatusUpdateAction = createActionConfig(country_action_enum_1.CountryActionEnum.UPDATE, country_status_enum_1.CountryStatusEnum.APPROVED);
|
|
42
53
|
const transitionApprovedStatusDeleteAction = createActionConfig(country_action_enum_1.CountryActionEnum.DELETE, country_status_enum_1.CountryStatusEnum.DELETED);
|