@zeniai/client-epic-state 4.17.21 → 4.17.22

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.
@@ -42,6 +42,7 @@ export interface AccountBase {
42
42
  qboId?: ID;
43
43
  coaId?: ID;
44
44
  reconciliationSource?: ReconciliationAccountSourceType;
45
+ isPreFilled?: boolean;
45
46
  }
46
47
  export interface RecommendedAccountBase extends AccountBase, RecommendationBase {
47
48
  }
@@ -11,6 +11,7 @@ export interface ClassBase {
11
11
  labels?: string[];
12
12
  qboId?: ID;
13
13
  accountingClassNumber?: string;
14
+ isPreFilled?: boolean;
14
15
  }
15
16
  export interface RecommendedClassBase extends ClassBase, RecommendationBase {
16
17
  }
@@ -13,5 +13,6 @@ export interface Entity {
13
13
  logo?: Url;
14
14
  typeName?: string;
15
15
  detailType?: EntityDetailType;
16
+ isPreFilled?: boolean;
16
17
  }
17
18
  export {};
@@ -69,6 +69,7 @@ const toTransactionDetailLocalData = (transaction, selectedTab, lineItemsByTrans
69
69
  qboId: vendorId,
70
70
  zeniId: vendorId,
71
71
  logo: vendor.logo,
72
+ isPreFilled: true,
72
73
  };
73
74
  transactionLocal.vendor = {
74
75
  id: vendorId,
@@ -102,7 +103,7 @@ const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendati
102
103
  const lineItemData = {};
103
104
  const { lines } = transaction;
104
105
  lines === null || lines === void 0 ? void 0 : lines.forEach((line) => {
105
- var _a, _b, _c, _d, _e;
106
+ var _a, _b, _c;
106
107
  if (line.type === 'transaction_with_account_and_class_line' ||
107
108
  line.type === 'transaction_with_product_or_service_line' ||
108
109
  line.type === 'journal_entry_transaction_line') {
@@ -157,12 +158,11 @@ const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendati
157
158
  accountLine.account.accountId == null ||
158
159
  (0, transactionDetailLocalDataHelper_2.isAccountUncategorized)(uncategorizedIncomeExpense, accountLine.account.qboId)) &&
159
160
  (higherPreferenceRecommendation === null || higherPreferenceRecommendation === void 0 ? void 0 : higherPreferenceRecommendation.account) != null) {
160
- record.account =
161
- (_d = higherPreferenceRecommendation === null || higherPreferenceRecommendation === void 0 ? void 0 : higherPreferenceRecommendation.account) !== null && _d !== void 0 ? _d : record.account;
161
+ record.account = Object.assign(Object.assign({}, higherPreferenceRecommendation.account), { isPreFilled: true });
162
162
  }
163
163
  if (accountLine.class.classId === '' &&
164
164
  (higherPreferenceRecommendation === null || higherPreferenceRecommendation === void 0 ? void 0 : higherPreferenceRecommendation.class) != null) {
165
- record.class = (_e = higherPreferenceRecommendation === null || higherPreferenceRecommendation === void 0 ? void 0 : higherPreferenceRecommendation.class) !== null && _e !== void 0 ? _e : record.class;
165
+ record.class = Object.assign(Object.assign({}, higherPreferenceRecommendation.class), { isPreFilled: true });
166
166
  }
167
167
  if (record.selectedEntityLine == null ||
168
168
  record.selectedEntityLine.qboId === '') {
@@ -178,6 +178,7 @@ const buildLineItemById = (transaction, uncategorizedIncomeExpense, recommendati
178
178
  type: 'vendor',
179
179
  qboId: vendorId,
180
180
  zeniId: vendorId,
181
+ isPreFilled: true,
181
182
  };
182
183
  }
183
184
  }
@@ -330,11 +331,13 @@ const setEntityRecommendationForLineIdInLocalData = (draft, transaction, transac
330
331
  record.account =
331
332
  isUncategorizedAccount === false && accountLine.account.qboId !== ''
332
333
  ? accountLine.account
333
- : ((_b = (_a = recommendations === null || recommendations === void 0 ? void 0 : recommendations[0]) === null || _a === void 0 ? void 0 : _a.account) !== null && _b !== void 0 ? _b : accountLine.account);
334
+ : ((_a = recommendations === null || recommendations === void 0 ? void 0 : recommendations[0]) === null || _a === void 0 ? void 0 : _a.account)
335
+ ? Object.assign(Object.assign({}, (_b = recommendations === null || recommendations === void 0 ? void 0 : recommendations[0]) === null || _b === void 0 ? void 0 : _b.account), { isPreFilled: true }) : accountLine.account;
334
336
  record.class =
335
337
  accountLine.class.classId !== ''
336
338
  ? accountLine.class
337
- : ((_d = (_c = recommendations === null || recommendations === void 0 ? void 0 : recommendations[0]) === null || _c === void 0 ? void 0 : _c.class) !== null && _d !== void 0 ? _d : accountLine.class);
339
+ : ((_c = recommendations === null || recommendations === void 0 ? void 0 : recommendations[0]) === null || _c === void 0 ? void 0 : _c.class)
340
+ ? Object.assign(Object.assign({}, (_d = recommendations === null || recommendations === void 0 ? void 0 : recommendations[0]) === null || _d === void 0 ? void 0 : _d.class), { isPreFilled: true }) : accountLine.class;
338
341
  if (checkIfNotJEAndDeposit === true) {
339
342
  if (entity.type === 'customer') {
340
343
  record.customer = toLineCustomerOrVendor(entity);
@@ -452,13 +452,11 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
452
452
  if (!(0, vendorTransaction_1.isVendorTransaction)(selectedTransaction) &&
453
453
  updatedVendor != null) {
454
454
  newTransactionLocalData = Object.assign(Object.assign({}, newTransactionLocalData), { lineItemById: Object.assign(Object.assign({}, transactionLocalData.transactionReviewLocalData.lineItemById), { [lineId]: Object.assign(Object.assign({}, transactionLocalData.transactionReviewLocalData.lineItemById[lineId]), { vendor: updatedVendor, selectedEntityLine: action.payload.selectedEntity != null
455
- ? action.payload.selectedEntity
456
- : undefined }) }) });
455
+ ? Object.assign(Object.assign({}, action.payload.selectedEntity), { isPreFilled: false }) : undefined }) }) });
457
456
  }
458
457
  else {
459
458
  if (action.payload.selectedEntity != null) {
460
- newTransactionLocalData.selectedEntity =
461
- action.payload.selectedEntity;
459
+ newTransactionLocalData.selectedEntity = Object.assign(Object.assign({}, action.payload.selectedEntity), { isPreFilled: false });
462
460
  }
463
461
  newTransactionLocalData.vendorUpdates =
464
462
  updatedVendor != null && updatedVendor.id != null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.17.21",
3
+ "version": "4.17.22",
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",