law-common 14.1.3 → 14.1.4-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.
- package/dist/src/api/index.d.ts +0 -2
- package/dist/src/api/index.js +0 -2
- package/dist/src/api/interface/billing.create.dto.interface.d.ts +2 -2
- package/dist/src/api/interface/billing_timesheet.details.dto.interface.d.ts +4 -4
- package/dist/src/api/v1/index.d.ts +2 -0
- package/dist/src/api/v1/index.js +2 -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/v2/index.d.ts +2 -0
- package/dist/src/api/v2/index.js +2 -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/entities/flow-configs/expense_type_flow.config.d.ts +34 -1
- package/dist/src/entities/flow-configs/expense_type_flow.config.js +39 -24
- package/dist/src/entities/flow-configs/utils/flow-config.utils.d.ts +89 -0
- package/dist/src/entities/flow-configs/utils/flow-config.utils.js +49 -0
- package/dist/src/entities/flow-configs/work_from_home_flow.config.d.ts +33 -0
- package/dist/src/entities/flow-configs/work_from_home_flow.config.js +3 -3
- package/dist/src/entities/index.d.ts +3 -2
- package/dist/src/entities/index.js +6 -2
- package/dist/src/entities/interface/address_book.entity.interface.d.ts +4 -3
- package/dist/src/entities/interface/billing.entity.interface.d.ts +2 -2
- package/dist/src/entities/interface/billing_particular_line_item.entity.interface.d.ts +2 -1
- package/dist/src/entities/interface/billing_reimbursement_expense.entity.interface.d.ts +2 -1
- package/dist/src/entities/interface/billing_timesheet.entity.interface.d.ts +4 -3
- package/dist/src/entities/interface/billing_transaction.entity.interface.d.ts +5 -5
- package/dist/src/entities/interface/configuration.entity.interface.d.ts +2 -1
- package/dist/src/entities/interface/country.entity.interface.d.ts +2 -2
- package/dist/src/entities/interface/cron_jobs.entity.interface.d.ts +4 -3
- package/dist/src/entities/interface/expense_type.entity.interface.d.ts +3 -2
- package/dist/src/entities/interface/field-constraint/expense_type_field_constraints.interface.d.ts +0 -8
- package/dist/src/entities/interface/leave.entity.interface.d.ts +2 -2
- package/dist/src/entities/interface/moving_timesheet.entity.interface.d.ts +2 -1
- package/dist/src/entities/interface/office_location.entity.interface.d.ts +2 -1
- package/dist/src/entities/interface/organization.entity.interface.d.ts +4 -4
- package/dist/src/entities/interface/organization_type.entity.interface.d.ts +2 -1
- package/dist/src/entities/interface/permission.entity.interface.d.ts +4 -4
- package/dist/src/entities/interface/project.entity.interface.d.ts +4 -4
- package/dist/src/entities/interface/reimbursement.entity.interface.d.ts +11 -10
- package/dist/src/entities/interface/reimbursement_expense.entity.interface.d.ts +4 -3
- package/dist/src/entities/interface/role.entity.interface.d.ts +2 -1
- package/dist/src/entities/interface/tds_rate.entity.interface.d.ts +2 -1
- package/dist/src/entities/interface/timesheet.entity.interface.d.ts +4 -4
- package/dist/src/entities/interface/user.entity.interface.d.ts +25 -25
- package/dist/src/entities/interface/vendor_invoice.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 +5 -5
- package/dist/src/entities/model/project.entity.model.d.ts +5 -5
- package/dist/src/entities/model/project.entity.model.js +2 -1
- package/package.json +1 -1
- /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/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/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";
|
package/dist/src/api/index.js
CHANGED
|
@@ -59,8 +59,6 @@ __exportStar(require("./interface/reimbursement_expense.update.dto.interface"),
|
|
|
59
59
|
__exportStar(require("./interface/billing_reimbursement_expense.create.dto.interface"), exports);
|
|
60
60
|
__exportStar(require("./interface/billing_reimbursement_expense.filter.dto.interface"), exports);
|
|
61
61
|
__exportStar(require("./interface/billing_reimbursement_expense.update.dto.interface"), exports);
|
|
62
|
-
__exportStar(require("./interface/expense_type.create.dto.interface"), exports);
|
|
63
|
-
__exportStar(require("./interface/expense_type.update.dto.interface"), exports);
|
|
64
62
|
__exportStar(require("./interface/expense_type.entity.response"), exports);
|
|
65
63
|
__exportStar(require("./interface/billing.create.dto.interface"), exports);
|
|
66
64
|
__exportStar(require("./interface/billing_particular_line_item.create.dto.interface"), exports);
|
|
@@ -26,7 +26,7 @@ export interface IBillingCreateDtoExtra {
|
|
|
26
26
|
}
|
|
27
27
|
export interface IBillingTimesheetUnchangedDto {
|
|
28
28
|
id: number;
|
|
29
|
-
amount?: number
|
|
29
|
+
amount?: Nullable<number>;
|
|
30
30
|
}
|
|
31
31
|
export interface IBillingTimesheetUpdateDeleteDetailDto {
|
|
32
32
|
id: number;
|
|
@@ -34,7 +34,7 @@ export interface IBillingTimesheetUpdateDeleteDetailDto {
|
|
|
34
34
|
description: string;
|
|
35
35
|
date: string;
|
|
36
36
|
duration: number;
|
|
37
|
-
amount?: number
|
|
37
|
+
amount?: Nullable<number>;
|
|
38
38
|
impact: BillingImpactEnum;
|
|
39
39
|
amendmentPurpose: string;
|
|
40
40
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { BillingImpactEnum, BillingTimesheetStatusEnum, IEntityAuditColumn } from "../../entities";
|
|
1
|
+
import { BillingImpactEnum, BillingTimesheetStatusEnum, IEntityAuditColumn, Nullable } from "../../entities";
|
|
2
2
|
export interface IBillingTimesheetDetails extends IEntityAuditColumn {
|
|
3
3
|
timesheetId: number;
|
|
4
4
|
billingId: number;
|
|
5
|
-
totalAmount?: number
|
|
5
|
+
totalAmount?: Nullable<number>;
|
|
6
6
|
changedStatus: BillingTimesheetStatusEnum;
|
|
7
7
|
impact: BillingImpactEnum;
|
|
8
|
-
amendmentPurpose?: string
|
|
8
|
+
amendmentPurpose?: Nullable<string>;
|
|
9
9
|
userId: number;
|
|
10
10
|
projectId: number;
|
|
11
11
|
task: string;
|
|
12
|
-
description?: string
|
|
12
|
+
description?: Nullable<string>;
|
|
13
13
|
totalDuration: number;
|
|
14
14
|
dateCode: string;
|
|
15
15
|
}
|
|
@@ -5,5 +5,7 @@
|
|
|
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/expense_type.create.dto.interface";
|
|
9
|
+
export * from "./interface/expense_type.update.dto.interface";
|
|
8
10
|
export * from "./interface/to_do_list.create.dto.interface";
|
|
9
11
|
export * from "./interface/to_do_list.update.dto.interface";
|
package/dist/src/api/v1/index.js
CHANGED
|
@@ -21,5 +21,7 @@ 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/expense_type.create.dto.interface"), exports);
|
|
25
|
+
__exportStar(require("./interface/expense_type.update.dto.interface"), exports);
|
|
24
26
|
__exportStar(require("./interface/to_do_list.create.dto.interface"), exports);
|
|
25
27
|
__exportStar(require("./interface/to_do_list.update.dto.interface"), exports);
|
package/dist/src/api/v2/index.js
CHANGED
|
@@ -27,3 +27,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
27
27
|
// };
|
|
28
28
|
__exportStar(require("./interface/to_do_list.create.dto.interface"), exports);
|
|
29
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
|
+
}
|
|
@@ -1,6 +1,39 @@
|
|
|
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
|
+
import { PermissionGroupEnum } from "../enums/permission_group_enum";
|
|
4
5
|
export interface IExpenseTypeFlowConfigContextData {
|
|
5
6
|
}
|
|
7
|
+
export declare const ACTION_MAP: {
|
|
8
|
+
CREATE: {
|
|
9
|
+
reachableStatues: readonly [ExpenseTypeStatusEnum.APPROVED];
|
|
10
|
+
permissions: string[];
|
|
11
|
+
group: PermissionGroupEnum.CREATE;
|
|
12
|
+
};
|
|
13
|
+
UPDATE: {
|
|
14
|
+
reachableStatues: readonly [ExpenseTypeStatusEnum.APPROVED];
|
|
15
|
+
permissions: string[];
|
|
16
|
+
group: PermissionGroupEnum.UPDATE;
|
|
17
|
+
};
|
|
18
|
+
DELETE: {
|
|
19
|
+
reachableStatues: readonly [ExpenseTypeStatusEnum.DELETED];
|
|
20
|
+
permissions: string[];
|
|
21
|
+
group: PermissionGroupEnum.DELETE;
|
|
22
|
+
};
|
|
23
|
+
DEACTIVATE: {
|
|
24
|
+
reachableStatues: readonly [ExpenseTypeStatusEnum.DEACTIVATED];
|
|
25
|
+
permissions: string[];
|
|
26
|
+
group: PermissionGroupEnum.UPDATE;
|
|
27
|
+
};
|
|
28
|
+
ACTIVATE: {
|
|
29
|
+
reachableStatues: readonly [ExpenseTypeStatusEnum.APPROVED];
|
|
30
|
+
permissions: string[];
|
|
31
|
+
group: PermissionGroupEnum.UPDATE;
|
|
32
|
+
};
|
|
33
|
+
RESTORE: {
|
|
34
|
+
reachableStatues: readonly [ExpenseTypeStatusEnum.APPROVED];
|
|
35
|
+
permissions: string[];
|
|
36
|
+
group: PermissionGroupEnum.UPDATE;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
6
39
|
export declare const expenseTypeFlowConfig: FlowConfig<ExpenseTypeStatusEnum, ExpenseTypeActionEnum, IExpenseTypeFlowConfigContextData>;
|
|
@@ -1,70 +1,85 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.expenseTypeFlowConfig = void 0;
|
|
3
|
+
exports.expenseTypeFlowConfig = exports.ACTION_MAP = 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
|
+
const permission_group_enum_1 = require("../enums/permission_group_enum");
|
|
7
8
|
const EXPENSE_TYPE_CREATE_PERMISSION = ["EXPENSE_TYPE_CREATE"];
|
|
8
9
|
const EXPENSE_TYPE_UPDATE_PERMISSION = ["EXPENSE_TYPE_UPDATE"];
|
|
9
10
|
const EXPENSE_TYPE_DELETE_PERMISSION = ["EXPENSE_TYPE_DELETE"];
|
|
10
11
|
const EXPENSE_TYPE_DEACTIVATE_PERMISSION = ["EXPENSE_TYPE_DEACTIVATE"];
|
|
11
12
|
const EXPENSE_TYPE_ACTIVATE_PERMISSION = ["EXPENSE_TYPE_ACTIVATE"];
|
|
12
13
|
const EXPENSE_TYPE_RESTORE_PERMISSION = ["EXPENSE_TYPE_RESTORE"];
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
// Every action declares its group. expense_type_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.
|
|
17
|
+
//
|
|
18
|
+
// The three lifecycle actions share the UPDATE group because that is where `derivePermissionGroup`
|
|
19
|
+
// classifies them — matching work_from_home_flow.config.ts, where RECALL is likewise UPDATE. They are
|
|
20
|
+
// still distinguished by `permissions` above, which `getNextStatus` consults per action, so grouping
|
|
21
|
+
// them together narrows nothing.
|
|
22
|
+
exports.ACTION_MAP = {
|
|
23
|
+
[entities_1.ExpenseTypeActionEnum.CREATE]: {
|
|
15
24
|
reachableStatues: [expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED],
|
|
16
25
|
permissions: EXPENSE_TYPE_CREATE_PERMISSION,
|
|
26
|
+
group: permission_group_enum_1.PermissionGroupEnum.CREATE,
|
|
17
27
|
},
|
|
18
|
-
[
|
|
28
|
+
[entities_1.ExpenseTypeActionEnum.UPDATE]: {
|
|
19
29
|
reachableStatues: [expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED],
|
|
20
30
|
permissions: EXPENSE_TYPE_UPDATE_PERMISSION,
|
|
31
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
21
32
|
},
|
|
22
|
-
[
|
|
33
|
+
[entities_1.ExpenseTypeActionEnum.DELETE]: {
|
|
23
34
|
reachableStatues: [expense_type_status_enum_1.ExpenseTypeStatusEnum.DELETED],
|
|
24
35
|
permissions: EXPENSE_TYPE_DELETE_PERMISSION,
|
|
36
|
+
group: permission_group_enum_1.PermissionGroupEnum.DELETE,
|
|
25
37
|
},
|
|
26
|
-
[
|
|
38
|
+
[entities_1.ExpenseTypeActionEnum.DEACTIVATE]: {
|
|
27
39
|
reachableStatues: [expense_type_status_enum_1.ExpenseTypeStatusEnum.DEACTIVATED],
|
|
28
40
|
permissions: EXPENSE_TYPE_DEACTIVATE_PERMISSION,
|
|
41
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
29
42
|
},
|
|
30
|
-
[
|
|
43
|
+
[entities_1.ExpenseTypeActionEnum.ACTIVATE]: {
|
|
31
44
|
reachableStatues: [expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED],
|
|
32
45
|
permissions: EXPENSE_TYPE_ACTIVATE_PERMISSION,
|
|
46
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
33
47
|
},
|
|
34
|
-
[
|
|
48
|
+
[entities_1.ExpenseTypeActionEnum.RESTORE]: {
|
|
35
49
|
reachableStatues: [expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED],
|
|
36
50
|
permissions: EXPENSE_TYPE_RESTORE_PERMISSION,
|
|
51
|
+
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
37
52
|
},
|
|
38
53
|
};
|
|
39
|
-
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(ACTION_MAP);
|
|
54
|
+
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(exports.ACTION_MAP);
|
|
40
55
|
// APPROVED status transitions
|
|
41
|
-
const transitionApprovedStatusUpdateAction = createActionConfig(
|
|
42
|
-
const transitionApprovedStatusDeleteAction = createActionConfig(
|
|
43
|
-
const transitionApprovedStatusDeactivateAction = createActionConfig(
|
|
56
|
+
const transitionApprovedStatusUpdateAction = createActionConfig(entities_1.ExpenseTypeActionEnum.UPDATE, expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED);
|
|
57
|
+
const transitionApprovedStatusDeleteAction = createActionConfig(entities_1.ExpenseTypeActionEnum.DELETE, expense_type_status_enum_1.ExpenseTypeStatusEnum.DELETED);
|
|
58
|
+
const transitionApprovedStatusDeactivateAction = createActionConfig(entities_1.ExpenseTypeActionEnum.DEACTIVATE, expense_type_status_enum_1.ExpenseTypeStatusEnum.DEACTIVATED);
|
|
44
59
|
// DEACTIVATED status transitions
|
|
45
|
-
const transitionDeactivatedStatusDeleteAction = createActionConfig(
|
|
46
|
-
const transitionDeactivatedStatusActivateAction = createActionConfig(
|
|
60
|
+
const transitionDeactivatedStatusDeleteAction = createActionConfig(entities_1.ExpenseTypeActionEnum.DELETE, expense_type_status_enum_1.ExpenseTypeStatusEnum.DELETED);
|
|
61
|
+
const transitionDeactivatedStatusActivateAction = createActionConfig(entities_1.ExpenseTypeActionEnum.ACTIVATE, expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED);
|
|
47
62
|
// DELETED status transitions
|
|
48
|
-
const transitionDeletedStatusUpdateAction = createActionConfig(
|
|
49
|
-
const transitionDeletedStatusRestoreAction = createActionConfig(
|
|
63
|
+
const transitionDeletedStatusUpdateAction = createActionConfig(entities_1.ExpenseTypeActionEnum.UPDATE, expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED);
|
|
64
|
+
const transitionDeletedStatusRestoreAction = createActionConfig(entities_1.ExpenseTypeActionEnum.RESTORE, expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED);
|
|
50
65
|
exports.expenseTypeFlowConfig = {
|
|
51
66
|
[expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED]: {
|
|
52
67
|
actions: {
|
|
53
|
-
[
|
|
54
|
-
[
|
|
55
|
-
[
|
|
68
|
+
[entities_1.ExpenseTypeActionEnum.UPDATE]: transitionApprovedStatusUpdateAction,
|
|
69
|
+
[entities_1.ExpenseTypeActionEnum.DELETE]: transitionApprovedStatusDeleteAction,
|
|
70
|
+
[entities_1.ExpenseTypeActionEnum.DEACTIVATE]: transitionApprovedStatusDeactivateAction,
|
|
56
71
|
},
|
|
57
72
|
},
|
|
58
73
|
[expense_type_status_enum_1.ExpenseTypeStatusEnum.DEACTIVATED]: {
|
|
59
74
|
actions: {
|
|
60
|
-
[
|
|
61
|
-
[
|
|
75
|
+
[entities_1.ExpenseTypeActionEnum.DELETE]: transitionDeactivatedStatusDeleteAction,
|
|
76
|
+
[entities_1.ExpenseTypeActionEnum.ACTIVATE]: transitionDeactivatedStatusActivateAction,
|
|
62
77
|
},
|
|
63
78
|
},
|
|
64
79
|
[expense_type_status_enum_1.ExpenseTypeStatusEnum.DELETED]: {
|
|
65
80
|
actions: {
|
|
66
|
-
[
|
|
67
|
-
[
|
|
81
|
+
[entities_1.ExpenseTypeActionEnum.UPDATE]: transitionDeletedStatusUpdateAction,
|
|
82
|
+
[entities_1.ExpenseTypeActionEnum.RESTORE]: transitionDeletedStatusRestoreAction,
|
|
68
83
|
},
|
|
69
84
|
},
|
|
70
85
|
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { PermissionGroupEnum } from "../../enums/permission_group_enum";
|
|
2
|
+
/**
|
|
3
|
+
* Registry of per-entity action maps; each value is the whole ACTION_MAP that entity's flow config exports
|
|
4
|
+
* (register one by exporting its ACTION_MAP and adding a line here). Entity and action params derive from it.
|
|
5
|
+
* Example: enumToActionMap[EntityEnum.WORK_FROM_HOME] → { CREATE, UPDATE, DELETE, APPROVE, REJECT, RECALL: ActionMapEntry }
|
|
6
|
+
*/
|
|
7
|
+
export declare const enumToActionMap: {
|
|
8
|
+
expense_type: {
|
|
9
|
+
CREATE: {
|
|
10
|
+
reachableStatues: readonly [import("../..").ExpenseTypeStatusEnum.APPROVED];
|
|
11
|
+
permissions: string[];
|
|
12
|
+
group: PermissionGroupEnum.CREATE;
|
|
13
|
+
};
|
|
14
|
+
UPDATE: {
|
|
15
|
+
reachableStatues: readonly [import("../..").ExpenseTypeStatusEnum.APPROVED];
|
|
16
|
+
permissions: string[];
|
|
17
|
+
group: PermissionGroupEnum.UPDATE;
|
|
18
|
+
};
|
|
19
|
+
DELETE: {
|
|
20
|
+
reachableStatues: readonly [import("../..").ExpenseTypeStatusEnum.DELETED];
|
|
21
|
+
permissions: string[];
|
|
22
|
+
group: PermissionGroupEnum.DELETE;
|
|
23
|
+
};
|
|
24
|
+
DEACTIVATE: {
|
|
25
|
+
reachableStatues: readonly [import("../..").ExpenseTypeStatusEnum.DEACTIVATED];
|
|
26
|
+
permissions: string[];
|
|
27
|
+
group: PermissionGroupEnum.UPDATE;
|
|
28
|
+
};
|
|
29
|
+
ACTIVATE: {
|
|
30
|
+
reachableStatues: readonly [import("../..").ExpenseTypeStatusEnum.APPROVED];
|
|
31
|
+
permissions: string[];
|
|
32
|
+
group: PermissionGroupEnum.UPDATE;
|
|
33
|
+
};
|
|
34
|
+
RESTORE: {
|
|
35
|
+
reachableStatues: readonly [import("../..").ExpenseTypeStatusEnum.APPROVED];
|
|
36
|
+
permissions: string[];
|
|
37
|
+
group: PermissionGroupEnum.UPDATE;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
work_from_home: {
|
|
41
|
+
CREATE: {
|
|
42
|
+
reachableStatues: readonly [import("../..").WorkFromHomeStatusEnum.CREATE_APPROVAL_PENDING];
|
|
43
|
+
permissions: string[];
|
|
44
|
+
group: PermissionGroupEnum.CREATE;
|
|
45
|
+
};
|
|
46
|
+
UPDATE: {
|
|
47
|
+
reachableStatues: readonly [import("../..").WorkFromHomeStatusEnum.CREATE_APPROVAL_PENDING, import("../..").WorkFromHomeStatusEnum.UPDATE_APPROVAL_PENDING];
|
|
48
|
+
permissions: string[];
|
|
49
|
+
group: PermissionGroupEnum.UPDATE;
|
|
50
|
+
};
|
|
51
|
+
DELETE: {
|
|
52
|
+
reachableStatues: readonly [import("../..").WorkFromHomeStatusEnum.DELETE_APPROVAL_PENDING, import("../..").WorkFromHomeStatusEnum.DELETED];
|
|
53
|
+
permissions: string[];
|
|
54
|
+
group: PermissionGroupEnum.DELETE;
|
|
55
|
+
};
|
|
56
|
+
APPROVE: {
|
|
57
|
+
reachableStatues: readonly [import("../..").WorkFromHomeStatusEnum.APPROVED, import("../..").WorkFromHomeStatusEnum.DELETED];
|
|
58
|
+
permissions: string[];
|
|
59
|
+
group: PermissionGroupEnum.APPROVAL_FLOW;
|
|
60
|
+
};
|
|
61
|
+
REJECT: {
|
|
62
|
+
reachableStatues: readonly [import("../..").WorkFromHomeStatusEnum.REJECTED, import("../..").WorkFromHomeStatusEnum.RESOLVED_REJECTED];
|
|
63
|
+
permissions: string[];
|
|
64
|
+
group: PermissionGroupEnum.APPROVAL_FLOW;
|
|
65
|
+
};
|
|
66
|
+
RECALL: {
|
|
67
|
+
reachableStatues: readonly [import("../..").WorkFromHomeStatusEnum.APPROVED];
|
|
68
|
+
permissions: string[];
|
|
69
|
+
group: PermissionGroupEnum.UPDATE;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
export type EnumToActionMap = typeof enumToActionMap;
|
|
74
|
+
/**
|
|
75
|
+
* Action enum values registered for entity `E`, via a mapped-union lookup (bare keyof would include symbol,
|
|
76
|
+
* breaking template interpolation — TS2731).
|
|
77
|
+
* Example: RegisteredActions<EntityEnum.WORK_FROM_HOME> → "CREATE" | "UPDATE" | "DELETE" | "APPROVE" | "REJECT" | "RECALL"
|
|
78
|
+
*/
|
|
79
|
+
export type RegisteredActions<E extends keyof EnumToActionMap> = {
|
|
80
|
+
[K in keyof EnumToActionMap]: keyof EnumToActionMap[K] & string;
|
|
81
|
+
}[E];
|
|
82
|
+
export declare class FlowConfigUtils {
|
|
83
|
+
/**
|
|
84
|
+
* Resolves the permission group an action is authorised under, from the entity's flat ACTION_MAP.
|
|
85
|
+
* Needs only entity + action (no status, no existing entity)
|
|
86
|
+
* Example: getPermissionGroupByAction(EntityEnum.WORK_FROM_HOME, WorkFromHomeActionEnum.APPROVE) → PermissionGroupEnum.APPROVAL_FLOW.
|
|
87
|
+
*/
|
|
88
|
+
static getPermissionGroupByAction<E extends keyof EnumToActionMap>(entity: E, action: RegisteredActions<E>): PermissionGroupEnum;
|
|
89
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowConfigUtils = exports.enumToActionMap = void 0;
|
|
4
|
+
const error_key_enum_1 = require("../../../enums/error.key.enum");
|
|
5
|
+
const exceptions_1 = require("../../../exceptions");
|
|
6
|
+
const entity_utils_interface_1 = require("../../interface/entity.utils.interface");
|
|
7
|
+
const expense_type_flow_config_1 = require("../expense_type_flow.config");
|
|
8
|
+
const work_from_home_flow_config_1 = require("../work_from_home_flow.config");
|
|
9
|
+
/**
|
|
10
|
+
* Registry of per-entity action maps; each value is the whole ACTION_MAP that entity's flow config exports
|
|
11
|
+
* (register one by exporting its ACTION_MAP and adding a line here). Entity and action params derive from it.
|
|
12
|
+
* Example: enumToActionMap[EntityEnum.WORK_FROM_HOME] → { CREATE, UPDATE, DELETE, APPROVE, REJECT, RECALL: ActionMapEntry }
|
|
13
|
+
*/
|
|
14
|
+
exports.enumToActionMap = {
|
|
15
|
+
[entity_utils_interface_1.EntityEnum.EXPENSE_TYPE]: expense_type_flow_config_1.ACTION_MAP,
|
|
16
|
+
[entity_utils_interface_1.EntityEnum.WORK_FROM_HOME]: work_from_home_flow_config_1.ACTION_MAP,
|
|
17
|
+
};
|
|
18
|
+
class FlowConfigUtils {
|
|
19
|
+
/**
|
|
20
|
+
* Resolves the permission group an action is authorised under, from the entity's flat ACTION_MAP.
|
|
21
|
+
* Needs only entity + action (no status, no existing entity)
|
|
22
|
+
* Example: getPermissionGroupByAction(EntityEnum.WORK_FROM_HOME, WorkFromHomeActionEnum.APPROVE) → PermissionGroupEnum.APPROVAL_FLOW.
|
|
23
|
+
*/
|
|
24
|
+
static getPermissionGroupByAction(entity, action) {
|
|
25
|
+
const actionMap = exports.enumToActionMap[entity];
|
|
26
|
+
if (!actionMap) {
|
|
27
|
+
throw new exceptions_1.AppBadRequestException({
|
|
28
|
+
key: error_key_enum_1.ErrorKeyEnum.ENTITY,
|
|
29
|
+
message: [`No action map registered for entity '${entity}'`],
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const actionConfig = actionMap[action];
|
|
33
|
+
if (!actionConfig) {
|
|
34
|
+
throw new exceptions_1.AppBadRequestException({
|
|
35
|
+
key: error_key_enum_1.ErrorKeyEnum.ACTION,
|
|
36
|
+
message: [`Action '${action}' is not configured for entity '${entity}'`],
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
const group = actionConfig.group;
|
|
40
|
+
if (!group) {
|
|
41
|
+
throw new exceptions_1.AppBadRequestException({
|
|
42
|
+
key: error_key_enum_1.ErrorKeyEnum.PERMISSION_GROUP,
|
|
43
|
+
message: [`Action '${action}' for entity '${entity}' has no permission group configured. Declare it in the entity's flow config.`],
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return group;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.FlowConfigUtils = FlowConfigUtils;
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
import { FlowConfig } from "./flow-config.type";
|
|
2
|
+
import { PermissionGroupEnum } from "../enums/permission_group_enum";
|
|
2
3
|
import { WorkFromHomeActionEnum } from "../enums/work_from_home_action_enum";
|
|
3
4
|
import { WorkFromHomeStatusEnum } from "../enums/work_from_home_status_enum";
|
|
4
5
|
export interface IWorkFromHomeFlowConfigContextData {
|
|
5
6
|
}
|
|
7
|
+
export declare const ACTION_MAP: {
|
|
8
|
+
CREATE: {
|
|
9
|
+
reachableStatues: readonly [WorkFromHomeStatusEnum.CREATE_APPROVAL_PENDING];
|
|
10
|
+
permissions: string[];
|
|
11
|
+
group: PermissionGroupEnum.CREATE;
|
|
12
|
+
};
|
|
13
|
+
UPDATE: {
|
|
14
|
+
reachableStatues: readonly [WorkFromHomeStatusEnum.CREATE_APPROVAL_PENDING, WorkFromHomeStatusEnum.UPDATE_APPROVAL_PENDING];
|
|
15
|
+
permissions: string[];
|
|
16
|
+
group: PermissionGroupEnum.UPDATE;
|
|
17
|
+
};
|
|
18
|
+
DELETE: {
|
|
19
|
+
reachableStatues: readonly [WorkFromHomeStatusEnum.DELETE_APPROVAL_PENDING, WorkFromHomeStatusEnum.DELETED];
|
|
20
|
+
permissions: string[];
|
|
21
|
+
group: PermissionGroupEnum.DELETE;
|
|
22
|
+
};
|
|
23
|
+
APPROVE: {
|
|
24
|
+
reachableStatues: readonly [WorkFromHomeStatusEnum.APPROVED, WorkFromHomeStatusEnum.DELETED];
|
|
25
|
+
permissions: string[];
|
|
26
|
+
group: PermissionGroupEnum.APPROVAL_FLOW;
|
|
27
|
+
};
|
|
28
|
+
REJECT: {
|
|
29
|
+
reachableStatues: readonly [WorkFromHomeStatusEnum.REJECTED, WorkFromHomeStatusEnum.RESOLVED_REJECTED];
|
|
30
|
+
permissions: string[];
|
|
31
|
+
group: PermissionGroupEnum.APPROVAL_FLOW;
|
|
32
|
+
};
|
|
33
|
+
RECALL: {
|
|
34
|
+
reachableStatues: readonly [WorkFromHomeStatusEnum.APPROVED];
|
|
35
|
+
permissions: string[];
|
|
36
|
+
group: PermissionGroupEnum.UPDATE;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
6
39
|
export declare const workFromHomeFlowConfig: FlowConfig<WorkFromHomeStatusEnum, WorkFromHomeActionEnum, IWorkFromHomeFlowConfigContextData>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.workFromHomeFlowConfig = void 0;
|
|
3
|
+
exports.workFromHomeFlowConfig = exports.ACTION_MAP = void 0;
|
|
4
4
|
const base_flow_config_factory_1 = require("./base-flow-config.factory");
|
|
5
5
|
const permission_group_enum_1 = require("../enums/permission_group_enum");
|
|
6
6
|
const work_from_home_action_enum_1 = require("../enums/work_from_home_action_enum");
|
|
@@ -14,7 +14,7 @@ const WORK_FROM_HOME_REJECT_PERMISSION = ["WORK_FROM_HOME_APPROVER_ORG"];
|
|
|
14
14
|
const WORK_FROM_HOME_RECALL_PERMISSION = ["WORK_FROM_HOME_UPDATE_ORG", "WORK_FROM_HOME_UPDATE_SELF"];
|
|
15
15
|
// Every action declares its group. work_from_home_bulk_update.transaction.ts refuses to
|
|
16
16
|
// default an absent group, so all six must be annotated for any transition to keep working.
|
|
17
|
-
|
|
17
|
+
exports.ACTION_MAP = {
|
|
18
18
|
[work_from_home_action_enum_1.WorkFromHomeActionEnum.CREATE]: {
|
|
19
19
|
reachableStatues: [work_from_home_status_enum_1.WorkFromHomeStatusEnum.CREATE_APPROVAL_PENDING],
|
|
20
20
|
permissions: WORK_FROM_HOME_CREATE_PERMISSION,
|
|
@@ -50,7 +50,7 @@ const ACTION_MAP = {
|
|
|
50
50
|
group: permission_group_enum_1.PermissionGroupEnum.UPDATE,
|
|
51
51
|
},
|
|
52
52
|
};
|
|
53
|
-
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(ACTION_MAP);
|
|
53
|
+
const { createActionConfig } = (0, base_flow_config_factory_1.createFlowConfigFactory)()(exports.ACTION_MAP);
|
|
54
54
|
// CREATE_APPROVAL_PENDING status transitions
|
|
55
55
|
const transitionCreateApprovalPendingStatusUpdateAction = createActionConfig(work_from_home_action_enum_1.WorkFromHomeActionEnum.UPDATE, work_from_home_status_enum_1.WorkFromHomeStatusEnum.CREATE_APPROVAL_PENDING);
|
|
56
56
|
const transitionCreateApprovalPendingStatusDeleteAction = createActionConfig(work_from_home_action_enum_1.WorkFromHomeActionEnum.DELETE, work_from_home_status_enum_1.WorkFromHomeStatusEnum.DELETED);
|
|
@@ -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";
|
|
@@ -403,10 +403,11 @@ export * from "./interface/field-constraint/rate_field_constraints.interface";
|
|
|
403
403
|
export * from "./model/rate.entity.model";
|
|
404
404
|
export * from "./enums/work_from_home_action_enum";
|
|
405
405
|
export * from "./enums/work_from_home_status_enum";
|
|
406
|
-
export
|
|
406
|
+
export { IWorkFromHomeFlowConfigContextData, ACTION_MAP as WORK_FROM_HOME_ACTION_MAP, workFromHomeFlowConfig } from "./flow-configs/work_from_home_flow.config";
|
|
407
407
|
export * from "./interface/field-constraint/work_from_home_field_constraints.interface";
|
|
408
408
|
export * from "./interface/work_from_home.entity.interface";
|
|
409
409
|
export * from "./model/work_from_home.entity.model";
|
|
410
410
|
export * from "./enums/user_gender_enum";
|
|
411
411
|
export * from "./enums/user_role_enum";
|
|
412
412
|
export * from "./enums/user_status_enum";
|
|
413
|
+
export * from "./flow-configs/utils/flow-config.utils";
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.workFromHomeFlowConfig = exports.WORK_FROM_HOME_ACTION_MAP = void 0;
|
|
17
18
|
__exportStar(require("./enums/organization_action_enum"), exports);
|
|
18
19
|
__exportStar(require("./enums/organization_status_enum"), exports);
|
|
19
20
|
__exportStar(require("./flow-configs/organization_flow.config"), exports);
|
|
@@ -63,7 +64,7 @@ __exportStar(require("./flow-configs/reimbursement_flow.config"), exports);
|
|
|
63
64
|
__exportStar(require("./flow-configs/reimbursement_expense_flow.config"), exports);
|
|
64
65
|
__exportStar(require("./interface/reimbursement.entity.interface"), exports);
|
|
65
66
|
__exportStar(require("./interface/field-constraint/reimbursement_field_constraints.interface"), exports);
|
|
66
|
-
__exportStar(require("./enums/
|
|
67
|
+
__exportStar(require("./enums/expense_type_enum"), exports);
|
|
67
68
|
__exportStar(require("./enums/expense_type_action_enum"), exports);
|
|
68
69
|
__exportStar(require("./enums/expense_type_status_enum"), exports);
|
|
69
70
|
__exportStar(require("./flow-configs/expense_type_flow.config"), exports);
|
|
@@ -420,10 +421,13 @@ __exportStar(require("./interface/field-constraint/rate_field_constraints.interf
|
|
|
420
421
|
__exportStar(require("./model/rate.entity.model"), exports);
|
|
421
422
|
__exportStar(require("./enums/work_from_home_action_enum"), exports);
|
|
422
423
|
__exportStar(require("./enums/work_from_home_status_enum"), exports);
|
|
423
|
-
|
|
424
|
+
var work_from_home_flow_config_1 = require("./flow-configs/work_from_home_flow.config");
|
|
425
|
+
Object.defineProperty(exports, "WORK_FROM_HOME_ACTION_MAP", { enumerable: true, get: function () { return work_from_home_flow_config_1.ACTION_MAP; } });
|
|
426
|
+
Object.defineProperty(exports, "workFromHomeFlowConfig", { enumerable: true, get: function () { return work_from_home_flow_config_1.workFromHomeFlowConfig; } });
|
|
424
427
|
__exportStar(require("./interface/field-constraint/work_from_home_field_constraints.interface"), exports);
|
|
425
428
|
__exportStar(require("./interface/work_from_home.entity.interface"), exports);
|
|
426
429
|
__exportStar(require("./model/work_from_home.entity.model"), exports);
|
|
427
430
|
__exportStar(require("./enums/user_gender_enum"), exports);
|
|
428
431
|
__exportStar(require("./enums/user_role_enum"), exports);
|
|
429
432
|
__exportStar(require("./enums/user_status_enum"), exports);
|
|
433
|
+
__exportStar(require("./flow-configs/utils/flow-config.utils"), exports);
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
2
|
+
import { Nullable } from "./entity.utils.interface";
|
|
2
3
|
import { AddressBookStatusEnum } from "../enums/address_book_status_enum";
|
|
3
4
|
export interface IAddressBookEntity extends IEntityAuditColumn {
|
|
4
5
|
id: number;
|
|
5
6
|
organizationName: string;
|
|
6
7
|
contactDetail: string;
|
|
7
8
|
country: string;
|
|
8
|
-
notes?: string
|
|
9
|
-
introducedBy?: number
|
|
9
|
+
notes?: Nullable<string>;
|
|
10
|
+
introducedBy?: Nullable<number>;
|
|
10
11
|
organizationId: number;
|
|
11
|
-
address?: string
|
|
12
|
+
address?: Nullable<string>;
|
|
12
13
|
status: AddressBookStatusEnum;
|
|
13
14
|
}
|
|
@@ -12,7 +12,7 @@ export interface IBillingEntity extends IEntityAuditColumn {
|
|
|
12
12
|
invoiceDate: number;
|
|
13
13
|
projectId: number;
|
|
14
14
|
totalAmount: number;
|
|
15
|
-
inrAmount?: number
|
|
15
|
+
inrAmount?: Nullable<number>;
|
|
16
16
|
totalMinutes: number;
|
|
17
17
|
draftInvoiceNumber: string;
|
|
18
18
|
invoiceNumber: Nullable<string>;
|
|
@@ -32,7 +32,7 @@ export interface IBillingEntity extends IEntityAuditColumn {
|
|
|
32
32
|
particulars: string;
|
|
33
33
|
currency: CurrencyEnum;
|
|
34
34
|
type: BillingTypeEnum;
|
|
35
|
-
isProjectComplete?: boolean
|
|
35
|
+
isProjectComplete?: Nullable<boolean>;
|
|
36
36
|
}
|
|
37
37
|
export interface IBillingEntityFilterDto extends IEntityFilterData<IBillingEntity> {
|
|
38
38
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { BillingParticularLineItemChangedStatusEnum } from "../enums/billing_particular_line_item_changed_status_enum";
|
|
2
2
|
import { BillingParticularLineItemSourceEnum } from "../enums/billing_particular_line_item_source_enum";
|
|
3
3
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
4
|
+
import { Nullable } from "./entity.utils.interface";
|
|
4
5
|
export interface IBillingParticularLineItemEntity extends IEntityAuditColumn {
|
|
5
6
|
id: number;
|
|
6
7
|
billingId: number;
|
|
7
|
-
description: string
|
|
8
|
+
description: Nullable<string>;
|
|
8
9
|
amount: number;
|
|
9
10
|
source: BillingParticularLineItemSourceEnum;
|
|
10
11
|
changedStatus: BillingParticularLineItemChangedStatusEnum;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BillingReimbursementExpenseChangedStatusEnum } from "../enums/billing_reimbursement_expense_change_status_enum";
|
|
2
2
|
import { BillingReimbursementExpenseImpactEnum } from "../enums/billing_reimbursement_expense_impact_enum";
|
|
3
3
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
4
|
+
import { Nullable } from "./entity.utils.interface";
|
|
4
5
|
export interface IBillingReimbursementExpenseEntity extends IEntityAuditColumn {
|
|
5
6
|
id: number;
|
|
6
7
|
billingId: number;
|
|
@@ -11,6 +12,6 @@ export interface IBillingReimbursementExpenseEntity extends IEntityAuditColumn {
|
|
|
11
12
|
totalAmount: number;
|
|
12
13
|
expenseIncurredDate: string;
|
|
13
14
|
changedStatus: BillingReimbursementExpenseChangedStatusEnum;
|
|
14
|
-
amendmentPurpose?: string
|
|
15
|
+
amendmentPurpose?: Nullable<string>;
|
|
15
16
|
impact?: BillingReimbursementExpenseImpactEnum;
|
|
16
17
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BillingImpactEnum } from "../enums/billing_impact_enum";
|
|
2
2
|
import { BillingTimesheetStatusEnum } from "../enums/billing_timesheet_change_status_enum";
|
|
3
3
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
4
|
+
import { Nullable } from "./entity.utils.interface";
|
|
4
5
|
export interface IBillingTimesheetEntity extends IEntityAuditColumn {
|
|
5
6
|
id: number;
|
|
6
7
|
billingId: number;
|
|
@@ -9,10 +10,10 @@ export interface IBillingTimesheetEntity extends IEntityAuditColumn {
|
|
|
9
10
|
userId: number;
|
|
10
11
|
projectId: number;
|
|
11
12
|
task: string;
|
|
12
|
-
description?: string
|
|
13
|
+
description?: Nullable<string>;
|
|
13
14
|
totalDuration: number;
|
|
14
|
-
totalAmount?: number
|
|
15
|
+
totalAmount?: Nullable<number>;
|
|
15
16
|
impact: BillingImpactEnum;
|
|
16
|
-
amendmentPurpose?: string
|
|
17
|
+
amendmentPurpose?: Nullable<string>;
|
|
17
18
|
changedStatus: BillingTimesheetStatusEnum;
|
|
18
19
|
}
|
|
@@ -5,14 +5,14 @@ import { Nullable } from "./entity.utils.interface";
|
|
|
5
5
|
export interface IBillingTransactionEntity extends IEntityAuditColumn {
|
|
6
6
|
id: number;
|
|
7
7
|
billingId: number;
|
|
8
|
-
advanceBillingId?: number
|
|
8
|
+
advanceBillingId?: Nullable<number>;
|
|
9
9
|
type: BillingTransactionType;
|
|
10
10
|
amount: number;
|
|
11
11
|
details: string;
|
|
12
|
-
bankCharges?: number
|
|
13
|
-
bankId?: number
|
|
14
|
-
paymentDate?: string
|
|
12
|
+
bankCharges?: Nullable<number>;
|
|
13
|
+
bankId?: Nullable<number>;
|
|
14
|
+
paymentDate?: Nullable<string>;
|
|
15
15
|
referenceNo?: Nullable<string>;
|
|
16
|
-
supportingDocsUrls?: string
|
|
16
|
+
supportingDocsUrls?: Nullable<string>;
|
|
17
17
|
status: BillingTransactionStatusEnum;
|
|
18
18
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ConfigurationKeyEnum } from "../enums/configuration_key_enum";
|
|
2
2
|
import { ConfigurationTypeEnum } from "../enums/configuration_type_enum";
|
|
3
3
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
4
|
+
import { Nullable } from "./entity.utils.interface";
|
|
4
5
|
export interface IConfigurationEntity extends IEntityAuditColumn {
|
|
5
6
|
id: number;
|
|
6
7
|
key: ConfigurationKeyEnum;
|
|
@@ -8,6 +9,6 @@ export interface IConfigurationEntity extends IEntityAuditColumn {
|
|
|
8
9
|
organizationId: number;
|
|
9
10
|
label: string;
|
|
10
11
|
type: ConfigurationTypeEnum;
|
|
11
|
-
description?: string
|
|
12
|
+
description?: Nullable<string>;
|
|
12
13
|
}
|
|
13
14
|
export type IConfigurationExclude = "organizationId";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CountryStatusEnum } from "../enums/country_status_enum";
|
|
2
2
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
3
|
-
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
|
|
3
|
+
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto, Nullable } from "./entity.utils.interface";
|
|
4
4
|
export interface ICountryEntity extends IEntityAuditColumn {
|
|
5
5
|
id: number;
|
|
6
6
|
name: string;
|
|
7
|
-
status: CountryStatusEnum
|
|
7
|
+
status: Nullable<CountryStatusEnum>;
|
|
8
8
|
}
|
|
9
9
|
export type ICountryCreateDtoExclude = "status";
|
|
10
10
|
export interface ICountryEntityCreateDto extends Omit<IEntityCreateDto<ICountryEntity>, ICountryCreateDtoExclude> {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { CronJobNames } from "../enums/cron_jobs_name_enum";
|
|
2
2
|
import { CronJobStatus } from "../enums/cron_jobs_status_enum";
|
|
3
3
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
4
|
+
import { Nullable } from "./entity.utils.interface";
|
|
4
5
|
export interface ICronJobsEntity extends IEntityAuditColumn {
|
|
5
6
|
id: number;
|
|
6
7
|
job: CronJobNames;
|
|
7
8
|
startTime: Date;
|
|
8
|
-
endTime?: Date
|
|
9
|
+
endTime?: Nullable<Date>;
|
|
9
10
|
message: string;
|
|
10
|
-
error?: string
|
|
11
|
-
parameters?: string
|
|
11
|
+
error?: Nullable<string>;
|
|
12
|
+
parameters?: Nullable<string>;
|
|
12
13
|
status: CronJobStatus;
|
|
13
14
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
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
|
+
import { Nullable } from "./entity.utils.interface";
|
|
4
5
|
export interface IExpenseTypeEntity extends IEntityAuditColumn {
|
|
5
6
|
id: number;
|
|
6
7
|
name: string;
|
|
7
|
-
description?: string
|
|
8
|
+
description?: Nullable<string>;
|
|
8
9
|
type: ExpenseTypeEnum;
|
|
9
10
|
status: ExpenseTypeStatusEnum;
|
|
10
11
|
}
|
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
|
|
@@ -2,7 +2,7 @@ import { DurationTypeEnum } from "../enums/duration_type_enum";
|
|
|
2
2
|
import { LeaveStatusEnum } from "../enums/leave_status_enum";
|
|
3
3
|
import { LeaveTypeEnum } from "../enums/leave_type_enum";
|
|
4
4
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
5
|
-
import { EnumEntityType, VirtualEntityEnum } from "./entity.utils.interface";
|
|
5
|
+
import { EnumEntityType, Nullable, VirtualEntityEnum } from "./entity.utils.interface";
|
|
6
6
|
export interface ILeaveEntity extends IEntityAuditColumn {
|
|
7
7
|
id: number;
|
|
8
8
|
employeeId: number;
|
|
@@ -11,7 +11,7 @@ export interface ILeaveEntity extends IEntityAuditColumn {
|
|
|
11
11
|
reason: string;
|
|
12
12
|
durationType: DurationTypeEnum;
|
|
13
13
|
status: LeaveStatusEnum;
|
|
14
|
-
remark?: string
|
|
14
|
+
remark?: Nullable<string>;
|
|
15
15
|
type: LeaveTypeEnum;
|
|
16
16
|
}
|
|
17
17
|
export interface ILeaveVirtualEntityColumnKeys {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MovingTimesheetStatusEnum } from "../enums/moving_timesheet_status_enum";
|
|
2
2
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
3
|
+
import { Nullable } from "./entity.utils.interface";
|
|
3
4
|
export interface IMovingTimesheetEntity extends IEntityAuditColumn {
|
|
4
5
|
id: number;
|
|
5
6
|
timesheetId: number;
|
|
@@ -7,5 +8,5 @@ export interface IMovingTimesheetEntity extends IEntityAuditColumn {
|
|
|
7
8
|
targetProjectId: number;
|
|
8
9
|
status: MovingTimesheetStatusEnum;
|
|
9
10
|
reason: string;
|
|
10
|
-
remark?: string
|
|
11
|
+
remark?: Nullable<string>;
|
|
11
12
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { OfficeLocationStatusEnum } from "../enums/office_location_status_enum";
|
|
2
2
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
3
|
+
import { Nullable } from "./entity.utils.interface";
|
|
3
4
|
export interface IOfficeLocationEntity extends IEntityAuditColumn {
|
|
4
5
|
id: number;
|
|
5
6
|
name: string;
|
|
6
7
|
address: string;
|
|
7
8
|
zipCode: number;
|
|
8
|
-
country: string
|
|
9
|
+
country: Nullable<string>;
|
|
9
10
|
organizationId: number;
|
|
10
11
|
status: OfficeLocationStatusEnum;
|
|
11
12
|
}
|
|
@@ -4,10 +4,10 @@ import { Nullable } from "./entity.utils.interface";
|
|
|
4
4
|
export interface IOrganizationEntity extends IEntityAuditColumn {
|
|
5
5
|
id: number;
|
|
6
6
|
name: string;
|
|
7
|
-
email: string
|
|
8
|
-
contact: string
|
|
9
|
-
description: string
|
|
10
|
-
address: string
|
|
7
|
+
email: Nullable<string>;
|
|
8
|
+
contact: Nullable<string>;
|
|
9
|
+
description: Nullable<string>;
|
|
10
|
+
address: Nullable<string>;
|
|
11
11
|
status: OrganizationStatusEnum;
|
|
12
12
|
panNo: string;
|
|
13
13
|
panDocumentUrl?: Nullable<string>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { OrganizationTypeStatusEnum } from "../enums/organization_type_status_enum";
|
|
2
2
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
3
|
+
import { Nullable } from "./entity.utils.interface";
|
|
3
4
|
export interface IOrganizationTypeEntity extends IEntityAuditColumn {
|
|
4
5
|
id: number;
|
|
5
6
|
code: string;
|
|
6
|
-
name: string
|
|
7
|
+
name: Nullable<string>;
|
|
7
8
|
status: OrganizationTypeStatusEnum;
|
|
8
9
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { PermissionGroupEnum } from "../enums/permission_group_enum";
|
|
2
|
-
import { EntityEnum } from "./entity.utils.interface";
|
|
2
|
+
import { EntityEnum, Nullable } from "./entity.utils.interface";
|
|
3
3
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
4
4
|
export interface IPermissionEntity extends IEntityAuditColumn {
|
|
5
5
|
id: number;
|
|
6
6
|
name: string;
|
|
7
|
-
description?: string
|
|
7
|
+
description?: Nullable<string>;
|
|
8
8
|
organizationId: number;
|
|
9
9
|
/**
|
|
10
10
|
* nullable on purpose — the backfill is incomplete, and an unmapped row must keep
|
|
11
11
|
* resolving by name until it is mapped. promoted to NOT NULL in a follow-up migration.
|
|
12
12
|
*/
|
|
13
|
-
entity?: EntityEnum
|
|
14
|
-
group?: PermissionGroupEnum
|
|
13
|
+
entity?: Nullable<EntityEnum>;
|
|
14
|
+
group?: Nullable<PermissionGroupEnum>;
|
|
15
15
|
}
|
|
@@ -15,10 +15,10 @@ export interface IProjectEntity extends IEntityAuditColumn {
|
|
|
15
15
|
billingRate: string;
|
|
16
16
|
status: ProjectStatusEnum;
|
|
17
17
|
organizationId: number;
|
|
18
|
-
description?: string
|
|
19
|
-
expectedEndDate?: string
|
|
20
|
-
actualEndDate?: string
|
|
21
|
-
billingOverdueDays?: number
|
|
18
|
+
description?: Nullable<string>;
|
|
19
|
+
expectedEndDate?: Nullable<string>;
|
|
20
|
+
actualEndDate?: Nullable<string>;
|
|
21
|
+
billingOverdueDays?: Nullable<number>;
|
|
22
22
|
billToClientAffiliateId?: Nullable<number>;
|
|
23
23
|
revenueSplit: ProjectRevenueSplitEnum;
|
|
24
24
|
usageNotificationSentPercentage?: Nullable<UsageNotificationThresholdEnum>;
|
|
@@ -6,26 +6,27 @@ import { ReimbursementIncurredByEnum } from "../enums/reimbursement_incurred_by_
|
|
|
6
6
|
import { ReimbursementPaymentStatusEnum } from "../enums/reimbursement_payment_status_enum";
|
|
7
7
|
import { ReimbursementStatusEnum } from "../enums/reimbursement_status_enum";
|
|
8
8
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
9
|
+
import { Nullable } from "./entity.utils.interface";
|
|
9
10
|
export interface IReimbursementEntity extends IEntityAuditColumn {
|
|
10
11
|
id: number;
|
|
11
12
|
billingType: ReimbursementBillingTypeEnum;
|
|
12
13
|
billDate: string;
|
|
13
14
|
amount: number;
|
|
14
|
-
billNo?: string
|
|
15
|
+
billNo?: Nullable<string>;
|
|
15
16
|
expenseIncurredBy: ReimbursementIncurredByEnum;
|
|
16
17
|
billPresent: ReimbursementBillingPresentEnum;
|
|
17
18
|
description: string;
|
|
18
|
-
attachmentUrlsCsv?: string
|
|
19
|
+
attachmentUrlsCsv?: Nullable<string>;
|
|
19
20
|
status: ReimbursementStatusEnum;
|
|
20
21
|
paymentStatus: ReimbursementPaymentStatusEnum;
|
|
21
|
-
amountReimbursed?: number
|
|
22
|
-
processedBy?: number
|
|
23
|
-
processedDate?: string
|
|
24
|
-
paymentDetails?: string
|
|
25
|
-
remark?: string
|
|
26
|
-
disbursementDate?: string
|
|
27
|
-
referenceNo?: string
|
|
28
|
-
bankId?: number
|
|
22
|
+
amountReimbursed?: Nullable<number>;
|
|
23
|
+
processedBy?: Nullable<number>;
|
|
24
|
+
processedDate?: Nullable<string>;
|
|
25
|
+
paymentDetails?: Nullable<string>;
|
|
26
|
+
remark?: Nullable<string>;
|
|
27
|
+
disbursementDate?: Nullable<string>;
|
|
28
|
+
referenceNo?: Nullable<string>;
|
|
29
|
+
bankId?: Nullable<number>;
|
|
29
30
|
incurredByUserId: number;
|
|
30
31
|
}
|
|
31
32
|
export interface IReimbursementExpenseAllocation {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReimbursementExpenseState } from "../enums/reimbursement_expense_state_enum";
|
|
2
2
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
3
|
+
import { Nullable } from "./entity.utils.interface";
|
|
3
4
|
export interface IReimbursementExpenseEntity extends IEntityAuditColumn {
|
|
4
5
|
id: number;
|
|
5
6
|
reimbursementId: number;
|
|
@@ -8,7 +9,7 @@ export interface IReimbursementExpenseEntity extends IEntityAuditColumn {
|
|
|
8
9
|
expenseType: string;
|
|
9
10
|
amount: number;
|
|
10
11
|
state: ReimbursementExpenseState;
|
|
11
|
-
remark?: string
|
|
12
|
-
sanctionedBy?: number
|
|
13
|
-
billingId?: number
|
|
12
|
+
remark?: Nullable<string>;
|
|
13
|
+
sanctionedBy?: Nullable<number>;
|
|
14
|
+
billingId?: Nullable<number>;
|
|
14
15
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
2
|
+
import { Nullable } from "./entity.utils.interface";
|
|
2
3
|
export interface IRoleEntity extends IEntityAuditColumn {
|
|
3
4
|
id: number;
|
|
4
5
|
name: string;
|
|
5
|
-
description?: string
|
|
6
|
+
description?: Nullable<string>;
|
|
6
7
|
organizationId: number;
|
|
7
8
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { TdsRateStatusEnum } from "../enums/tds_rate_status_enum";
|
|
2
2
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
3
|
+
import { Nullable } from "./entity.utils.interface";
|
|
3
4
|
export interface ITdsRateEntity extends IEntityAuditColumn {
|
|
4
5
|
id: number;
|
|
5
6
|
section: string;
|
|
6
7
|
code: string;
|
|
7
|
-
description?: string
|
|
8
|
+
description?: Nullable<string>;
|
|
8
9
|
panAvailableRate: number;
|
|
9
10
|
panNotAvailableRate: number;
|
|
10
11
|
effectiveFrom: number;
|
|
@@ -11,10 +11,10 @@ export interface ITimesheetEntity extends IEntityAuditColumn {
|
|
|
11
11
|
dateCode: string;
|
|
12
12
|
totalDuration: number;
|
|
13
13
|
status: TimesheetStatusEnum;
|
|
14
|
-
remark?: string
|
|
15
|
-
billingId?: number
|
|
16
|
-
billedDuration?: number
|
|
17
|
-
notBilledDuration?: number
|
|
14
|
+
remark?: Nullable<string>;
|
|
15
|
+
billingId?: Nullable<number>;
|
|
16
|
+
billedDuration?: Nullable<number>;
|
|
17
|
+
notBilledDuration?: Nullable<number>;
|
|
18
18
|
classificationStatus: TimesheetClassificationStatusEnum;
|
|
19
19
|
classifiedBy?: Nullable<number>;
|
|
20
20
|
}
|
|
@@ -7,37 +7,37 @@ export interface IUserEntity extends IEntityAuditColumn {
|
|
|
7
7
|
name: string;
|
|
8
8
|
email: string;
|
|
9
9
|
contactNo: string;
|
|
10
|
-
secondaryContactNo?: string
|
|
11
|
-
password?: string
|
|
12
|
-
userCode?: string
|
|
13
|
-
joiningDate?: string
|
|
14
|
-
endDate?: string
|
|
15
|
-
address?: string
|
|
16
|
-
zipCode?: number
|
|
17
|
-
country?: string
|
|
10
|
+
secondaryContactNo?: Nullable<string>;
|
|
11
|
+
password?: Nullable<string>;
|
|
12
|
+
userCode?: Nullable<string>;
|
|
13
|
+
joiningDate?: Nullable<string>;
|
|
14
|
+
endDate?: Nullable<string>;
|
|
15
|
+
address?: Nullable<string>;
|
|
16
|
+
zipCode?: Nullable<number>;
|
|
17
|
+
country?: Nullable<string>;
|
|
18
18
|
designation: string;
|
|
19
|
-
panNo?: string
|
|
20
|
-
panDocumentUrl?: string
|
|
21
|
-
aadharNo?: string
|
|
22
|
-
aadharDocumentUrl?: string
|
|
19
|
+
panNo?: Nullable<string>;
|
|
20
|
+
panDocumentUrl?: Nullable<string>;
|
|
21
|
+
aadharNo?: Nullable<string>;
|
|
22
|
+
aadharDocumentUrl?: Nullable<string>;
|
|
23
23
|
role: UserRoleEnum;
|
|
24
|
-
dateOfBirth?: string
|
|
24
|
+
dateOfBirth?: Nullable<string>;
|
|
25
25
|
status?: UserStatusEnum;
|
|
26
26
|
organizationId: number;
|
|
27
27
|
reportingManagerId?: Nullable<number>;
|
|
28
|
-
passportDocumentUrl?: string
|
|
29
|
-
academicQualificationDocumentUrl?: string
|
|
30
|
-
officeAllocation: number
|
|
31
|
-
tempAddress?: string
|
|
32
|
-
tempZipCode?: number
|
|
33
|
-
tempCountry?: string
|
|
28
|
+
passportDocumentUrl?: Nullable<string>;
|
|
29
|
+
academicQualificationDocumentUrl?: Nullable<string>;
|
|
30
|
+
officeAllocation: Nullable<number>;
|
|
31
|
+
tempAddress?: Nullable<string>;
|
|
32
|
+
tempZipCode?: Nullable<number>;
|
|
33
|
+
tempCountry?: Nullable<string>;
|
|
34
34
|
tempAddressSameAsPrimary: boolean;
|
|
35
|
-
emergencyContactName: string
|
|
36
|
-
emergencyContactNo: string
|
|
37
|
-
emergencyContactRelation: string
|
|
38
|
-
secondEmergencyContactName?: string
|
|
39
|
-
secondaryEmergencyContactNo?: string
|
|
40
|
-
secondaryEmergencyContactRelation?: string
|
|
35
|
+
emergencyContactName: Nullable<string>;
|
|
36
|
+
emergencyContactNo: Nullable<string>;
|
|
37
|
+
emergencyContactRelation: Nullable<string>;
|
|
38
|
+
secondEmergencyContactName?: Nullable<string>;
|
|
39
|
+
secondaryEmergencyContactNo?: Nullable<string>;
|
|
40
|
+
secondaryEmergencyContactRelation?: Nullable<string>;
|
|
41
41
|
permissions?: string[];
|
|
42
42
|
}
|
|
43
43
|
export type IUserEntityFilterData = IEntityFilterData<IUserEntity>;
|
|
@@ -20,6 +20,6 @@ export interface IVendorInvoiceEntity extends IEntityAuditColumn {
|
|
|
20
20
|
totalGstAmount: number;
|
|
21
21
|
totalTdsAmount: number;
|
|
22
22
|
totalNetAmount: number;
|
|
23
|
-
paidAmount: number
|
|
24
|
-
adjustedAmount: number
|
|
23
|
+
paidAmount: Nullable<number>;
|
|
24
|
+
adjustedAmount: Nullable<number>;
|
|
25
25
|
}
|
|
@@ -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, {
|
|
@@ -4,17 +4,17 @@ exports.ExpenseTypeEntityModel = void 0;
|
|
|
4
4
|
const error_key_enum_1 = require("../../enums/error.key.enum");
|
|
5
5
|
const exceptions_1 = require("../../exceptions");
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
|
-
const expense_type_flow_config_1 = require("../flow-configs/expense_type_flow.config");
|
|
8
|
-
const expense_type_entity_enum_1 = require("../enums/expense_type_entity_enum");
|
|
9
|
-
const expense_type_status_enum_1 = require("../enums/expense_type_status_enum");
|
|
10
7
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
11
8
|
const base_entity_model_1 = require("./base.entity.model");
|
|
9
|
+
const expense_type_enum_1 = require("../enums/expense_type_enum");
|
|
10
|
+
const expense_type_status_enum_1 = require("../enums/expense_type_status_enum");
|
|
11
|
+
const expense_type_flow_config_1 = require("../flow-configs/expense_type_flow.config");
|
|
12
12
|
class ExpenseTypeEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
15
|
this.id = 0;
|
|
16
16
|
this.name = "";
|
|
17
|
-
this.type =
|
|
17
|
+
this.type = expense_type_enum_1.ExpenseTypeEnum.BILLABLE;
|
|
18
18
|
this.status = expense_type_status_enum_1.ExpenseTypeStatusEnum.APPROVED;
|
|
19
19
|
this.createdOn = 0;
|
|
20
20
|
this.updatedOn = 0;
|
|
@@ -27,7 +27,7 @@ class ExpenseTypeEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
27
27
|
return result;
|
|
28
28
|
}
|
|
29
29
|
getRelationConfigs() {
|
|
30
|
-
return
|
|
30
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
31
31
|
}
|
|
32
32
|
getNextStatus(currentUser, action, expenseTypeFlowConfigContextData) {
|
|
33
33
|
if (!this.status) {
|
|
@@ -27,19 +27,19 @@ export declare class ProjectEntityModel extends BaseEntityModel<EntityEnum.PROJE
|
|
|
27
27
|
billingRate: string;
|
|
28
28
|
status: ProjectStatusEnum;
|
|
29
29
|
organizationId: number;
|
|
30
|
-
description?: string
|
|
31
|
-
expectedEndDate?: string
|
|
32
|
-
actualEndDate?: string
|
|
30
|
+
description?: Nullable<string>;
|
|
31
|
+
expectedEndDate?: Nullable<string>;
|
|
32
|
+
actualEndDate?: Nullable<string>;
|
|
33
33
|
createdBy: number;
|
|
34
34
|
updatedBy: number;
|
|
35
35
|
createdOn: number;
|
|
36
36
|
updatedOn: number;
|
|
37
|
-
billToClientAffiliateId?: number
|
|
37
|
+
billToClientAffiliateId?: Nullable<number>;
|
|
38
38
|
revenueSplit: ProjectRevenueSplitEnum;
|
|
39
39
|
usageNotificationSentPercentage?: Nullable<UsageNotificationThresholdEnum>;
|
|
40
40
|
clientQuoteId?: Nullable<number>;
|
|
41
41
|
users?: IProjectUserDto[];
|
|
42
|
-
billingOverdueDays?: number
|
|
42
|
+
billingOverdueDays?: Nullable<number>;
|
|
43
43
|
userMappings?: (UserEntityModel & ProjectUserMappingEntityModel)[];
|
|
44
44
|
projectUserMappings?: ProjectUserMappingEntityModel[];
|
|
45
45
|
client: ClientEntityModel;
|
|
@@ -57,7 +57,8 @@ class ProjectEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
57
57
|
result.createdOn = entity.createdOn;
|
|
58
58
|
result.updatedOn = entity.updatedOn;
|
|
59
59
|
result.billingOverdueDays = entity.billingOverdueDays;
|
|
60
|
-
|
|
60
|
+
// LW-856: was copying billingOverdueDays (typo from the LW-523 rename)
|
|
61
|
+
result.billToClientAffiliateId = entity.billToClientAffiliateId;
|
|
61
62
|
result.revenueSplit = entity.revenueSplit;
|
|
62
63
|
result.usageNotificationSentPercentage = entity.usageNotificationSentPercentage;
|
|
63
64
|
result.clientQuoteId = result.clientQuoteId;
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|