law-common 14.0.1-beta.6 → 14.0.1-beta.7
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.
|
@@ -112,6 +112,8 @@ class TimesheetEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
112
112
|
};
|
|
113
113
|
})
|
|
114
114
|
.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);
|
|
115
117
|
const hasApprove = actions.some((a) => a.value === timesheet_action_enum_1.TimesheetActionEnum.APPROVE);
|
|
116
118
|
const hasReject = actions.some((a) => a.value === timesheet_action_enum_1.TimesheetActionEnum.REJECT);
|
|
117
119
|
if ((options === null || options === void 0 ? void 0 : options.mergeApproveReject) !== false && hasApprove && hasReject) {
|
|
@@ -169,17 +171,6 @@ class TimesheetEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
169
171
|
});
|
|
170
172
|
}
|
|
171
173
|
const context = Object.assign(Object.assign({}, contextData), { currentTimesheet: this });
|
|
172
|
-
// LW-830 collapse: `isApplicable` is the single runtime guard.
|
|
173
|
-
// const predicate = matchingPermissionConfig.isAvailable ?? matchingPermissionConfig.isApplicable;
|
|
174
|
-
// if (predicate) {
|
|
175
|
-
// const isActionAvailable = predicate(context);
|
|
176
|
-
// if (!isActionAvailable) {
|
|
177
|
-
// throw new AppBadRequestException({
|
|
178
|
-
// key: ErrorKeyEnum.ACTION,
|
|
179
|
-
// message: [`Action ${dto.actionData.action} is not applicable for current timesheet status: ${this.status}.`],
|
|
180
|
-
// });
|
|
181
|
-
// }
|
|
182
|
-
// }
|
|
183
174
|
if (matchingPermissionConfig.isApplicable) {
|
|
184
175
|
const isApplicable = matchingPermissionConfig.isApplicable(context);
|
|
185
176
|
if (!isApplicable) {
|