law-common 14.0.3-beta.7 → 14.0.3-beta.8
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/README.md +1 -1
- package/dist/src/api/index.d.ts +2 -4
- package/dist/src/api/index.js +28 -4
- package/dist/src/api/interface/reimbursement.entity.response.d.ts +9 -1
- package/dist/src/api/v1/index.d.ts +11 -0
- package/dist/src/api/v1/index.js +27 -0
- package/dist/src/api/{interface → v1/interface}/expense_type.create.dto.interface.d.ts +1 -1
- package/dist/src/api/{interface → v1/interface}/expense_type.update.dto.interface.d.ts +1 -1
- package/dist/src/api/{interface → v1/interface}/to_do_list.create.dto.interface.d.ts +1 -1
- package/dist/src/api/{interface → v1/interface}/to_do_list.update.dto.interface.d.ts +1 -1
- package/dist/src/api/v2/index.d.ts +13 -0
- package/dist/src/api/v2/index.js +31 -0
- package/dist/src/api/v2/interface/expense_type.create.dto.interface.d.ts +5 -0
- package/dist/src/api/v2/interface/expense_type.create.dto.interface.js +2 -0
- package/dist/src/api/v2/interface/expense_type.update.dto.interface.d.ts +12 -0
- package/dist/src/api/v2/interface/expense_type.update.dto.interface.js +2 -0
- package/dist/src/api/v2/interface/to_do_list.create.dto.interface.d.ts +5 -0
- package/dist/src/api/v2/interface/to_do_list.create.dto.interface.js +2 -0
- package/dist/src/api/v2/interface/to_do_list.update.dto.interface.d.ts +12 -0
- package/dist/src/api/v2/interface/to_do_list.update.dto.interface.js +2 -0
- package/dist/src/entities/flow-configs/expense_type_flow.config.d.ts +1 -1
- package/dist/src/entities/flow-configs/expense_type_flow.config.js +21 -21
- package/dist/src/entities/flow-configs/flow-config.type.d.ts +14 -0
- package/dist/src/entities/flow-configs/reimbursement_expense_flow.config.js +2 -2
- package/dist/src/entities/flow-configs/reimbursement_flow.config.d.ts +9 -1
- package/dist/src/entities/flow-configs/reimbursement_flow.config.js +13 -3
- package/dist/src/entities/index.d.ts +1 -1
- package/dist/src/entities/index.js +1 -1
- package/dist/src/entities/interface/expense_type.entity.interface.d.ts +1 -1
- package/dist/src/entities/interface/field-constraint/expense_type_field_constraints.interface.d.ts +0 -8
- package/dist/src/entities/interface/field-constraint/to_do_list_field_constraints.interface.d.ts +0 -7
- package/dist/src/entities/interface/field-constraint/to_do_list_field_constraints.interface.js +10 -16
- package/dist/src/entities/interface/to_do_list.entity.interface.d.ts +2 -2
- package/dist/src/entities/model/expense_type.entity.model.d.ts +7 -7
- package/dist/src/entities/model/expense_type.entity.model.js +6 -6
- package/dist/src/entities/model/to_do_list.entity.model.d.ts +63 -9
- package/dist/src/entities/model/to_do_list.entity.model.js +367 -11
- package/package.json +2 -2
- /package/dist/src/api/{interface → v1/interface}/expense_type.create.dto.interface.js +0 -0
- /package/dist/src/api/{interface → v1/interface}/expense_type.update.dto.interface.js +0 -0
- /package/dist/src/api/{interface → v1/interface}/to_do_list.create.dto.interface.js +0 -0
- /package/dist/src/api/{interface → v1/interface}/to_do_list.update.dto.interface.js +0 -0
- /package/dist/src/entities/enums/{expense_type_entity_enum.d.ts → expense_type_enum.d.ts} +0 -0
- /package/dist/src/entities/enums/{expense_type_entity_enum.js → expense_type_enum.js} +0 -0
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
# law-common
|
|
1
|
+
# law-common
|
package/dist/src/api/index.d.ts
CHANGED
|
@@ -20,8 +20,6 @@ export * from "./interface/reimbursement_expense.update.dto.interface";
|
|
|
20
20
|
export * from "./interface/billing_reimbursement_expense.create.dto.interface";
|
|
21
21
|
export * from "./interface/billing_reimbursement_expense.filter.dto.interface";
|
|
22
22
|
export * from "./interface/billing_reimbursement_expense.update.dto.interface";
|
|
23
|
-
export * from "./interface/expense_type.create.dto.interface";
|
|
24
|
-
export * from "./interface/expense_type.update.dto.interface";
|
|
25
23
|
export * from "./interface/expense_type.entity.response";
|
|
26
24
|
export * from "./interface/billing.create.dto.interface";
|
|
27
25
|
export * from "./interface/billing_particular_line_item.create.dto.interface";
|
|
@@ -80,9 +78,7 @@ export * from "./interface/leave.create.dto.interface";
|
|
|
80
78
|
export * from "./interface/leave.update.dto.interface";
|
|
81
79
|
export * from "./interface/cron_jobs.entity.response";
|
|
82
80
|
export * from "./interface/cron_jobs_manual_trigger.dto.interface";
|
|
83
|
-
export * from "./interface/to_do_list.create.dto.interface";
|
|
84
81
|
export * from "./interface/to_do_list.filter.dto.interface";
|
|
85
|
-
export * from "./interface/to_do_list.update.dto.interface";
|
|
86
82
|
export * from "./interface/project_user_mapping.create.dto.interface";
|
|
87
83
|
export * from "./interface/project_user_mapping.filter.dto.interface";
|
|
88
84
|
export * from "./interface/project_user_mapping.update.dto.interface";
|
|
@@ -177,3 +173,5 @@ export * from "./interface/bank.filter.dto.interface";
|
|
|
177
173
|
export * from "./interface/intermediary_bank.create.dto.interface";
|
|
178
174
|
export * from "./interface/intermediary_bank.filter.dto.interface";
|
|
179
175
|
export * from "./interface/intermediary_bank.update.dto.interface";
|
|
176
|
+
export * as v1 from "./v1";
|
|
177
|
+
export * as v2 from "./v2";
|
package/dist/src/api/index.js
CHANGED
|
@@ -10,10 +10,33 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
13
18
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
19
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
20
|
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
16
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.v2 = exports.v1 = void 0;
|
|
17
40
|
__exportStar(require("./interface/base.response.interface"), exports);
|
|
18
41
|
__exportStar(require("./interface/jwt.payload.interface"), exports);
|
|
19
42
|
__exportStar(require("./interface/login.response.interface"), exports);
|
|
@@ -36,8 +59,6 @@ __exportStar(require("./interface/reimbursement_expense.update.dto.interface"),
|
|
|
36
59
|
__exportStar(require("./interface/billing_reimbursement_expense.create.dto.interface"), exports);
|
|
37
60
|
__exportStar(require("./interface/billing_reimbursement_expense.filter.dto.interface"), exports);
|
|
38
61
|
__exportStar(require("./interface/billing_reimbursement_expense.update.dto.interface"), exports);
|
|
39
|
-
__exportStar(require("./interface/expense_type.create.dto.interface"), exports);
|
|
40
|
-
__exportStar(require("./interface/expense_type.update.dto.interface"), exports);
|
|
41
62
|
__exportStar(require("./interface/expense_type.entity.response"), exports);
|
|
42
63
|
__exportStar(require("./interface/billing.create.dto.interface"), exports);
|
|
43
64
|
__exportStar(require("./interface/billing_particular_line_item.create.dto.interface"), exports);
|
|
@@ -96,9 +117,7 @@ __exportStar(require("./interface/leave.create.dto.interface"), exports);
|
|
|
96
117
|
__exportStar(require("./interface/leave.update.dto.interface"), exports);
|
|
97
118
|
__exportStar(require("./interface/cron_jobs.entity.response"), exports);
|
|
98
119
|
__exportStar(require("./interface/cron_jobs_manual_trigger.dto.interface"), exports);
|
|
99
|
-
__exportStar(require("./interface/to_do_list.create.dto.interface"), exports);
|
|
100
120
|
__exportStar(require("./interface/to_do_list.filter.dto.interface"), exports);
|
|
101
|
-
__exportStar(require("./interface/to_do_list.update.dto.interface"), exports);
|
|
102
121
|
// export * from "./interface/billing-reimbursement-expense.api";
|
|
103
122
|
// export * from "./interface/billing-reimbursement-expense-history.api";
|
|
104
123
|
__exportStar(require("./interface/project_user_mapping.create.dto.interface"), exports);
|
|
@@ -195,3 +214,8 @@ __exportStar(require("./interface/bank.filter.dto.interface"), exports);
|
|
|
195
214
|
__exportStar(require("./interface/intermediary_bank.create.dto.interface"), exports);
|
|
196
215
|
__exportStar(require("./interface/intermediary_bank.filter.dto.interface"), exports);
|
|
197
216
|
__exportStar(require("./interface/intermediary_bank.update.dto.interface"), exports);
|
|
217
|
+
// Versioned contracts (checklist 12.4). Namespace re-exports only - never `export *` flat from
|
|
218
|
+
// v1 or v2: flat-exporting both is a duplicate-export error, and flat-exporting one reintroduces
|
|
219
|
+
// the ambiguity the fork exists to remove.
|
|
220
|
+
exports.v1 = __importStar(require("./v1"));
|
|
221
|
+
exports.v2 = __importStar(require("./v2"));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IReimbursementEntity, IReimbursementExpenseEntity, IUserEntity } from "../../entities";
|
|
1
|
+
import { IReimbursementEntity, IReimbursementExpenseEntity, IUserEntity, ParentChildFlowConfig, ReimbursementActionEnum, ReimbursementExpenseActionEnum, ReimbursementExpenseState, ReimbursementStatusEnum } from "../../entities";
|
|
2
2
|
import { IProjectEntityGet } from "./project.entity.response";
|
|
3
3
|
export type IReimbursementEntityGet = {
|
|
4
4
|
reimbursements: IReimbursementResponse[];
|
|
@@ -7,6 +7,14 @@ export type IReimbursementEntityGet = {
|
|
|
7
7
|
};
|
|
8
8
|
projects: IProjectEntityGet;
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* LW-828: this used to re-declare the parent/child flow-config shape by hand. It is now an alias of the
|
|
12
|
+
* shared `ParentChildFlowConfig`, instantiated with `IReimbursementFlowContextData` for the parent and
|
|
13
|
+
* `void` for the child — the child's `next` is called with no argument in
|
|
14
|
+
* `ReimbursementExpenseService.getReimbursementNextStatusForChild`. Kept as a named type so every
|
|
15
|
+
* existing consumer keeps compiling unchanged.
|
|
16
|
+
*/
|
|
17
|
+
export type IReimbursementFlowConfig = ParentChildFlowConfig<ReimbursementStatusEnum, ReimbursementActionEnum, ReimbursementExpenseState, ReimbursementExpenseActionEnum, IReimbursementFlowContextData, void>;
|
|
10
18
|
export type IReimbursementFlowContextData = {
|
|
11
19
|
expenseDetails: IReimbursementExpenseEntity[];
|
|
12
20
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* api/v1 - FROZEN legacy contracts.
|
|
3
|
+
*
|
|
4
|
+
* Interfaces here serve routes that outlive the flow migration. They are hand-written and the
|
|
5
|
+
* generator never writes to this directory (checklist 12.4). An entity appears either in
|
|
6
|
+
* api/interface/ or in v1 + v2 - never both.
|
|
7
|
+
*/
|
|
8
|
+
export * from "./interface/expense_type.create.dto.interface";
|
|
9
|
+
export * from "./interface/expense_type.update.dto.interface";
|
|
10
|
+
export * from "./interface/to_do_list.create.dto.interface";
|
|
11
|
+
export * from "./interface/to_do_list.update.dto.interface";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* api/v1 - FROZEN legacy contracts.
|
|
19
|
+
*
|
|
20
|
+
* Interfaces here serve routes that outlive the flow migration. They are hand-written and the
|
|
21
|
+
* generator never writes to this directory (checklist 12.4). An entity appears either in
|
|
22
|
+
* api/interface/ or in v1 + v2 - never both.
|
|
23
|
+
*/
|
|
24
|
+
__exportStar(require("./interface/expense_type.create.dto.interface"), exports);
|
|
25
|
+
__exportStar(require("./interface/expense_type.update.dto.interface"), exports);
|
|
26
|
+
__exportStar(require("./interface/to_do_list.create.dto.interface"), exports);
|
|
27
|
+
__exportStar(require("./interface/to_do_list.update.dto.interface"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IEntityCreateDto, IToDoListEntity } from "
|
|
1
|
+
import { IEntityCreateDto, IToDoListEntity } from "../../../entities";
|
|
2
2
|
/** status is set by the entity flow, never by the client */
|
|
3
3
|
export type IToDoListCreateExclude = "status";
|
|
4
4
|
export interface IToDoListCreateDto extends Omit<IEntityCreateDto<IToDoListEntity>, IToDoListCreateExclude> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IEntityUpdateDto, IToDoListEntity } from "
|
|
1
|
+
import { IEntityUpdateDto, IToDoListEntity } from "../../../entities";
|
|
2
2
|
import { IToDoListCreateExclude } from "./to_do_list.create.dto.interface";
|
|
3
3
|
export interface IToDoListUpdateDto extends Omit<IEntityUpdateDto<IToDoListEntity>, IToDoListCreateExclude> {
|
|
4
4
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* api/v2 - the new flow contracts.
|
|
3
|
+
*
|
|
4
|
+
* Intentionally empty: to_do_list's v2 create/update DTO interfaces are generated, not hand-written,
|
|
5
|
+
* and have not been generated yet. The generator writes them to api/v2/interface/ (checklist 12.4,
|
|
6
|
+
* and 9.1 rows 4 and 7).
|
|
7
|
+
*
|
|
8
|
+
* The empty export keeps this a module so `export * as v2` in api/index.ts resolves.
|
|
9
|
+
*/
|
|
10
|
+
export * from "./interface/to_do_list.create.dto.interface";
|
|
11
|
+
export * from "./interface/to_do_list.update.dto.interface";
|
|
12
|
+
export * from "./interface/expense_type.create.dto.interface";
|
|
13
|
+
export * from "./interface/expense_type.update.dto.interface";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* api/v2 - the new flow contracts.
|
|
4
|
+
*
|
|
5
|
+
* Intentionally empty: to_do_list's v2 create/update DTO interfaces are generated, not hand-written,
|
|
6
|
+
* and have not been generated yet. The generator writes them to api/v2/interface/ (checklist 12.4,
|
|
7
|
+
* and 9.1 rows 4 and 7).
|
|
8
|
+
*
|
|
9
|
+
* The empty export keeps this a module so `export * as v2` in api/index.ts resolves.
|
|
10
|
+
*/
|
|
11
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(o, k2, desc);
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
23
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
// export {
|
|
27
|
+
// };
|
|
28
|
+
__exportStar(require("./interface/to_do_list.create.dto.interface"), exports);
|
|
29
|
+
__exportStar(require("./interface/to_do_list.update.dto.interface"), exports);
|
|
30
|
+
__exportStar(require("./interface/expense_type.create.dto.interface"), exports);
|
|
31
|
+
__exportStar(require("./interface/expense_type.update.dto.interface"), exports);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IEntityCreateDto } from "../../../entities";
|
|
2
|
+
import { IExpenseTypeEntity } from "../../../entities/interface/expense_type.entity.interface";
|
|
3
|
+
export type IExpenseTypeCreateExclude = "status";
|
|
4
|
+
export interface IExpenseTypeCreateDto extends Omit<IEntityCreateDto<IExpenseTypeEntity>, IExpenseTypeCreateExclude> {
|
|
5
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DeepPartialButRequired } from "../../interface/api.utils.interface";
|
|
2
|
+
import { ExpenseTypeActionEnum } from "../../../entities";
|
|
3
|
+
import { IExpenseTypeCreateDto } from "./expense_type.create.dto.interface";
|
|
4
|
+
export type IExpenseTypeUpdateDto = DeepPartialButRequired<IExpenseTypeCreateDto, never> & {
|
|
5
|
+
actionData: IExpenseTypeActionDataDto;
|
|
6
|
+
} & {
|
|
7
|
+
id?: number;
|
|
8
|
+
};
|
|
9
|
+
export interface IExpenseTypeActionDataDto {
|
|
10
|
+
action: ExpenseTypeActionEnum;
|
|
11
|
+
remark?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IEntityCreateDto } from "../../../entities";
|
|
2
|
+
import { IToDoListEntity } from "../../../entities/interface/to_do_list.entity.interface";
|
|
3
|
+
export type IToDoListCreateExclude = "status";
|
|
4
|
+
export interface IToDoListCreateDto extends Omit<IEntityCreateDto<IToDoListEntity>, IToDoListCreateExclude> {
|
|
5
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DeepPartialButRequired } from "../../interface/api.utils.interface";
|
|
2
|
+
import { ToDoListActionEnum } from "../../../entities";
|
|
3
|
+
import { IToDoListCreateDto } from "./to_do_list.create.dto.interface";
|
|
4
|
+
export type IToDoListUpdateDto = DeepPartialButRequired<IToDoListCreateDto, never> & {
|
|
5
|
+
actionData: IToDoListActionDataDto;
|
|
6
|
+
} & {
|
|
7
|
+
id?: number;
|
|
8
|
+
};
|
|
9
|
+
export interface IToDoListActionDataDto {
|
|
10
|
+
action: ToDoListActionEnum;
|
|
11
|
+
remark?: string;
|
|
12
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FlowConfig } from "./flow-config.type";
|
|
2
|
-
import { ExpenseTypeActionEnum } from "
|
|
2
|
+
import { ExpenseTypeActionEnum } from "../../entities";
|
|
3
3
|
import { ExpenseTypeStatusEnum } from "../enums/expense_type_status_enum";
|
|
4
4
|
export interface IExpenseTypeFlowConfigContextData {
|
|
5
5
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.expenseTypeFlowConfig = void 0;
|
|
4
4
|
const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
5
|
-
const
|
|
5
|
+
const entities_1 = require("../../entities");
|
|
6
6
|
const expense_type_status_enum_1 = require("../enums/expense_type_status_enum");
|
|
7
7
|
const EXPENSE_TYPE_CREATE_PERMISSION = ["EXPENSE_TYPE_CREATE"];
|
|
8
8
|
const EXPENSE_TYPE_UPDATE_PERMISSION = ["EXPENSE_TYPE_UPDATE"];
|
|
@@ -11,60 +11,60 @@ const EXPENSE_TYPE_DEACTIVATE_PERMISSION = ["EXPENSE_TYPE_DEACTIVATE"];
|
|
|
11
11
|
const EXPENSE_TYPE_ACTIVATE_PERMISSION = ["EXPENSE_TYPE_ACTIVATE"];
|
|
12
12
|
const EXPENSE_TYPE_RESTORE_PERMISSION = ["EXPENSE_TYPE_RESTORE"];
|
|
13
13
|
const ACTION_MAP = {
|
|
14
|
-
[
|
|
14
|
+
[entities_1.ExpenseTypeActionEnum.CREATE]: {
|
|
15
15
|
reachableStatues: [expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED],
|
|
16
16
|
permissions: EXPENSE_TYPE_CREATE_PERMISSION,
|
|
17
17
|
},
|
|
18
|
-
[
|
|
18
|
+
[entities_1.ExpenseTypeActionEnum.UPDATE]: {
|
|
19
19
|
reachableStatues: [expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED],
|
|
20
20
|
permissions: EXPENSE_TYPE_UPDATE_PERMISSION,
|
|
21
21
|
},
|
|
22
|
-
[
|
|
22
|
+
[entities_1.ExpenseTypeActionEnum.DELETE]: {
|
|
23
23
|
reachableStatues: [expense_type_status_enum_1.ExpenseTypeStatusEnum.DELETED],
|
|
24
24
|
permissions: EXPENSE_TYPE_DELETE_PERMISSION,
|
|
25
25
|
},
|
|
26
|
-
[
|
|
26
|
+
[entities_1.ExpenseTypeActionEnum.DEACTIVATE]: {
|
|
27
27
|
reachableStatues: [expense_type_status_enum_1.ExpenseTypeStatusEnum.DEACTIVATED],
|
|
28
28
|
permissions: EXPENSE_TYPE_DEACTIVATE_PERMISSION,
|
|
29
29
|
},
|
|
30
|
-
[
|
|
30
|
+
[entities_1.ExpenseTypeActionEnum.ACTIVATE]: {
|
|
31
31
|
reachableStatues: [expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED],
|
|
32
32
|
permissions: EXPENSE_TYPE_ACTIVATE_PERMISSION,
|
|
33
33
|
},
|
|
34
|
-
[
|
|
34
|
+
[entities_1.ExpenseTypeActionEnum.RESTORE]: {
|
|
35
35
|
reachableStatues: [expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED],
|
|
36
36
|
permissions: EXPENSE_TYPE_RESTORE_PERMISSION,
|
|
37
37
|
},
|
|
38
38
|
};
|
|
39
39
|
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(ACTION_MAP);
|
|
40
40
|
// APPROVED status transitions
|
|
41
|
-
const transitionApprovedStatusUpdateAction = createActionConfig(
|
|
42
|
-
const transitionApprovedStatusDeleteAction = createActionConfig(
|
|
43
|
-
const transitionApprovedStatusDeactivateAction = createActionConfig(
|
|
41
|
+
const transitionApprovedStatusUpdateAction = createActionConfig(entities_1.ExpenseTypeActionEnum.UPDATE, expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED);
|
|
42
|
+
const transitionApprovedStatusDeleteAction = createActionConfig(entities_1.ExpenseTypeActionEnum.DELETE, expense_type_status_enum_1.ExpenseTypeStatusEnum.DELETED);
|
|
43
|
+
const transitionApprovedStatusDeactivateAction = createActionConfig(entities_1.ExpenseTypeActionEnum.DEACTIVATE, expense_type_status_enum_1.ExpenseTypeStatusEnum.DEACTIVATED);
|
|
44
44
|
// DEACTIVATED status transitions
|
|
45
|
-
const transitionDeactivatedStatusDeleteAction = createActionConfig(
|
|
46
|
-
const transitionDeactivatedStatusActivateAction = createActionConfig(
|
|
45
|
+
const transitionDeactivatedStatusDeleteAction = createActionConfig(entities_1.ExpenseTypeActionEnum.DELETE, expense_type_status_enum_1.ExpenseTypeStatusEnum.DELETED);
|
|
46
|
+
const transitionDeactivatedStatusActivateAction = createActionConfig(entities_1.ExpenseTypeActionEnum.ACTIVATE, expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED);
|
|
47
47
|
// DELETED status transitions
|
|
48
|
-
const transitionDeletedStatusUpdateAction = createActionConfig(
|
|
49
|
-
const transitionDeletedStatusRestoreAction = createActionConfig(
|
|
48
|
+
const transitionDeletedStatusUpdateAction = createActionConfig(entities_1.ExpenseTypeActionEnum.UPDATE, expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED);
|
|
49
|
+
const transitionDeletedStatusRestoreAction = createActionConfig(entities_1.ExpenseTypeActionEnum.RESTORE, expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED);
|
|
50
50
|
exports.expenseTypeFlowConfig = {
|
|
51
51
|
[expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED]: {
|
|
52
52
|
actions: {
|
|
53
|
-
[
|
|
54
|
-
[
|
|
55
|
-
[
|
|
53
|
+
[entities_1.ExpenseTypeActionEnum.UPDATE]: transitionApprovedStatusUpdateAction,
|
|
54
|
+
[entities_1.ExpenseTypeActionEnum.DELETE]: transitionApprovedStatusDeleteAction,
|
|
55
|
+
[entities_1.ExpenseTypeActionEnum.DEACTIVATE]: transitionApprovedStatusDeactivateAction,
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
58
|
[expense_type_status_enum_1.ExpenseTypeStatusEnum.DEACTIVATED]: {
|
|
59
59
|
actions: {
|
|
60
|
-
[
|
|
61
|
-
[
|
|
60
|
+
[entities_1.ExpenseTypeActionEnum.DELETE]: transitionDeactivatedStatusDeleteAction,
|
|
61
|
+
[entities_1.ExpenseTypeActionEnum.ACTIVATE]: transitionDeactivatedStatusActivateAction,
|
|
62
62
|
},
|
|
63
63
|
},
|
|
64
64
|
[expense_type_status_enum_1.ExpenseTypeStatusEnum.DELETED]: {
|
|
65
65
|
actions: {
|
|
66
|
-
[
|
|
67
|
-
[
|
|
66
|
+
[entities_1.ExpenseTypeActionEnum.UPDATE]: transitionDeletedStatusUpdateAction,
|
|
67
|
+
[entities_1.ExpenseTypeActionEnum.RESTORE]: transitionDeletedStatusRestoreAction,
|
|
68
68
|
},
|
|
69
69
|
},
|
|
70
70
|
};
|
|
@@ -70,3 +70,17 @@ export interface IFlowConfigActionConfig<STATUS_ENUM_TYPE extends string, CONTEX
|
|
|
70
70
|
*/
|
|
71
71
|
isApplicable?: (data: CONTEXT_DATA_TYPE) => boolean;
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* A flow whose parent and child rows each have their own status/action vocabulary.
|
|
75
|
+
*
|
|
76
|
+
* @template T context data passed to the parent's `next()`
|
|
77
|
+
* @template CT context data passed to the child's `next()`. Defaults to `T` for flows where both
|
|
78
|
+
* levels resolve from the same context. Reimbursement is the case that needs them to
|
|
79
|
+
* differ: its parent derives the reimbursement status from the child rows, while its
|
|
80
|
+
* child transitions are all fixed and its `next()` is called with no argument at all —
|
|
81
|
+
* so the child is instantiated with `void`.
|
|
82
|
+
*/
|
|
83
|
+
export type ParentChildFlowConfig<S extends string, A extends string, CS extends string = never, CA extends string = never, T extends Record<any, any> = never, CT = T> = {
|
|
84
|
+
parent: FlowConfig<S, A, T>;
|
|
85
|
+
child: FlowConfig<CS, CA, CT>;
|
|
86
|
+
};
|
|
@@ -8,8 +8,8 @@ const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
|
8
8
|
* Reimbursement Expense — the child level of the reimbursement flow.
|
|
9
9
|
*
|
|
10
10
|
* Split out of `reimbursement_flow.config.ts` so each level can be read on its own: this file owns the
|
|
11
|
-
* expense-row state machine, and the parent file owns the reimbursement status derivation
|
|
12
|
-
*
|
|
11
|
+
* expense-row state machine, and the parent file owns the reimbursement status derivation plus the
|
|
12
|
+
* composed `reimbursementConfigFlow` the services consume.
|
|
13
13
|
*
|
|
14
14
|
* Every transition here is a fixed target, and `ReimbursementExpenseService.getReimbursementNextStatusForChild`
|
|
15
15
|
* calls `next()` with no argument, so the factory is instantiated with `void` — a `void` parameter may be
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { IReimbursementFlowContextData } from "../../api";
|
|
2
2
|
import { ReimbursementActionEnum } from "../enums/reimbursement_action_enum";
|
|
3
|
+
import { ReimbursementExpenseActionEnum } from "../enums/reimbursement_expense_action_enum";
|
|
4
|
+
import { ReimbursementExpenseState } from "../enums/reimbursement_expense_state_enum";
|
|
3
5
|
import { ReimbursementStatusEnum } from "../enums/reimbursement_status_enum";
|
|
4
|
-
import { FlowConfig } from "./flow-config.type";
|
|
6
|
+
import { FlowConfig, ParentChildFlowConfig } from "./flow-config.type";
|
|
5
7
|
/**
|
|
6
8
|
* REJECTED, DELETED and PAYMENT_DISBURSE are reachable targets but have no block of their own — a
|
|
7
9
|
* reimbursement that lands in any of them is final at the parent level.
|
|
8
10
|
*/
|
|
9
11
|
export declare const reimbursementFlowConfig: FlowConfig<ReimbursementStatusEnum, ReimbursementActionEnum, IReimbursementFlowContextData>;
|
|
12
|
+
/**
|
|
13
|
+
* The two levels composed into the shape the services consume — `ReimbursementService` reads
|
|
14
|
+
* `.parent` and `ReimbursementExpenseService` reads `.child`. Kept so splitting the files is invisible
|
|
15
|
+
* to every consumer; each level can now also be imported on its own.
|
|
16
|
+
*/
|
|
17
|
+
export declare const reimbursementConfigFlow: ParentChildFlowConfig<ReimbursementStatusEnum, ReimbursementActionEnum, ReimbursementExpenseState, ReimbursementExpenseActionEnum, IReimbursementFlowContextData, void>;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reimbursementFlowConfig = void 0;
|
|
3
|
+
exports.reimbursementConfigFlow = exports.reimbursementFlowConfig = void 0;
|
|
4
4
|
const reimbursement_action_enum_1 = require("../enums/reimbursement_action_enum");
|
|
5
5
|
const reimbursement_expense_state_enum_1 = require("../enums/reimbursement_expense_state_enum");
|
|
6
6
|
const reimbursement_status_enum_1 = require("../enums/reimbursement_status_enum");
|
|
7
7
|
const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
8
|
+
const reimbursement_expense_flow_config_1 = require("./reimbursement_expense_flow.config");
|
|
8
9
|
/**
|
|
9
10
|
* Reimbursement — the parent level of the reimbursement flow.
|
|
10
11
|
*
|
|
11
|
-
* The child level lives in `reimbursement_expense_flow.config.ts`; the two are
|
|
12
|
-
*
|
|
12
|
+
* The child level lives in `reimbursement_expense_flow.config.ts`; the two are composed at the bottom
|
|
13
|
+
* of this file into `reimbursementConfigFlow`, which is what the services consume.
|
|
13
14
|
*
|
|
14
15
|
* The parent takes `IReimbursementFlowContextData` because its UPDATE derives the reimbursement status
|
|
15
16
|
* from the states of its expense rows — the helpers at the bottom of this file. The child takes `void`,
|
|
@@ -100,6 +101,15 @@ exports.reimbursementFlowConfig = {
|
|
|
100
101
|
},
|
|
101
102
|
},
|
|
102
103
|
};
|
|
104
|
+
/**
|
|
105
|
+
* The two levels composed into the shape the services consume — `ReimbursementService` reads
|
|
106
|
+
* `.parent` and `ReimbursementExpenseService` reads `.child`. Kept so splitting the files is invisible
|
|
107
|
+
* to every consumer; each level can now also be imported on its own.
|
|
108
|
+
*/
|
|
109
|
+
exports.reimbursementConfigFlow = {
|
|
110
|
+
parent: exports.reimbursementFlowConfig,
|
|
111
|
+
child: reimbursement_expense_flow_config_1.reimbursementExpenseFlowConfig,
|
|
112
|
+
};
|
|
103
113
|
function areAllRowApproved(data) {
|
|
104
114
|
const { expenseDetails } = data;
|
|
105
115
|
return expenseDetails.length > 0 ? expenseDetails.every((row) => row.state === reimbursement_expense_state_enum_1.ReimbursementExpenseState.APPROVED) : false;
|
|
@@ -47,7 +47,7 @@ export * from "./flow-configs/reimbursement_flow.config";
|
|
|
47
47
|
export * from "./flow-configs/reimbursement_expense_flow.config";
|
|
48
48
|
export * from "./interface/reimbursement.entity.interface";
|
|
49
49
|
export * from "./interface/field-constraint/reimbursement_field_constraints.interface";
|
|
50
|
-
export * from "./enums/
|
|
50
|
+
export * from "./enums/expense_type_enum";
|
|
51
51
|
export * from "./enums/expense_type_action_enum";
|
|
52
52
|
export * from "./enums/expense_type_status_enum";
|
|
53
53
|
export * from "./flow-configs/expense_type_flow.config";
|
|
@@ -63,7 +63,7 @@ __exportStar(require("./flow-configs/reimbursement_flow.config"), exports);
|
|
|
63
63
|
__exportStar(require("./flow-configs/reimbursement_expense_flow.config"), exports);
|
|
64
64
|
__exportStar(require("./interface/reimbursement.entity.interface"), exports);
|
|
65
65
|
__exportStar(require("./interface/field-constraint/reimbursement_field_constraints.interface"), exports);
|
|
66
|
-
__exportStar(require("./enums/
|
|
66
|
+
__exportStar(require("./enums/expense_type_enum"), exports);
|
|
67
67
|
__exportStar(require("./enums/expense_type_action_enum"), exports);
|
|
68
68
|
__exportStar(require("./enums/expense_type_status_enum"), exports);
|
|
69
69
|
__exportStar(require("./flow-configs/expense_type_flow.config"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExpenseTypeEnum } from "../enums/
|
|
1
|
+
import { ExpenseTypeEnum } from "../enums/expense_type_enum";
|
|
2
2
|
import { ExpenseTypeStatusEnum } from "../enums/expense_type_status_enum";
|
|
3
3
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
4
4
|
export interface IExpenseTypeEntity extends IEntityAuditColumn {
|
package/dist/src/entities/interface/field-constraint/expense_type_field_constraints.interface.d.ts
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { IEntityAuditColumn } from "../entity-audit-columns.interface";
|
|
2
2
|
import { IExpenseTypeEntity } from "../expense_type.entity.interface";
|
|
3
3
|
import { IFieldMinMaxConstraint } from "./utils";
|
|
4
|
-
/**
|
|
5
|
-
* excluded, and why:
|
|
6
|
-
* - "type", "status" enum columns, enums carry no min/max
|
|
7
|
-
* - "id", keyof IEntityAuditColumn generated columns
|
|
8
|
-
*
|
|
9
|
-
* this entity has a create DTO only — there is no ExpenseTypeUpdateDto, so no
|
|
10
|
-
* create/update disagreement is possible
|
|
11
|
-
*/
|
|
12
4
|
export type IExpenseTypeFieldLengthConstraintsExclude = "status" | "type" | "id" | keyof IEntityAuditColumn;
|
|
13
5
|
/**
|
|
14
6
|
* since some fields are optional, but we still need their
|
package/dist/src/entities/interface/field-constraint/to_do_list_field_constraints.interface.d.ts
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { IEntityAuditColumn } from "../entity-audit-columns.interface";
|
|
2
2
|
import { IToDoListEntity } from "../to_do_list.entity.interface";
|
|
3
3
|
import { IFieldMinMaxConstraint } from "./utils";
|
|
4
|
-
/**
|
|
5
|
-
* excluded, and why:
|
|
6
|
-
* - "id", keyof IEntityAuditColumn generated columns
|
|
7
|
-
*
|
|
8
|
-
* ToDoListUpdateDto extends PartialType(OmitType(ToDoListCreateDto, ...)), so it inherits every
|
|
9
|
-
* create bound — create and update cannot disagree for this entity
|
|
10
|
-
*/
|
|
11
4
|
export type IToDoListFieldLengthConstraintsExclude = "status" | "id" | keyof IEntityAuditColumn;
|
|
12
5
|
/**
|
|
13
6
|
* since some fields are optional, but we still need their
|
package/dist/src/entities/interface/field-constraint/to_do_list_field_constraints.interface.js
CHANGED
|
@@ -2,30 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.toDoListFieldMinMaxConstraints = void 0;
|
|
4
4
|
exports.toDoListFieldMinMaxConstraints = {
|
|
5
|
-
/**
|
|
6
|
-
* the DTO carries @MinLength(1) and no upper bound, so only the min is wired — the max here
|
|
7
|
-
* bounds the text column
|
|
8
|
-
*/
|
|
9
5
|
description: {
|
|
10
6
|
min: 1,
|
|
11
|
-
max:
|
|
7
|
+
max: 512,
|
|
12
8
|
},
|
|
13
|
-
/**
|
|
14
|
-
* a YYMMDD datecode held as varchar(32) rather than an int — the format is enforced by
|
|
15
|
-
* DateCodeValidator, not by a length bound, so this max bounds the column only; the column type
|
|
16
|
-
* is step-4 material
|
|
17
|
-
*/
|
|
18
|
-
dateCode: {
|
|
19
|
-
max: 32,
|
|
20
|
-
},
|
|
21
|
-
/** minutes, and the DTO bounds this with @IsPositive() plus a multiple-of check, not @Min/@Max */
|
|
22
9
|
estimatedDuration: {
|
|
10
|
+
min: 1,
|
|
11
|
+
max: 1440,
|
|
12
|
+
},
|
|
13
|
+
userId: {
|
|
14
|
+
min: 1,
|
|
23
15
|
max: 9999999,
|
|
24
16
|
},
|
|
25
17
|
projectId: {
|
|
18
|
+
min: 0,
|
|
26
19
|
max: 9999999,
|
|
27
20
|
},
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
date: {
|
|
22
|
+
min: 20250407,
|
|
23
|
+
max: 99999999,
|
|
30
24
|
},
|
|
31
25
|
};
|
|
@@ -3,9 +3,9 @@ import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
|
3
3
|
export interface IToDoListEntity extends IEntityAuditColumn {
|
|
4
4
|
id: number;
|
|
5
5
|
description: string;
|
|
6
|
-
dateCode: string;
|
|
7
6
|
estimatedDuration: number;
|
|
8
|
-
projectId: number;
|
|
9
7
|
userId: number;
|
|
8
|
+
projectId: number;
|
|
10
9
|
status: ToDoListStatusEnum;
|
|
10
|
+
date: number;
|
|
11
11
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
2
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
3
3
|
import { IUserEntity } from "../interface/user.entity.interface";
|
|
4
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
4
5
|
import { IRowActions } from "./interface/row-actions.interface";
|
|
5
6
|
import { UserEntityModel } from "./user.entity.model";
|
|
6
|
-
import {
|
|
7
|
+
import { ExpenseTypeActionEnum } from "../../entities";
|
|
8
|
+
import { ExpenseTypeEnum } from "../enums/expense_type_enum";
|
|
7
9
|
import { ExpenseTypeStatusEnum } from "../enums/expense_type_status_enum";
|
|
8
|
-
import {
|
|
10
|
+
import { IExpenseTypeFlowConfigContextData } from "../flow-configs/expense_type_flow.config";
|
|
9
11
|
import { IExpenseTypeEntity } from "../interface/expense_type.entity.interface";
|
|
10
|
-
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
11
|
-
import { BaseEntityModel } from "./base.entity.model";
|
|
12
12
|
export declare class ExpenseTypeEntityModel extends BaseEntityModel<EntityEnum.EXPENSE_TYPE> implements IExpenseTypeEntity {
|
|
13
13
|
id: number;
|
|
14
14
|
name: string;
|
|
@@ -21,7 +21,7 @@ export declare class ExpenseTypeEntityModel extends BaseEntityModel<EntityEnum.E
|
|
|
21
21
|
updatedBy: number;
|
|
22
22
|
static relationConfigs: RelationConfigs<[], EntityEnum.EXPENSE_TYPE>;
|
|
23
23
|
static fromEntity(entity: IExpenseTypeEntity): ExpenseTypeEntityModel;
|
|
24
|
-
getRelationConfigs(): [];
|
|
24
|
+
getRelationConfigs(): any[];
|
|
25
25
|
getNextStatus(currentUser: IUserEntity, action: ExpenseTypeActionEnum, expenseTypeFlowConfigContextData: IExpenseTypeFlowConfigContextData): ExpenseTypeStatusEnum;
|
|
26
26
|
getAvailableActions(currentUser: UserEntityModel, config?: {
|
|
27
27
|
combinedActions?: Record<string, {
|