@zeniai/client-epic-state 4.13.23 → 4.13.24
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.
|
@@ -34,7 +34,9 @@ const fetchScheduleDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0
|
|
|
34
34
|
type: (0, transactionType_1.toTransactionType)(transactionData.transaction_type),
|
|
35
35
|
});
|
|
36
36
|
updateActions.push((0, jeSchedulesReducer_1.updateJESchedules)(response.data.je_schedules), (0, scheduleDetailReducer_1.updateSelectedJEScheduleKey)({ selectedJEScheduleKey }), (0, jeSchedulesReducer_1.updateJESchedulesDetails)(response.data.je_schedules, response.data.scheduled_journal_entries), (0, scheduleDetailReducer_1.saveScheduleDetailsSuccessOrFailure)('Not-Started'), (0, scheduleDetailReducer_1.initializeScheduleDetailLocalData)(scheduleType, selectedJEScheduleKey, selectedJeScheduleDetailId), (0, scheduleDetailReducer_1.updateScheduleDetailsSuccess)());
|
|
37
|
-
if (response.data.je_schedules[0].status.code === 'draft'
|
|
37
|
+
if (response.data.je_schedules[0].status.code === 'draft' &&
|
|
38
|
+
isCompleteJEScheduleFormDataPresent(response.data.je_schedules[0])) {
|
|
39
|
+
// check if all required data is present then only createNewSchedule
|
|
38
40
|
updateActions.push((0, scheduleDetailReducer_1.createNewSchedules)({ scheduleType }));
|
|
39
41
|
}
|
|
40
42
|
return (0, rxjs_1.from)(updateActions);
|
|
@@ -60,3 +62,27 @@ const fetchScheduleDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0
|
|
|
60
62
|
return (0, rxjs_1.from)(updateActions);
|
|
61
63
|
}));
|
|
62
64
|
exports.fetchScheduleDetailsEpic = fetchScheduleDetailsEpic;
|
|
65
|
+
const isCompleteJEScheduleFormDataPresent = (data) => {
|
|
66
|
+
if (data.period == null) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
if (data.je_debit_account_id == null) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
if (data.je_debit_accounting_class_id == null) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
if (data.start_date == null) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
if (data.posting_date == null) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
if (data.period == null) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
if (data.je_credit_account_id == null) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
return true;
|
|
88
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.24",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|