@zeniai/client-epic-state 4.10.19 → 4.10.21

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.
@@ -11,9 +11,9 @@ export interface BillTransactionPayload extends VendorTransactionPayload {
11
11
  is_recurring: boolean;
12
12
  recurring_bill_config_id: string | null;
13
13
  recurring_bill_instance: number | null;
14
- home_currency_amount?: number;
15
- home_currency_code?: string;
16
- home_currency_symbol?: string;
14
+ home_currency_amount: number;
15
+ home_currency_code: string;
16
+ home_currency_symbol: string;
17
17
  class_id?: ID | null;
18
18
  class_name?: string | null;
19
19
  qbo_class_id?: ID | null;
@@ -9,13 +9,7 @@ const billTransactionState_1 = require("./billTransactionState");
9
9
  const billPayConfigPayload_1 = require("../../../view/spendManagement/billPay/billPayConfig/billPayConfigPayload");
10
10
  const toBillTransaction = (payload) => {
11
11
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
12
- return Object.assign(Object.assign({}, (0, vendorTransactionPayload_1.toVendorTransaction)(payload)), { billPayInfo: (0, exports.toBillPayInfo)(payload.bill_pay_info), classId: (_a = payload.class_id) !== null && _a !== void 0 ? _a : '', className: (_b = payload.class_name) !== null && _b !== void 0 ? _b : '', qboClassId: (_c = payload.qbo_class_id) !== null && _c !== void 0 ? _c : '', transactionReferenceId: (_d = payload.transaction_reference_id) !== null && _d !== void 0 ? _d : '', entityApprovalId: payload.entity_approval_id, updateTime: (0, zeniDayJS_1.date)(payload.update_time), createdBy: (_e = payload.created_by_user_id) !== null && _e !== void 0 ? _e : '', candidateVendorName: (_f = payload.candidate_vendor_name) !== null && _f !== void 0 ? _f : '', bookCloseDate: payload.book_close_date != null
13
- ? (0, zeniDayJS_1.date)(payload.book_close_date)
14
- : undefined, lastUpdatedByUserId: (_g = payload.last_updated_by_user_id) !== null && _g !== void 0 ? _g : '', paymentProcessingTotalFee: (0, amount_1.toAmount)((_h = payload.total_fee) !== null && _h !== void 0 ? _h : 0, payload.currency_code, payload.currency_symbol), isDeleted: payload.is_deleted, deletionInfo: (0, exports.toDeletionInfo)(payload.deletion_info), isRecurring: payload.is_recurring, recurringBillConfigId: (_j = payload.recurring_bill_config_id) !== null && _j !== void 0 ? _j : undefined, recurringBillInstance: (_k = payload.recurring_bill_instance) !== null && _k !== void 0 ? _k : undefined, totalAmountInUSD: payload.home_currency_amount != null &&
15
- payload.home_currency_code != null &&
16
- payload.home_currency_symbol != null
17
- ? (0, amount_1.toAmount)(payload.home_currency_amount, payload.home_currency_code, payload.home_currency_symbol)
18
- : undefined });
12
+ return (Object.assign(Object.assign({}, (0, vendorTransactionPayload_1.toVendorTransaction)(payload)), { billPayInfo: (0, exports.toBillPayInfo)(payload.bill_pay_info), classId: (_a = payload.class_id) !== null && _a !== void 0 ? _a : '', className: (_b = payload.class_name) !== null && _b !== void 0 ? _b : '', qboClassId: (_c = payload.qbo_class_id) !== null && _c !== void 0 ? _c : '', transactionReferenceId: (_d = payload.transaction_reference_id) !== null && _d !== void 0 ? _d : '', entityApprovalId: payload.entity_approval_id, updateTime: (0, zeniDayJS_1.date)(payload.update_time), createdBy: (_e = payload.created_by_user_id) !== null && _e !== void 0 ? _e : '', candidateVendorName: (_f = payload.candidate_vendor_name) !== null && _f !== void 0 ? _f : '', bookCloseDate: payload.book_close_date != null ? (0, zeniDayJS_1.date)(payload.book_close_date) : undefined, lastUpdatedByUserId: (_g = payload.last_updated_by_user_id) !== null && _g !== void 0 ? _g : '', paymentProcessingTotalFee: (0, amount_1.toAmount)((_h = payload.total_fee) !== null && _h !== void 0 ? _h : 0, payload.currency_code, payload.currency_symbol), isDeleted: payload.is_deleted, deletionInfo: (0, exports.toDeletionInfo)(payload.deletion_info), isRecurring: payload.is_recurring, recurringBillConfigId: (_j = payload.recurring_bill_config_id) !== null && _j !== void 0 ? _j : undefined, recurringBillInstance: (_k = payload.recurring_bill_instance) !== null && _k !== void 0 ? _k : undefined, totalAmountInUSD: (0, amount_1.toAmount)(payload.home_currency_amount, payload.home_currency_code, payload.home_currency_symbol) }));
19
13
  };
20
14
  exports.toBillTransaction = toBillTransaction;
21
15
  const toBillPayInfo = (payload) => {
@@ -19,7 +19,7 @@ export interface BillTransaction extends VendorTransaction {
19
19
  isDeleted: boolean;
20
20
  deletionInfo: DeletionInfo;
21
21
  isRecurring: boolean;
22
- totalAmountInUSD?: Amount;
22
+ totalAmountInUSD: Amount;
23
23
  recurringBillConfigId?: ID;
24
24
  recurringBillInstance?: number;
25
25
  bookCloseDate?: ZeniDate;
@@ -73,6 +73,6 @@ export declare const isZeniDomainTenant: (currentTenant: TenantView) => boolean;
73
73
  export declare const isTenantUsingZeniCOA: (currentTenant: TenantView) => boolean;
74
74
  export declare const getCurrentTenantExternalConnections: (tenantState: TenantState, companyState: CompanyState) => TenantExternalConnections | undefined;
75
75
  export declare const toTenantCoreDetailsView: (tenantsBaseView: TenantBaseView[]) => TenantCoreDetailsView[];
76
- export declare const isTenantBankingOnly: (tenant: Tenant) => boolean;
77
- export declare const isTenantBookkeepingEnabled: (tenant: Tenant) => boolean;
76
+ export declare const isTenantBankingOnly: (tenant: Tenant | undefined) => boolean;
77
+ export declare const isTenantBookkeepingEnabled: (tenant: Tenant | undefined) => boolean;
78
78
  export {};
@@ -243,12 +243,16 @@ const toTenantCoreDetailsView = (tenantsBaseView) => {
243
243
  };
244
244
  exports.toTenantCoreDetailsView = toTenantCoreDetailsView;
245
245
  const isTenantBankingOnly = (tenant) => {
246
- return (tenant.productSettings.isBankingEnabled &&
247
- !tenant.productSettings.isBookkeepingEnabled &&
248
- !tenant.productSettings.isSpendManagementEnabled);
246
+ return tenant != null
247
+ ? tenant.productSettings.isBankingEnabled === true &&
248
+ tenant.productSettings.isBookkeepingEnabled === false &&
249
+ tenant.productSettings.isSpendManagementEnabled === false
250
+ : false;
249
251
  };
250
252
  exports.isTenantBankingOnly = isTenantBankingOnly;
251
253
  const isTenantBookkeepingEnabled = (tenant) => {
252
- return tenant.productSettings.isBookkeepingEnabled;
254
+ return tenant != null
255
+ ? tenant.productSettings.isBookkeepingEnabled === true
256
+ : true;
253
257
  };
254
258
  exports.isTenantBookkeepingEnabled = isTenantBookkeepingEnabled;
@@ -400,7 +400,7 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
400
400
  }
401
401
  };
402
402
  const sortedTransactionsWithSortKeyValue = (0, orderBy_1.default)(transactionsWithSortKeyValue, (transaction) => {
403
- var _a, _b, _c;
403
+ var _a, _b;
404
404
  switch (sortKey) {
405
405
  case 'name':
406
406
  return (_a = transaction.vendor) === null || _a === void 0 ? void 0 : _a.name.toLowerCase();
@@ -413,7 +413,7 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
413
413
  case 'status':
414
414
  return getStatusPerTab(transaction);
415
415
  case 'amount':
416
- return (_c = (_b = transaction.totalAmountInUSD) === null || _b === void 0 ? void 0 : _b.amount) !== null && _c !== void 0 ? _c : 0;
416
+ return (_b = transaction.totalAmountInUSD.amount) !== null && _b !== void 0 ? _b : 0;
417
417
  case 'paymentMethod':
418
418
  return transaction.billPayInfo.billPaymentMethodType.name;
419
419
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.10.19",
3
+ "version": "4.10.21",
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",