@zeniai/client-epic-state 4.10.92 → 4.10.93

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.
@@ -10,6 +10,7 @@ import { UserPayload } from '../user/userPayload';
10
10
  import { FilePayload } from '../file/filePayload';
11
11
  import { RecommendationPayload } from '../../commonPayloadTypes/recommendationPayload';
12
12
  import { PaymentInstrumentPayload } from '../paymentInstrument/paymentInstrumentPayload';
13
+ import { AttachmentPayload } from '../transaction/payloadTypes/attachmentPayload';
13
14
  export interface VendorBasePayload {
14
15
  vendor_id: string;
15
16
  vendor_name: string;
@@ -34,6 +35,7 @@ export interface VendorPayload extends VendorBasePayload, SpendPayload {
34
35
  qbo_id: string;
35
36
  currency_code: string;
36
37
  currency_symbol: string;
38
+ transaction_attachments?: AttachmentPayload[] | null;
37
39
  title?: string;
38
40
  suffix?: string;
39
41
  first_name?: string;
@@ -5,6 +5,7 @@ const urlPayload_1 = require("../../commonPayloadTypes/urlPayload");
5
5
  const zeniDayJS_1 = require("../../zeniDayJS");
6
6
  const transactionPayload_1 = require("../transaction/payloadTypes/transactionPayload");
7
7
  const billTransactionState_1 = require("../billPay/billTransaction/billTransactionState");
8
+ const attachmentPayload_1 = require("../transaction/payloadTypes/attachmentPayload");
8
9
  const mapVendorBasePayloadToVendorBase = (payload) => ({
9
10
  id: payload.vendor_id,
10
11
  name: payload.vendor_name,
@@ -36,6 +37,8 @@ const mapVendorPayloadToVendor = (payload) => {
36
37
  ? (0, transactionPayload_1.transformRecommendation)(payload.recommendation[0]) // In this case, there will be only one recommendation item since this is entity recommendation payload.
37
38
  : [], preferredInternationalTransferFeeBearerPaymentMethod: payload.preferred_international_transfer_fee_bearer_payment_method != null
38
39
  ? (0, billTransactionState_1.toInternationalTransferFeeBearerPaymentMethod)(payload.preferred_international_transfer_fee_bearer_payment_method)
39
- : undefined });
40
+ : undefined, transactionAttachments: payload.transaction_attachments != null
41
+ ? payload.transaction_attachments.map((attachmentPayload) => (0, attachmentPayload_1.toAttachment)(attachmentPayload))
42
+ : [] });
40
43
  };
41
44
  exports.mapVendorPayloadToVendor = mapVendorPayloadToVendor;
@@ -4,6 +4,7 @@ import { Recommendation } from '../../commonStateTypes/recommendationBase';
4
4
  import { ZeniDate } from '../../zeniDayJS';
5
5
  import { ZeniUrl as Url } from '../../zeniUrl';
6
6
  import { InternationalTransferFeeBearerPaymentMethod } from '../billPay/billTransaction/billTransactionState';
