@zeniai/client-epic-state 4.8.41 → 4.8.42

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.
Files changed (35) hide show
  1. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  2. package/lib/entity/snackbar/snackbarTypes.js +1 -0
  3. package/lib/epic.d.ts +3 -1
  4. package/lib/epic.js +3 -1
  5. package/lib/index.d.ts +5 -4
  6. package/lib/index.js +22 -15
  7. package/lib/view/commonVendorView/vendorView/epics/saveVendorEpic.js +31 -4
  8. package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
  9. package/lib/view/people/deletePersonEpic.d.ts +1 -1
  10. package/lib/view/people/invitePeopleEpic.d.ts +1 -1
  11. package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
  12. package/lib/view/people/resendInviteEpic.d.ts +1 -1
  13. package/lib/view/settingsView/epic/fetchNotificationSettingsEpic.d.ts +17 -0
  14. package/lib/view/settingsView/epic/fetchNotificationSettingsEpic.js +23 -0
  15. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +31 -0
  16. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.js +70 -0
  17. package/lib/view/settingsView/settingsViewHelpers.d.ts +2 -0
  18. package/lib/view/settingsView/settingsViewHelpers.js +11 -0
  19. package/lib/view/settingsView/settingsViewPayload.d.ts +7 -0
  20. package/lib/view/settingsView/settingsViewReducer.d.ts +7 -2
  21. package/lib/view/settingsView/settingsViewReducer.js +115 -2
  22. package/lib/view/settingsView/settingsViewSelector.d.ts +2 -0
  23. package/lib/view/settingsView/settingsViewSelector.js +4 -1
  24. package/lib/view/settingsView/settingsViewState.d.ts +18 -0
  25. package/lib/view/settingsView/settingsViewState.js +15 -0
  26. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +1 -0
  27. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +24 -22
  28. package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +1 -0
  29. package/lib/view/spendManagement/billPay/editBillView/editBillViewState.js +1 -0
  30. package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.js +1 -0
  31. package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.d.ts +1 -1
  32. package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.js +7 -2
  33. package/lib/view/spendManagement/helpers.js +11 -4
  34. package/lib/zeniAPI.d.ts +1 -0
  35. package/package.json +1 -1
@@ -174,6 +174,7 @@ const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
174
174
  recurringBillInstances = recurringBillInstancesLocalData;
175
175
  }
