@zeniai/client-epic-state 4.8.66 → 4.8.68

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.
@@ -110,6 +110,9 @@ const updateAmountsInScheduleDetails = (jeSchedulesLocalData, actualPeriod, rowI
110
110
  let currentRunningBalance = calculatedRunningBalance;
111
111
  const isNegative = totalAmount < 0 || currentRunningBalance < 0;
112
112
  return jeSchedulesLocalData.map((jeScheduleDetail, index) => {
113
+ const postingStatus = jeScheduleDetail.postingDate.isBefore((0, zeniDayJS_1.dateNow)().startOf('month'))
114
+ ? 'unknown'
115
+ : 'pending';
113
116
  if (index > rowId) {
114
117
  if (currentRunningBalance - averageAmount > 0) {
115
118
  currentRunningBalance =
@@ -123,12 +126,12 @@ const updateAmountsInScheduleDetails = (jeSchedulesLocalData, actualPeriod, rowI
123
126
  index === actualPeriod - 1 ? 0 : currentRunningBalance;
124
127
  return Object.assign(Object.assign({}, jeScheduleDetail), { amount: Object.assign(Object.assign({}, jeScheduleDetail.amount), { amount: isNegative && amount !== 0 ? -amount : amount }), runningBalance: Object.assign(Object.assign({}, jeScheduleDetail.runningBalance), { amount: isNegative && currentRunningBalance !== 0
125
128
  ? -currentRunningBalance
126
- : currentRunningBalance }), postingStatus: amount === 0 ? 'canceled' : 'pending' });
129
+ : currentRunningBalance }), postingStatus: amount === 0 ? 'canceled' : postingStatus });
127
130
  }
128
131
  else if (index === rowId) {
129
132
  return Object.assign(Object.assign({}, jeScheduleDetail), { amount: Object.assign(Object.assign({}, jeScheduleDetail.amount), { amount: isNegative && updatedAmount !== 0 ? -updatedAmount : updatedAmount }), runningBalance: Object.assign(Object.assign({}, jeScheduleDetail.runningBalance), { amount: isNegative && calculatedRunningBalance !== 0
130
133
  ? -calculatedRunningBalance
131
- : calculatedRunningBalance }), postingStatus: updatedAmount === 0 ? 'canceled' : 'pending' });
134
+ : calculatedRunningBalance }), postingStatus: updatedAmount === 0 ? 'canceled' : postingStatus });
132
135
  }
133
136
  else {
134
137
  return jeScheduleDetail;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.8.66",
3
+ "version": "4.8.68",
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",