7
+ import { Attachment } from '../transaction/stateTypes/attachment';
7
8
  export interface VendorBase {
8
9
  id: ID;
9
10
  name: string;
@@ -57,6 +58,7 @@ export interface Vendor extends VendorBase {
57
58
  last6MonthsSpend?: number;
58
59
  last12MonthsSpend?: number;
59
60
  previousYearSpend?: number;
61
+ transactionAttachments?: Attachment[];
60
62
  }
61
63
  export interface VendorState {
62
64
  vendorByID: Record<ID, Vendor>;
@@ -696,6 +696,7 @@ const toUpdateLineItemsToOriginalVendor = (transaction, transactionDetailLocalDa
696
696
  if (line.id !== lineIdToRetainVendorSelection) {
697
697
  // We want to retain vendor and other selections for the line after whose vendor `update all` was selected.
698
698
  const isVendorOrCustomerPresent = record.vendor != null || record.customer != null;
699
+ record.isUpdateAllChecked = false;
699
700
  record.recommendations = (_a = transaction.recommendations) === null || _a === void 0 ? void 0 : _a[lineId];
700
701
  record.vendor = accountLine.vendor;
701
702
  record.customer = accountLine.customer;
@@ -769,7 +770,7 @@ const toUpdateLineItemsToOriginalVendor = (transaction, transactionDetailLocalDa
769
770
  record.lineDetailType = lineRecord.lineDetailType;
770
771
  }
771
772
  if (line.type === 'journal_entry_transaction_line') {
772
- const lineRecord = Object.assign(Object.assign({}, transactionDetailLocalData.lineItemById[lineId]), { vendor: record.vendor });
773
+ const lineRecord = line;
773
774
  record.lineTransactionType = lineRecord.lineTransactionType;
774
775
  record.postingType = lineRecord.postingType;
775
776
  record.postingTypeName = lineRecord.postingTypeName;
@@ -67,6 +67,7 @@ const mapVendorPayloadFromVendorFirstReviewViewResponse = (vendor) => {
67
67
  qbo_id: vendor.qbo_id,
68
68
  currency_code: vendor.currency_code,
69
69
  currency_symbol: vendor.currency_symbol,
70
+ transaction_attachments: vendor.transaction_attachments,
70
71
  };
71
72
  };
72
73
  const mapUsersPayloadFromVendorFirstReviewViewResponse = (vendorsResponse) => {
@@ -1,3 +1,4 @@
1
+ import { AttachmentPayload } from '../../../entity/transaction/payloadTypes/attachmentPayload';
1
2
  import { UserBasePayload } from '../../../entity/user/userPayload';
2
3
  import { VendorPayload } from '../../../entity/vendor/vendorPayload';
3
4
  import { ZeniAPIResponse } from '../../../responsePayload';
@@ -8,6 +9,7 @@ export interface VendorFirstReviewViewPayload extends VendorPayload {
8
9
  status: ReviewStatusPayload;
9
10
  last_updated_vendor_name_by_user: UserBasePayload | null;
10
11
  merge_vendor_name: string | null;
12
+ transaction_attachments?: AttachmentPayload[] | null;
11
13
  }
12
14
  export interface FetchVendorFirstReviewViewQuery {
13
15
  search_text: string;
@@ -38,6 +40,7 @@ export interface SaveVendorFirstReviewViewPayload extends VendorPayload {
38
40
  last_updated_vendor_name_by_user: UserBasePayload | null;
39
41
  status: ReviewStatusPayload;
40
42
  merge_vendor_name: string | null;
43
+ transaction_attachments: AttachmentPayload[];
41
44
  }
42
45
  export interface SaveVendorFirstReviewView {
43
46
  vendors?: SaveVendorFirstReviewViewPayload[];
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.saveVendorFirstReviewViewSuccessOrFailure = exports.clearRecentlySavedErroredVendorData = exports.updateRecentlySavedErroredVendorData = exports.resetVendorFirstReviewLocalData = exports.updateVendorFirstReviewViewLocalData = exports.initializeVendorFirstReviewViewLocalData = exports.updateVendorFirstReviewSortUiState = exports.saveVendorFirstReviewView = exports.updateVendorFirstReviewViewPageToken = exports.updateVendorFirstReviewViewScrollYOffset = exports.clearVendorReviewView = exports.updateVendorFirstReviewViewFailure = exports.updateSavedVendorFirstReviewViewLocalData = exports.fetchVendorFirstReviewView = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const commonTypes_1 = require("../common/state/commonTypes");
7
+ const attachmentPayload_1 = require("../../../entity/transaction/payloadTypes/attachmentPayload");
7
8
  exports.initialState = {
8
9
  vendorFirstReviewViewLocalDataById: {},
9
10
  fetchState: 'Not-Started',
@@ -252,6 +253,9 @@ const mapPayloadToVendorFirstReviewView = (payload) => {
252
253
  mergeVendorName: payload.merge_vendor_name != null && payload.merge_vendor_name.length > 0
253
254
  ? payload.merge_vendor_name
254
255
  : undefined,
256
+ transactionAttachments: payload.transaction_attachments != null
257
+ ? payload.transaction_attachments.map((attachmentPayload) => (0, attachmentPayload_1.toAttachment)(attachmentPayload))
258
+ : [],
255
259
  /* merge_vendor_name can be an empty string from platform in cases other than `merge_in_qbo` status.
256
260
  So, to avoid further string length checks, making this undefined.*/
257
261
  };
@@ -1,5 +1,6 @@
1
1
  import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
2
2
  import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
3
+ import { Attachment } from '../../../entity/transaction/stateTypes/attachment';
3
4
  import { User } from '../../../entity/user/userState';
4
5
  import { Vendor } from '../../../entity/vendor/vendorState';
5
6
  import { RootState } from '../../../reducer';
@@ -29,6 +30,7 @@ export interface VendorFirstReviewSelectorView {
29
30
  saveStatus: FetchStateAndError;
30
31
  recommendations: RecommendedNonExistingGlobalMerchant[];
31
32
  currentSelection: VendorReviewRowCurrentSelection;
33
+ transactionAttachments: Attachment[];
32
34
  }
33
35
  export interface RecentlySavedErroredVendorView {
34
36
  vendorId: ID;
@@ -23,6 +23,7 @@ const getVendorFirstReviewView = (state) => {
23
23
  ...recommendations,
24
24
  ...vendorLocalData.recommendedNonExistingGlobalMerchants,
25
25
  ];
26
+ const transactionAttachments = vendorLocalData.transactionAttachments;
26
27
  let selectedVendor;
27
28
  const vendor = (0, vendorSelector_1.getVendorByVendorId)(vendorState, vendorLocalData.selectedVendorId);
28
29
  if (vendor != null) {
@@ -61,6 +62,7 @@ const getVendorFirstReviewView = (state) => {
61
62
  recommendations,
62
63
  currentSelection: vendorLocalData.currentSelection,
63
64
  mergeVendorName: vendorLocalData.mergeVendorName,
65
+ transactionAttachments,
64
66
  };
65
67
  });
66
68
  let recentlyUpdatedErroredVendorData = undefined;
@@ -2,13 +2,14 @@ import { FetchedState, FetchStateAndError, ID } from '../../../commonStateTypes/
2
2
  import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
3
3
  import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
4
4
  import { GlobalMerchant } from '../../../entity/globalMerchant/globalMerchantState';
5
+ import { Attachment } from '../../../entity/transaction/stateTypes/attachment';
5
6
  import { VendorReviewRowCurrentSelection, ReviewStatus } from '../common/state/commonTypes';
6
- export declare const VENDOR_FIRST_REVIEW_VIEW_COLUMN_KEYS: readonly ["vendor", "updateTo", "retain", "status", "action", "ytd"];
7
+ export declare const VENDOR_FIRST_REVIEW_VIEW_COLUMN_KEYS: readonly ["vendor", "updateTo", "retain", "status", "action", "ytd", "viewTenantInvoice"];
7
8
  export interface CurrentSelectionByColumn {
8
9
  retain: boolean;
9
10
  update: boolean;
10
11
  }
11
- export declare const toVendorFirstReviewViewColumnKeyType: (v: string) => "action" | "status" | "vendor" | "retain" | "updateTo" | "ytd";
12
+ export declare const toVendorFirstReviewViewColumnKeyType: (v: string) => "action" | "status" | "vendor" | "retain" | "updateTo" | "ytd" | "viewTenantInvoice";
12
13
  export declare type VendorFirstReviewViewColumnKey = ReturnType<typeof toVendorFirstReviewViewColumnKeyType>;
13
14
  export interface RecommendedNonExistingGlobalMerchant extends Omit<GlobalMerchant, 'globalMerchantId'> {
14
15
  globalMerchantId?: ID;
@@ -31,6 +32,7 @@ export interface VendorFirstReviewViewLocalData {
31
32
  vendorRenamedText?: string;
32
33
  lastUpdatedVendorNameByUserId?: ID;
33
34
  mergeVendorName: string | undefined;
35
+ transactionAttachments: Attachment[];
34
36
  }
35
37
  export interface RecentlySavedErroredVendorData {
36
38
  vendorId: ID;
@@ -8,7 +8,8 @@ exports.VENDOR_FIRST_REVIEW_VIEW_COLUMN_KEYS = [
8
8
  'retain',
9
9
  'status',
10
10
  'action',
11
- 'ytd', // Note: this is not part of list view, we are keeping it to use for default sorting purpose since default sorting is by year_to_date_spend
11
+ 'ytd',
12
+ 'viewTenantInvoice',
12
13
  ];
13
14
  const toVendorFirstReviewViewColumnKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.VENDOR_FIRST_REVIEW_VIEW_COLUMN_KEYS);
14
15
  exports.toVendorFirstReviewViewColumnKeyType = toVendorFirstReviewViewColumnKeyType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.10.92",
3
+ "version": "4.10.93",
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",