@zeniai/client-epic-state 4.14.31 → 4.14.33

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.
@@ -26,9 +26,10 @@ export declare const fetchEditBillDetailPage: import("@reduxjs/toolkit").ActionC
26
26
  billId?: string | undefined;
27
27
  }, string>, discardBillUpdatesInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
28
28
  billId?: string | undefined;
29
- }, string>, saveBillDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billStageCode: "paid" | "pending_approval" | "scheduled" | "draft", isForMarkAsPaid: boolean, billId?: string | undefined], {
29
+ }, string>, saveBillDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billStageCode: "paid" | "pending_approval" | "scheduled" | "draft", isForMarkAsPaid: boolean, isApproverMarkingAsPaid: boolean, billId?: string | undefined], {
30
30
  billStageCode: "paid" | "pending_approval" | "scheduled" | "draft";
31
31
  isForMarkAsPaid: boolean;
32
+ isApproverMarkingAsPaid: boolean;
32
33
  billId: string | undefined;
33
34
  }, string, never, never>, saveBillSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[fetchState: FetchState, billId?: string | undefined, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
34
35
  fetchState: FetchState;
@@ -171,11 +171,12 @@ const editBillView = (0, toolkit_1.createSlice)({
171
171
  } });
172
172
  }
173
173
  },
174
- prepare(billStageCode, isForMarkAsPaid, billId) {
174
+ prepare(billStageCode, isForMarkAsPaid, isApproverMarkingAsPaid, billId) {
175
175
  return {
176
176
  payload: {
177
177
  billStageCode,
178
178
  isForMarkAsPaid,
179
+ isApproverMarkingAsPaid,
179
180
  billId,
180
181
  },
181
182
  };
@@ -15,7 +15,7 @@ import { saveBillDetail, saveBillSuccessOrFailure } from '../editBillViewReducer
15
15
  import { EditBillDetail } from '../editBillViewState';
16
16
  export declare type ActionType = ReturnType<typeof saveBillDetail> | ReturnType<typeof updateBillTransaction> | ReturnType<typeof openSnackbar> | ReturnType<typeof saveBillSuccessOrFailure> | ReturnType<typeof updateRecurringBillConfigs> | ReturnType<typeof updateRecurringBills>;
17
17
  export declare const saveBillDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
18
- export declare function prepareSaveBillPayload(accountState: AccountState, billTransactionState: BillTransactionState, paymentAccountState: PaymentAccountState, recurringBillState: RecurringBillState, billDetail: EditBillDetail, billStageCode: BillStageCodeType, isForMarkAsPaid: boolean): Partial<SaveBillPayload>;
18
+ export declare function prepareSaveBillPayload(accountState: AccountState, billTransactionState: BillTransactionState, paymentAccountState: PaymentAccountState, recurringBillState: RecurringBillState, billDetail: EditBillDetail, billStageCode: BillStageCodeType, isForMarkAsPaid: boolean, isApproverMarkingAsPaid: boolean): Partial<SaveBillPayload>;
19
19
  interface SaveBillPayload {
20
20
  vendor_id: string;
21
21
  vendor_name?: string | null;
@@ -71,6 +71,7 @@ interface SaveBillPayload {
71
71
  is_update_future_recurring_bills?: boolean | null;
72
72
  is_update_recurring_bill_config?: boolean | null;
73
73
  ocr_parsed_vendor_term: string | null;
74
+ is_outside_zeni_bill_marked_as_paid_by_approver?: boolean | null;
74
75
  }
75
76
  interface RecurringBillInstancePayload {
76
77
  instance: number;
@@ -25,12 +25,12 @@ const editBillViewPayload_1 = require("../editBillViewPayload");
25
25
  const editBillViewReducer_1 = require("../editBillViewReducer");
26
26
  const saveBillDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.saveBillDetail.match), (0, operators_1.mergeMap)((action) => {
27
27
  const state = state$.value;
28
- const { billStageCode, billId, isForMarkAsPaid } = action.payload;
28
+ const { billStageCode, billId, isForMarkAsPaid, isApproverMarkingAsPaid } = action.payload;
29
29
  const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId !== null && billId !== void 0 ? billId : '');
30
30
  const billDetail = billId != null
31
31
  ? state.editBillDetailViewState.editBillStateById[key]
32
32
  : state.editBillDetailViewState.newBillState;
33
- const payload = prepareSaveBillPayload(state.accountState, state.billTransactionState, state.paymentAccountState, state.recurringBillState, billDetail, billStageCode, isForMarkAsPaid);
33
+ const payload = prepareSaveBillPayload(state.accountState, state.billTransactionState, state.paymentAccountState, state.recurringBillState, billDetail, billStageCode, isForMarkAsPaid, isApproverMarkingAsPaid);
34
34
  const isRecurringBill = billDetail.billDetailLocalData.isRecurring;
35
35
  const saveBillBaseURL = `${zeniAPI.apiEndPoints.spendManagementMicroServiceBaseUrl}/1.0/bills/transactions`;
36
36
  const saveBillApi = billId != null
@@ -80,7 +80,7 @@ const getSaveBillApiURL = (saveBillBaseURL, isRecurring, billId, billTransaction
80
80
  return isRecurring ? `${saveBillBaseURL}/recurring` : `${saveBillBaseURL}`;
81
81
  }
82
82
  };
83
- function prepareSaveBillPayload(accountState, billTransactionState, paymentAccountState, recurringBillState, billDetail, billStageCode, isForMarkAsPaid) {
83
+ function prepareSaveBillPayload(accountState, billTransactionState, paymentAccountState, recurringBillState, billDetail, billStageCode, isForMarkAsPaid, isApproverMarkingAsPaid) {
84
84
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27;
85
85
  const billId = billDetail.billId;
86
86
  let detail;
@@ -161,6 +161,9 @@ function prepareSaveBillPayload(accountState, billTransactionState, paymentAccou
161
161
  detail = (0, get_1.default)(billTransactionState.transactionById, billId, undefined);
162
162
  payload.sync_token = (_25 = detail === null || detail === void 0 ? void 0 : detail.syncToken) !== null && _25 !== void 0 ? _25 : null;
163
163
  payload.update_time = (_26 = detail === null || detail === void 0 ? void 0 : detail.updateTime.format('YYYY-MM-DD')) !== null && _26 !== void 0 ? _26 : null;
164
+ if (isApproverMarkingAsPaid) {
165
+ payload.is_outside_zeni_bill_marked_as_paid_by_approver = true;
166
+ }
164
167
  //required by platform to clear old recurring details
165
168
  if ((detail === null || detail === void 0 ? void 0 : detail.isRecurring) === true &&
166
169
  Boolean(billDetail.billDetailLocalData.isRecurring) === false) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.14.31",
3
+ "version": "4.14.33",
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",