law-common 14.0.1-beta.7 → 14.0.1-beta.9
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/interface/timesheet.entity.response.interface.d.ts +1 -3
- package/dist/src/entities/flow-configs/base-flow-config.factory.d.ts +0 -5
- package/dist/src/entities/flow-configs/billing_transaction_flow.config.d.ts +1 -2
- package/dist/src/entities/model/timesheet.entity.model.d.ts +1 -20
- package/dist/src/entities/model/timesheet.entity.model.js +0 -11
- package/dist/src/model/entities/interface/timesheet.model.interface.d.ts +20 -1
- package/package.json +1 -1
|
@@ -17,9 +17,7 @@ export type ITimesheetEntityGet = {
|
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
* LW-828: this used to re-declare the flow-config shape by hand. It is now an alias of the shared
|
|
20
|
-
* `FlowConfig
|
|
21
|
-
* (LW-830 collapse — the previous `validActionPastThreshold` boolean is commented out in
|
|
22
|
-
* `IFlowConfigActionConfig`). Kept as a named type so every existing consumer keeps compiling unchanged.
|
|
20
|
+
* `FlowConfig`. Kept as a named type so every existing consumer keeps compiling unchanged.
|
|
23
21
|
*/
|
|
24
22
|
export type ITimesheetFlowConfig = FlowConfig<TimesheetStatusEnum, TimesheetActionEnum, ITimesheetFlowContextData>;
|
|
25
23
|
export type ITimesheetFlowContextData = {
|
|
@@ -113,11 +113,6 @@ export type ActionMap<A extends string, S extends string> = {
|
|
|
113
113
|
* existed — the sixteen already-converted flow configs are byte-identical.
|
|
114
114
|
*
|
|
115
115
|
* @property isApplicable runtime guard evaluated against the same context as `next()`
|
|
116
|
-
* @property validActionPastThreshold whether the action survives a consumer's data-entry threshold
|
|
117
|
-
* (commented out below since the LW-830 collapse — see note)
|
|
118
|
-
* @property isAvailable unified runtime guard introduced by LW-830; preferred over
|
|
119
|
-
* `isApplicable` when both are present (commented out below
|
|
120
|
-
* since the LW-830 collapse — see note)
|
|
121
116
|
* @property description human-readable copy for this transition. Already part of
|
|
122
117
|
* `IFlowConfigActionConfig` and rendered by the entity-flow
|
|
123
118
|
* component, so a converted config must be able to emit it.
|
|
@@ -10,8 +10,7 @@ export interface IBillingTransactionContextFlowData {
|
|
|
10
10
|
/**
|
|
11
11
|
* LW-828: this used to re-declare the flow-config shape by hand. It is now an alias of the shared
|
|
12
12
|
* `FlowConfig`, which is a strict superset of the old declaration — same `permissions` and `next`, plus
|
|
13
|
-
* the optional `description` / `isApplicable` this entity does not use
|
|
14
|
-
* commented out of the shared type during the LW-830 collapse).
|
|
13
|
+
* the optional `description` / `isApplicable` this entity does not use.
|
|
15
14
|
* Kept as a named type so every existing consumer keeps compiling unchanged.
|
|
16
15
|
*/
|
|
17
16
|
export type IBillingTransactionFlowConfig = FlowConfig<BillingTransactionStatusEnum, BillingTransactionActionEnum, IBillingTransactionContextFlowData>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITimesheetEntityUpdateDto, ITimesheetFlowContextData } from "../../api";
|
|
2
2
|
import { CurrencyEnum } from "../../enums";
|
|
3
|
-
import {
|
|
3
|
+
import { IClassificationWindowConfig, ITimesheetActionItem, SortableTimesheet } from "../../model/entities/interface/timesheet.model.interface";
|
|
4
4
|
import { TimesheetClassificationStatusEnum } from "../enums/timesheet_classification_status_enum";
|
|
5
5
|
import { TimesheetStatusEnum } from "../enums/timesheet_status_enum";
|
|
6
6
|
import { IDesignationEntity } from "../interface/designation.entity.interface";
|
|
@@ -11,25 +11,6 @@ import { BaseEntityModel } from "./base.entity.model";
|
|
|
11
11
|
import { EntityHistoryEntityModel } from "./entity_history.entity.model";
|
|
12
12
|
import { ProjectEntityModel } from "./project.entity.model";
|
|
13
13
|
import { UserEntityModel } from "./user.entity.model";
|
|
14
|
-
export interface IClassificationWindowConfig {
|
|
15
|
-
bufferDays: number;
|
|
16
|
-
windows: Array<{
|
|
17
|
-
startDay: number;
|
|
18
|
-
endDay: Nullable<number>;
|
|
19
|
-
}>;
|
|
20
|
-
}
|
|
21
|
-
export interface SortableTimesheet {
|
|
22
|
-
projectId?: number;
|
|
23
|
-
projectClientName?: string;
|
|
24
|
-
designation?: string;
|
|
25
|
-
resourceName?: string;
|
|
26
|
-
dateCodeForsorting?: Date;
|
|
27
|
-
}
|
|
28
|
-
export interface ITimesheetActionItem {
|
|
29
|
-
label: string;
|
|
30
|
-
value: TimesheetActionEnum | string;
|
|
31
|
-
disabled?: boolean;
|
|
32
|
-
}
|
|
33
14
|
export declare class TimesheetEntityModel extends BaseEntityModel<EntityEnum.TIMESHEET> implements ITimesheetEntity {
|
|
34
15
|
id: number;
|
|
35
16
|
userId: number;
|
|
@@ -91,15 +91,6 @@ class TimesheetEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
91
91
|
const isVisible = actionPermissions.some((permission) => actionVisibilityConfig[permission] && actionVisibilityConfig[permission]());
|
|
92
92
|
if (!isVisible)
|
|
93
93
|
return null;
|
|
94
|
-
// LW-830 collapse: `isApplicable` is the single runtime guard. Previous 3-way logic
|
|
95
|
-
// (isAvailable ?? isApplicable, else validActionPastThreshold ?? true) is commented out:
|
|
96
|
-
// const predicate = actionConfig.isAvailable ?? actionConfig.isApplicable;
|
|
97
|
-
// let available = true;
|
|
98
|
-
// if (predicate) {
|
|
99
|
-
// available = predicate(context);
|
|
100
|
-
// } else {
|
|
101
|
-
// available = actionConfig.validActionPastThreshold ?? true;
|
|
102
|
-
// }
|
|
103
94
|
const predicate = actionConfig.isApplicable;
|
|
104
95
|
let available = true;
|
|
105
96
|
if (predicate) {
|
|
@@ -112,8 +103,6 @@ class TimesheetEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
112
103
|
};
|
|
113
104
|
})
|
|
114
105
|
.filter(Boolean);
|
|
115
|
-
console.log("actions before mergeApproveReject", actions, "hasApprove", actions.some((a) => a.value === timesheet_action_enum_1.TimesheetActionEnum.APPROVE), "hasReject", actions.some((a) => a.value === timesheet_action_enum_1.TimesheetActionEnum.REJECT));
|
|
116
|
-
console.log("actions", actions);
|
|
117
106
|
const hasApprove = actions.some((a) => a.value === timesheet_action_enum_1.TimesheetActionEnum.APPROVE);
|
|
118
107
|
const hasReject = actions.some((a) => a.value === timesheet_action_enum_1.TimesheetActionEnum.REJECT);
|
|
119
108
|
if ((options === null || options === void 0 ? void 0 : options.mergeApproveReject) !== false && hasApprove && hasReject) {
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
import { ITimesheetEntity } from "../../../entities";
|
|
1
|
+
import { ITimesheetEntity, Nullable, TimesheetActionEnum } from "../../../entities";
|
|
2
2
|
export interface ITimesheetEntityModel extends ITimesheetEntity {
|
|
3
3
|
}
|
|
4
|
+
export interface IClassificationWindowConfig {
|
|
5
|
+
bufferDays: number;
|
|
6
|
+
windows: Array<{
|
|
7
|
+
startDay: number;
|
|
8
|
+
endDay: Nullable<number>;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
export interface SortableTimesheet {
|
|
12
|
+
projectId?: number;
|
|
13
|
+
projectClientName?: string;
|
|
14
|
+
designation?: string;
|
|
15
|
+
resourceName?: string;
|
|
16
|
+
dateCodeForsorting?: Date;
|
|
17
|
+
}
|
|
18
|
+
export interface ITimesheetActionItem {
|
|
19
|
+
label: string;
|
|
20
|
+
value: TimesheetActionEnum | "APPROVE_REJECT";
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
}
|