@zeniai/client-epic-state 4.7.98 → 4.7.99

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.
@@ -3,7 +3,7 @@ import { Currency } from '../../../../commonStateTypes/amount';
3
3
  import { AccountBasePayload } from '../../../../entity/account/accountPayload';
4
4
  import { ClassBasePayload } from '../../../../entity/class/classPayload';
5
5
  import { ZeniAPIResponse } from '../../../../responsePayload';
6
- import { BillPaymentConfigCodeType, BillPaymentSubConfigCodeType, InternationalFee, VendorCurrency, PaymentAchSubConfigCodeType, InternationalSubConfigCodeType, BillPayConfig, InternationalWireMethodCodeType, InternationalWireMethodCodeKeyType, InternationalSubConfigCodeKeyType, BillPaymentSubConfigCodeKeyType, PaymentAchSubConfigCodeKeyType, BillPaymentWireSubConfigCodeType, BillPaymentWireSubConfigCodeKeyType, ConfigPeriod } from './billPayConfigState';
6
+ import { BillPaymentConfigCodeType, BillPaymentSubConfigCodeType, InternationalFee, VendorCurrency, PaymentAchSubConfigCodeType, InternationalSubConfigCodeType, BillPayConfig, InternationalWireMethodCodeType, InternationalWireMethodCodeKeyType, InternationalSubConfigCodeKeyType, BillPaymentSubConfigCodeKeyType, PaymentAchSubConfigCodeKeyType, BillPaymentWireSubConfigCodeType, BillPaymentWireSubConfigCodeKeyType, ConfigPeriod, AccountTypeSubConfigCodeKeyType, AccType } from './billPayConfigState';
7
7
  export interface BillPayConfigPayload {
8
8
  bill_pay_bot_email: string;
9
9
  is_us_domestic_wire_enabled: boolean;
@@ -94,6 +94,7 @@ export declare const getPaymentAchSubConfigCodeKey: (subCode: PaymentAchSubConfi
94
94
  export declare const getBillPaymentWireSubConfigCodeKey: (subCode: BillPaymentWireSubConfigCodeType) => BillPaymentWireSubConfigCodeKeyType;
95
95
  export declare const getInternationalSubConfigCodeKey: (subCode: InternationalSubConfigCodeType) => InternationalSubConfigCodeKeyType;
96
96
  export declare const getInternationalWireMethodCodeKey: (subCode: InternationalWireMethodCodeType) => InternationalWireMethodCodeKeyType;
97
+ export declare const getAccountTypeSubConfigCodeKey: (subCode: AccType) => AccountTypeSubConfigCodeKeyType;
97
98
  export interface FeeAmount {
98
99
  amount: number;
99
100
  currencyCode: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toVendorCurrency = exports.mapBillPayVendorConfigPayloadToBillPayVendorConfig = exports.getCurrencies = exports.mapFeePayloadToInternationalLocalAmountFeeAmount = exports.mapBillPayConfigPayloadToBillPayConfig = exports.getClassDetail = exports.getAccountDetail = exports.getTimelineDetail = exports.getFeeDetail = exports.getInternationalWireMethodCodeKey = exports.getInternationalSubConfigCodeKey = exports.getBillPaymentWireSubConfigCodeKey = exports.getPaymentAchSubConfigCodeKey = exports.getBillPaymentSubConfigCodeKey = exports.getSubCodePayload = void 0;
3
+ exports.toVendorCurrency = exports.mapBillPayVendorConfigPayloadToBillPayVendorConfig = exports.getCurrencies = exports.mapFeePayloadToInternationalLocalAmountFeeAmount = exports.mapBillPayConfigPayloadToBillPayConfig = exports.getClassDetail = exports.getAccountDetail = exports.getTimelineDetail = exports.getFeeDetail = exports.getAccountTypeSubConfigCodeKey = exports.getInternationalWireMethodCodeKey = exports.getInternationalSubConfigCodeKey = exports.getBillPaymentWireSubConfigCodeKey = exports.getPaymentAchSubConfigCodeKey = exports.getBillPaymentSubConfigCodeKey = exports.getSubCodePayload = void 0;
4
4
  const amount_1 = require("../../../../commonStateTypes/amount");
5
5
  const accountPayload_1 = require("../../../../entity/account/accountPayload");
6
6
  const classPayload_1 = require("../../../../entity/class/classPayload");
@@ -63,6 +63,15 @@ const getInternationalWireMethodCodeKey = (subCode) => {
63
63
  }
64
64
  };
65
65
  exports.getInternationalWireMethodCodeKey = getInternationalWireMethodCodeKey;
66
+ const getAccountTypeSubConfigCodeKey = (subCode) => {
67
+ switch (subCode) {
68
+ case 'deposit_account':
69
+ return 'depositAccount';
70
+ case 'payment_account':
71
+ return 'paymentAccount';
72
+ }
73
+ };
74
+ exports.getAccountTypeSubConfigCodeKey = getAccountTypeSubConfigCodeKey;
66
75
  const getFeeDetail = (fees, code, subCode, internationalMethod, internationalSubMethod) => {
67
76
  let feeAmount = {
68
77
  amount: 0,
@@ -80,6 +80,12 @@ export declare type BillPaymentSubConfigCodeType = PaymentAchSubConfigCodeType |
80
80
  export declare type BillPaymentSubConfigCodeKeyType = PaymentAchSubConfigCodeKeyType | BillPaymentWireSubConfigCodeKeyType;
81
81
  export declare const toBillPaymentSubConfigCodeKeyType: (v: string) => BillPaymentSubConfigCodeKeyType;
82
82
  export declare const toBillPaymentSubConfigCodeType: (v: string) => BillPaymentSubConfigCodeType;
83
+ export declare const ACCOUNT_TYPE_CODES: readonly ["deposit_account", "payment_account"];
84
+ export declare const toAccType: (v: string) => "deposit_account" | "payment_account";
85
+ export declare type AccType = ReturnType<typeof toAccType>;
86
+ export declare const ACCOUNT_TYPE_SUB_CODES_KEYS: readonly ["depositAccount", "paymentAccount"];
87
+ export declare const toAccountTypeSubConfigCodeKeyType: (v: string) => "depositAccount" | "paymentAccount";
88
+ export declare type AccountTypeSubConfigCodeKeyType = ReturnType<typeof toAccountTypeSubConfigCodeKeyType>;
83
89
  export declare const BILL_NEW_PAYMENT_METHODS: string[];
84
90
  export declare const NEW_INTERNATIONAL_METHOD_SUBTEXT = "billPay_wire_international";
85
91
  export declare const SWIFT_OUR_INTERNATIONAL_METHOD_SUBTEXT = "swiftOur";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LOCAL_CURRENCY_INTERNATIONAL_METHOD_SUBTEXT = exports.SWIFT_OUR_INTERNATIONAL_METHOD_SUBTEXT = exports.NEW_INTERNATIONAL_METHOD_SUBTEXT = exports.BILL_NEW_PAYMENT_METHODS = exports.toBillPaymentSubConfigCodeType = exports.toBillPaymentSubConfigCodeKeyType = exports.toInternationalSubMethodCodeKeyType = exports.INTERNATIONAL_SUB_CODES_KEYS = exports.toInternationalSubMethodCodeType = exports.INTERNATIONAL_SUB_CODES = exports.toInternationalWireMethodCodeKeyType = exports.INTERNATIONAL_CODES_KEYS = exports.toInternationalWireMethodCodeType = exports.INTERNATIONAL_CODES = exports.toBillPaymentWireSubMethodCodeKeyType = exports.BILL_PAYMENT_WIRE_SUB_CODES_KEYS = exports.toBillPaymentWireSubMethodCodeType = exports.BILL_PAYMENT_WIRE_SUB_CODES = exports.toPaymentAchSubMethodCodeKeyType = exports.PAYMENT_ACH_SUB_CODES_KEYS = exports.toPaymentAchSubMethodCodeType = exports.PAYMENT_ACH_SUB_CODES = exports.toBillPaymentMethodCodeType = exports.BILL_PAYMENT_METHOD_CODE = exports.toDynamicFeeType = exports.DYNAMIC_FEE_TYPE = exports.getBillPayConfigMethodKey = exports.getBillPayConfigKey = void 0;
3
+ exports.LOCAL_CURRENCY_INTERNATIONAL_METHOD_SUBTEXT = exports.SWIFT_OUR_INTERNATIONAL_METHOD_SUBTEXT = exports.NEW_INTERNATIONAL_METHOD_SUBTEXT = exports.BILL_NEW_PAYMENT_METHODS = exports.toAccountTypeSubConfigCodeKeyType = exports.ACCOUNT_TYPE_SUB_CODES_KEYS = exports.toAccType = exports.ACCOUNT_TYPE_CODES = exports.toBillPaymentSubConfigCodeType = exports.toBillPaymentSubConfigCodeKeyType = exports.toInternationalSubMethodCodeKeyType = exports.INTERNATIONAL_SUB_CODES_KEYS = exports.toInternationalSubMethodCodeType = exports.INTERNATIONAL_SUB_CODES = exports.toInternationalWireMethodCodeKeyType = exports.INTERNATIONAL_CODES_KEYS = exports.toInternationalWireMethodCodeType = exports.INTERNATIONAL_CODES = exports.toBillPaymentWireSubMethodCodeKeyType = exports.BILL_PAYMENT_WIRE_SUB_CODES_KEYS = exports.toBillPaymentWireSubMethodCodeType = exports.BILL_PAYMENT_WIRE_SUB_CODES = exports.toPaymentAchSubMethodCodeKeyType = exports.PAYMENT_ACH_SUB_CODES_KEYS = exports.toPaymentAchSubMethodCodeType = exports.PAYMENT_ACH_SUB_CODES = exports.toBillPaymentMethodCodeType = exports.BILL_PAYMENT_METHOD_CODE = exports.toDynamicFeeType = exports.DYNAMIC_FEE_TYPE = exports.getBillPayConfigMethodKey = exports.getBillPayConfigKey = void 0;
4
4
  const common_1 = require("../../../../commonStateTypes/common");
5
5
  const stringToUnion_1 = require("../../../../commonStateTypes/stringToUnion");
6
6
  const getBillPayConfigKey = (method, subMethod) => {
@@ -68,6 +68,18 @@ const toBillPaymentSubConfigCodeKeyType = (v) => (0, stringToUnion_1.stringToUni
68
68
  exports.toBillPaymentSubConfigCodeKeyType = toBillPaymentSubConfigCodeKeyType;
69
69
  const toBillPaymentSubConfigCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, [...exports.PAYMENT_ACH_SUB_CODES, ...exports.BILL_PAYMENT_WIRE_SUB_CODES]);
70
70
  exports.toBillPaymentSubConfigCodeType = toBillPaymentSubConfigCodeType;
71
+ exports.ACCOUNT_TYPE_CODES = [
72
+ 'deposit_account',
73
+ 'payment_account',
74
+ ];
75
+ const toAccType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ACCOUNT_TYPE_CODES);
76
+ exports.toAccType = toAccType;
77
+ exports.ACCOUNT_TYPE_SUB_CODES_KEYS = [
78
+ 'depositAccount',
79
+ 'paymentAccount',
80
+ ];
81
+ const toAccountTypeSubConfigCodeKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ACCOUNT_TYPE_SUB_CODES_KEYS);
82
+ exports.toAccountTypeSubConfigCodeKeyType = toAccountTypeSubConfigCodeKeyType;
71
83
  //These const are used in web-components
72
84
  exports.BILL_NEW_PAYMENT_METHODS = [
73
85
  'billPay_ach_sameDay',
@@ -4,6 +4,7 @@ import { RemiActivity } from './reimbursement/remiDetailView/remiDetailViewSelec
4
4
  import { BusinessVerificationDetails, CompanyOfficersDetails } from './commonSetup/setupViewSelector';
5
5
  import { RecurringBillConfigLocalData, RecurringBillInstance } from './billPay/editBillView/editBillViewState';
6
6
  import { RecurringBillConfig, RecurringBillFrequency } from '../../entity/billPay/recurringBills/recurringBillsState';
7
+ import { AccType } from './billPay/billPayConfig/billPayConfigState';
7
8
  export declare const getLatestApprovalDate: (allActivities: BillActivity[] | RemiActivity[]) => ZeniDate | undefined;
8
9
  export declare function getSpendManagementEffectiveListPeriod(): import("../..").TimePeriod;
9
10
  export declare const getSelectedCompanyOfficer: (verificationDetails: BusinessVerificationDetails) => CompanyOfficersDetails | undefined;
@@ -15,3 +16,4 @@ export declare const updateRecurringBillDetails: (currentRecurringConfig: Recurr
15
16
  export declare const isRecurringConfigChanged: (recurringBillNewConfig: RecurringBillConfigLocalData, originalRecurringBillConfig: Partial<RecurringBillConfig>, checkApprovalChange: boolean) => boolean;
16
17
  export declare const getTotalPayments: (startDate: ZeniDate, endDate: ZeniDate, frequency: RecurringBillFrequency, currentInstance?: RecurringBillInstance | undefined) => number;
17
18
  export declare const getEndDate: (startDate: ZeniDate, frequency: RecurringBillFrequency, totalPayments: number, currentInstance?: RecurringBillInstance | undefined) => ZeniDate;
19
+ export declare const accountTypeSubConfigCodeToAccType: (code?: "depositAccount" | "paymentAccount" | undefined) => AccType | undefined;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEndDate = exports.getTotalPayments = exports.isRecurringConfigChanged = exports.updateRecurringBillDetails = exports.getPaymentDateFromVendorReceiveDate = exports.getSelectedCompanyOfficer = exports.getSpendManagementEffectiveListPeriod = exports.getLatestApprovalDate = void 0;
3
+ exports.accountTypeSubConfigCodeToAccType = exports.getEndDate = exports.getTotalPayments = exports.isRecurringConfigChanged = exports.updateRecurringBillDetails = exports.getPaymentDateFromVendorReceiveDate = exports.getSelectedCompanyOfficer = exports.getSpendManagementEffectiveListPeriod = exports.getLatestApprovalDate = void 0;
4
4
  const timeframeTick_1 = require("../../commonStateTypes/timeframeTick");
5
5
  const workingDayHelper_1 = require("../../commonStateTypes/workingDayHelper");
6
6
  const zeniDayJS_1 = require("../../zeniDayJS");
@@ -176,3 +176,14 @@ function checkIfHolidayAndGetNextDate(date) {
176
176
  }
177
177
  return { vendorReceiveDate: date, vendorReceiveDateNotes: '' };
178
178
  }
179
+ const accountTypeSubConfigCodeToAccType = (code) => {
180
+ switch (code) {
181
+ case 'depositAccount':
182
+ return 'deposit_account';
183
+ case 'paymentAccount':
184
+ return 'payment_account';
185
+ default:
186
+ return undefined;
187
+ }
188
+ };
189
+ exports.accountTypeSubConfigCodeToAccType = accountTypeSubConfigCodeToAccType;
@@ -38,7 +38,7 @@ const transferDetail = (0, toolkit_1.createSlice)({
38
38
  updateTransferToLocalData(draft, action) {
39
39
  const transferMoneyParty = {
40
40
  id: action.payload.id,
41
- accType: 'deposit_account',
41
+ accType: 'depositAccount',
42
42
  label: action.payload.accountName,
43
43
  maskedAccountNumber: action.payload.maskedAccountNumber,
44
44
  accountBalance: action.payload.accountBalance,
@@ -20,7 +20,7 @@ const getTransferDetail = (state) => {
20
20
  transferParties = [
21
21
  ...depositAccountsView.depositAccounts.map((depositAcc) => ({
22
22
  id: depositAcc.id,
23
- accType: 'deposit_account',
23
+ accType: 'depositAccount',
24
24
  label: depositAcc.accountName,
25
25
  maskedAccountNumber: depositAcc.maskedAccountNumber,
26
26
  accountBalance: depositAcc.accountBalance,
@@ -37,7 +37,7 @@ const getTransferDetail = (state) => {
37
37
  var _a;
38
38
  return ({
39
39
  id: paymentAcc.paymentAccountId,
40
- accType: 'payment_account',
40
+ accType: 'paymentAccount',
41
41
  maskedAccountNumber: paymentAcc.maskedAccountNumber,
42
42
  label: Boolean(paymentAcc.institutionDetails.institutionName) === true
43
43
  ? paymentAcc.institutionDetails.institutionName
@@ -2,6 +2,7 @@ import { Amount } from '../../../../commonStateTypes/amount';
2
2
  import { Balance } from '../../../../commonStateTypes/balance';
3
3
  import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
4
4
  import { Logo } from '../../../../entity/paymentAccount/paymentAccountState';
5
+ import { AccountTypeSubConfigCodeKeyType } from '../../billPay/billPayConfig/billPayConfigState';
5
6
  export interface TransferDetailState extends FetchStateAndError {
6
7
  localData: TransferDetailLocalData;
7
8
  }
@@ -12,10 +13,9 @@ export interface TransferDetailLocalData {
12
13
  }
13
14
  export interface TransferMoneyParty {
14
15
  id: ID;
15
- accType: AccType;
16
+ accType: AccountTypeSubConfigCodeKeyType;
16
17
  label: string;
17
18
  maskedAccountNumber: string;
18
19
  accountBalance?: Balance;
19
20
  logo?: Logo;
20
21
  }
21
- export declare type AccType = 'deposit_account' | 'payment_account';
@@ -7,6 +7,7 @@ const responsePayload_1 = require("../../../../responsePayload");
7
7
  const transferDetailReducer_1 = require("./transferDetailReducer");
8
8
  const depositAccountListReducer_1 = require("../depositAccountList/depositAccountListReducer");
9
9
  const depositAccountTransactionListReducer_1 = require("../depositAccountTransactionList/depositAccountTransactionListReducer");
10
+ const helpers_1 = require("../../helpers");
10
11
  const transferMoneyEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transferDetailReducer_1.transferMoney.match), (0, operators_1.switchMap)((action) => {
11
12
  var _a, _b, _c, _d;
12
13
  const state = state$.value;
@@ -15,11 +16,11 @@ const transferMoneyEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, opera
15
16
  const payload = {
16
17
  from_account: {
17
18
  account_id: (_a = localData.transferFrom) === null || _a === void 0 ? void 0 : _a.id,
18
- account_type: (_b = localData.transferFrom) === null || _b === void 0 ? void 0 : _b.accType,
19
+ account_type: (0, helpers_1.accountTypeSubConfigCodeToAccType)((_b = localData.transferFrom) === null || _b === void 0 ? void 0 : _b.accType),
19
20
  },
20
21
  to_account: {
21
22
  account_id: (_c = localData.transferTo) === null || _c === void 0 ? void 0 : _c.id,
22
- account_type: (_d = localData.transferTo) === null || _d === void 0 ? void 0 : _d.accType,
23
+ account_type: (0, helpers_1.accountTypeSubConfigCodeToAccType)((_d = localData.transferTo) === null || _d === void 0 ? void 0 : _d.accType),
23
24
  },
24
25
  amount: localData.amount.amount,
25
26
  currency_code: localData.amount.currencyCode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.7.98",
3
+ "version": "4.7.99",
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",