176
176
  const billDetailLocalData = {
177
+ showVendorGptRecommendationText: false,
177
178
  vendor,
178
179
  whatForSection,
179
180
  updatesByLineId,
@@ -10,5 +10,5 @@ import { fetchPreviousBills } from '../../previousBills/previousBillsReducer';
10
10
  import { fetchDuplicateBill } from '../../billPayReview/billPayReviewReducer';
11
11
  export declare type ActionType = ReturnType<typeof parseInvoiceToBill> | ReturnType<typeof saveBillUpdatesToLocalStore> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchPreviousBills> | ReturnType<typeof fetchDuplicateBill> | ReturnType<typeof updateShowAutofill> | ReturnType<typeof updateAddBillAutoFields> | ReturnType<typeof updateBillUploadFetchState>;
12
12
  export declare const parseInvoiceToBillEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
13
- export declare const toBillDetailLocalData: (state: RootState, billPayload: Partial<BillTransactionPayload>, vendor: Vendor | undefined, recommendedVendorId?: string | undefined) => BillDetailLocalData;
13
+ export declare const toBillDetailLocalData: (state: RootState, showVendorGptRecommendationText: boolean, billPayload: Partial<BillTransactionPayload>, vendor: Vendor | undefined, recommendedVendorId?: string | undefined) => BillDetailLocalData;
14
14
  export declare const getAutoFieldsData: (finalBill: BillDetailLocalData, isVendorWithNewCurrency: boolean, tentativeVendorName?: string | undefined, currencyInInvoice?: string | undefined, vendorCurrency?: string | undefined) => AddBillAutoFields;
@@ -54,6 +54,7 @@ const parseInvoiceToBillEpic = (actions$, state$) => actions$.pipe((0, operators
54
54
  let vendorCurrency = '';
55
55
  const vendors = (0, vendorListSelector_1.getVendorList)(state).vendors;
56
56
  let recommendedVendorId;
57
+ let showVendorGptRecommendationText = false;
57
58
  let suggestedVendor;
58
59
  if (vendorNameFromInvoice != null && vendorNameFromInvoice.length > 0) {
59
60
  finalVendor = vendors.filter((vendor) => vendor.name.toLowerCase() === vendorNameFromInvoice.toLowerCase())[0];
@@ -71,6 +72,7 @@ const parseInvoiceToBillEpic = (actions$, state$) => actions$.pipe((0, operators
71
72
  if (matchScore > 85) {
72
73
  if (vendorCurrency === currencyInInvoice) {
73
74
  finalVendor = suggestedVendor;
75
+ showVendorGptRecommendationText = true;
74
76
  }
75
77
  else {
76
78
  isVendorWithNewCurrency = true;
@@ -81,6 +83,7 @@ const parseInvoiceToBillEpic = (actions$, state$) => actions$.pipe((0, operators
81
83
  vendorNameFromInvoice.toLowerCase()) {
82
84
  if (vendorCurrency === currencyInInvoice) {
83
85
  finalVendor = suggestedVendor;
86
+ showVendorGptRecommendationText = true;
84
87
  }
85
88
  else {
86
89
  isVendorWithNewCurrency = true;
@@ -89,12 +92,13 @@ const parseInvoiceToBillEpic = (actions$, state$) => actions$.pipe((0, operators
89
92
  else {
90
93
  recommendedVendorId = suggestedVendor === null || suggestedVendor === void 0 ? void 0 : suggestedVendor.id;
91
94
  finalVendor = suggestedVendor;
95
+ showVendorGptRecommendationText = true;
92
96
  }
93
97
  }
94
98
  }
95
99
  }
96
100
  const file = (0, attachmentPayload_1.mapFiletoAttachment)(invoiceProcessingPayload.files[0]);
97
- const finalBill = Object.assign(Object.assign({}, (0, exports.toBillDetailLocalData)(state, invoiceProcessingPayload.bills[0], finalVendor, recommendedVendorId)), { file: file });
101
+ const finalBill = Object.assign(Object.assign({}, (0, exports.toBillDetailLocalData)(state, showVendorGptRecommendationText, invoiceProcessingPayload.bills[0], finalVendor, recommendedVendorId)), { file: file });
98
102
  const addBillAutoFields = (0, exports.getAutoFieldsData)(finalBill, isVendorWithNewCurrency, vendorNameFromInvoice, currencyInInvoice, vendorCurrency);
99
103
  if (finalVendor != null) {
100
104
  return (0, rxjs_1.of)((0, editBillViewReducer_1.saveBillUpdatesToLocalStore)({ billDetailLocalData: finalBill }), (0, previousBillsReducer_1.fetchPreviousBills)(finalVendor.qboId, false), (0, billPayReviewReducer_1.fetchDuplicateBill)(finalVendor.name, finalVendor.id, (_e = (_d = finalBill.totalAmount) === null || _d === void 0 ? void 0 : _d.amount) !== null && _e !== void 0 ? _e : 0, (_f = finalBill.whatForSection) === null || _f === void 0 ? void 0 : _f.invoiceNumber), (0, editBillViewReducer_1.updateShowAutofill)(false), (0, editBillViewReducer_1.updateAddBillAutoFields)(addBillAutoFields), (0, editBillViewReducer_1.updateBillUploadFetchState)({
@@ -120,7 +124,7 @@ const parseInvoiceToBillEpic = (actions$, state$) => actions$.pipe((0, operators
120
124
  }
121
125
  }));
122
126
  exports.parseInvoiceToBillEpic = parseInvoiceToBillEpic;
123
- const toBillDetailLocalData = (state, billPayload, vendor, recommendedVendorId) => {
127
+ const toBillDetailLocalData = (state, showVendorGptRecommendationText, billPayload, vendor, recommendedVendorId) => {
124
128
  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;
125
129
  const currency = {
126
130
  currencyCode: (_a = billPayload.currency_code) !== null && _a !== void 0 ? _a : '',
@@ -186,6 +190,7 @@ const toBillDetailLocalData = (state, billPayload, vendor, recommendedVendorId)
186
190
  const fromAccountType = (0, billPayConfigPayload_1.getAccountTypeSubConfigCodeKey)((0, billPayConfigState_1.toAccType)((_m = (_l = billPayload.bill_pay_info) === null || _l === void 0 ? void 0 : _l.from_account.account_type) !== null && _m !== void 0 ? _m : ''));
187
191
  return {
188
192
  recommendedVendorId,
193
+ showVendorGptRecommendationText,
189
194
  lastRecommendedVendorName: recommendedVendorId != null ? vendor === null || vendor === void 0 ? void 0 : vendor.name : undefined,
190
195
  vendor: vendor,
191
196
  whatForSection: {
@@ -128,7 +128,9 @@ const getTotalPayments = (startDate, endDate, frequency, currentInstance) => {
128
128
  switch (frequency) {
129
129
  case 'weekly':
130
130
  case 'biweekly':
131
- totalPayments = endDate.diff(currentStartDate, 'day') / getRecurringFrequencyInDays(frequency);
131
+ totalPayments =
132
+ endDate.diff(currentStartDate, 'day') /
133
+ getRecurringFrequencyInDays(frequency);
132
134
  break;
133
135
  case 'monthly':
134
136
  totalPayments = endDate.diff(currentStartDate, 'month');
@@ -168,9 +170,15 @@ function getRecurringBillInstances(startDate, frequency, totalPayments, currentI
168
170
  const getRecurringFrequencyWithOffset = (frequency) => {
169
171
  switch (frequency) {
170
172
  case 'weekly':
171
- return { offSetValue: getRecurringFrequencyInDays(frequency), offSetUnit: 'day' };
173
+ return {
174
+ offSetValue: getRecurringFrequencyInDays(frequency),
175
+ offSetUnit: 'day',
176
+ };
172
177
  case 'biweekly':
173
- return { offSetValue: getRecurringFrequencyInDays(frequency), offSetUnit: 'day' };
178
+ return {
179
+ offSetValue: getRecurringFrequencyInDays(frequency),
180
+ offSetUnit: 'day',
181
+ };
174
182
  case 'monthly':
175
183
  return { offSetValue: 1, offSetUnit: 'month' };
176
184
  case 'quarterly':
@@ -181,7 +189,6 @@ function getRecurringBillInstances(startDate, frequency, totalPayments, currentI
181
189
  for (let i = 0; i < totalPayments; i++) {
182
190
  updatedInstances.push(Object.assign({ instance: currentInstance + i, isDeleted: false, amount: billAmount }, checkIfHolidayAndGetNextDate(startDate.add(i * offSetValue, offSetUnit))));
183
191
  }
184
- ;
185
192
  return updatedInstances;
186
193
  }
187
194
  function getRecurringFrequencyInDays(frequency) {
package/lib/zeniAPI.d.ts CHANGED
@@ -15,6 +15,7 @@ export interface RESTAPIEndpoints {
15
15
  readonly approvalMicroServiceBaseUrl: string;
16
16
  readonly cardMicroServiceBaseUrl: string;
17
17
  readonly taskMicroServiceBaseUrl: string;
18
+ readonly notificationMicroServiceBaseUrl: string;
18
19
  }
19
20
  export interface ZeniAPI<ResponseType = FetchResponse> {
20
21
  readonly apiEndPoints: RESTAPIEndpoints;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.8.41",
3
+ "version": "4.8.42",
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",