@zeniai/client-epic-state 4.12.19 → 4.12.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.
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +0 -2
- package/lib/entity/chargeCardTransaction/chargeCardTransactionPayload.d.ts +0 -5
- package/lib/entity/chargeCardTransaction/chargeCardTransactionPayload.js +2 -4
- package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.d.ts +2 -6
- package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.js +2 -8
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/entity/task/taskState.d.ts +3 -0
- package/lib/entity/task/taskState.js +13 -0
- package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
- package/lib/epic.d.ts +1 -4
- package/lib/epic.js +1 -4
- package/lib/index.d.ts +16 -18
- package/lib/index.js +5 -17
- package/lib/view/cardPayment/epic/addCardPaymentSourceEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/confirmCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/createCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/fetchPaymentSourcesEpic.d.ts +1 -1
- package/lib/view/globalMerchantView/epics/fetchGlobalMerchantRecommendationEpic.d.ts +3 -3
- package/lib/view/globalMerchantView/epics/fetchGlobalMerchantRecommendationEpic.js +4 -20
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -5
- package/lib/view/globalMerchantView/globalMerchantViewReducer.js +3 -8
- package/lib/view/globalMerchantView/globalMerchantViewSelector.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewSelector.js +5 -6
- package/lib/view/globalMerchantView/globalMerchantViewState.d.ts +0 -1
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
- package/lib/view/people/deletePersonEpic.d.ts +1 -1
- package/lib/view/people/invitePeopleEpic.d.ts +1 -1
- package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
- package/lib/view/people/resendInviteEpic.d.ts +1 -1
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.d.ts +0 -4
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigReducer.js +0 -9
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +0 -4
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +4 -10
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +29 -82
- package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.js +2 -2
- package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.js +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.d.ts +0 -6
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +0 -9
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigState.d.ts +0 -3
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +1 -11
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +2 -20
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailPayload.d.ts +0 -5
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +2 -27
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +4 -77
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +2 -19
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionListEpic.js +1 -3
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewReducer.js +2 -4
- package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
- package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.d.ts +1 -31
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +19 -11
- package/lib/view/taskManager/taskListView/bulkUpdateTaskListEpic.d.ts +0 -23
- package/lib/view/taskManager/taskListView/bulkUpdateTaskListEpic.js +2 -3
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +0 -6
- package/lib/view/taskManager/taskListView/taskListReducer.js +2 -53
- package/lib/view/vendorReviewView/common/state/commonTypes.d.ts +1 -2
- package/lib/view/vendorReviewView/common/state/commonTypes.js +4 -4
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewPayload.d.ts +1 -7
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewPayload.js +1 -11
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.d.ts +4 -14
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.js +49 -57
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewSelector.d.ts +0 -10
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewSelector.js +1 -21
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewState.d.ts +2 -20
- package/lib/view/vendorReviewView/vendorGlobalReviewView/epics/fetchVendorGlobalReviewViewEpic.js +4 -4
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewPayload.d.ts +1 -1
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewPayload.js +2 -2
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewReducer.d.ts +1 -6
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewReducer.js +6 -18
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewSelector.d.ts +1 -3
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewSelector.js +5 -7
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewState.d.ts +1 -9
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewState.js +2 -2
- package/package.json +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionAttachmentsEpic.d.ts +0 -10
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionAttachmentsEpic.js +0 -42
- package/lib/view/taskManager/taskListView/updateTaskFromListViewEpic.d.ts +0 -8
- package/lib/view/taskManager/taskListView/updateTaskFromListViewEpic.js +0 -37
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/saveVendorDetailsViewEpic.d.ts +0 -8
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/saveVendorDetailsViewEpic.js +0 -62
|
@@ -20,7 +20,6 @@ exports.initialState = {
|
|
|
20
20
|
return this.fetchState == 'Completed';
|
|
21
21
|
},
|
|
22
22
|
billBulkSubmissionLimit: 10,
|
|
23
|
-
lastSelectedFromAccount: undefined,
|
|
24
23
|
};
|
|
25
24
|
const billPayConfig = (0, toolkit_1.createSlice)({
|
|
26
25
|
name: 'billPayConfig',
|
|
@@ -99,14 +98,6 @@ const billPayConfig = (0, toolkit_1.createSlice)({
|
|
|
99
98
|
draft.vendor.currencyListByCountryId[countryCode] =
|
|
100
99
|
currencyPayload.currencies.map((currency) => (0, billPayConfigPayload_1.toVendorCurrency)(currency));
|
|
101
100
|
});
|
|
102
|
-
draft.lastSelectedFromAccount =
|
|
103
|
-
payload.last_selected_from_account.account_id != null &&
|
|
104
|
-
payload.last_selected_from_account.account_type != null
|
|
105
|
-
? {
|
|
106
|
-
accountId: payload.last_selected_from_account.account_id,
|
|
107
|
-
accountType: (0, billPayConfigPayload_1.getAccountTypeSubConfigCodeKey)((0, billPayConfigState_1.toAccType)(payload.last_selected_from_account.account_type)),
|
|
108
|
-
}
|
|
109
|
-
: undefined;
|
|
110
101
|
},
|
|
111
102
|
updateBillPayConfigFailure(draft, action) {
|
|
112
103
|
draft.fetchState = 'Error';
|
|
@@ -18,10 +18,6 @@ export interface BillPayConfigState extends FetchedState {
|
|
|
18
18
|
};
|
|
19
19
|
billPayBotEmail: string;
|
|
20
20
|
billBulkSubmissionLimit: number;
|
|
21
|
-
lastSelectedFromAccount?: {
|
|
22
|
-
accountId: ID;
|
|
23
|
-
accountType: AccountTypeSubConfigCodeKeyType;
|
|
24
|
-
};
|
|
25
21
|
}
|
|
26
22
|
export interface VendorCurrency extends Currency {
|
|
27
23
|
currencyName: string;
|
|
@@ -3,6 +3,7 @@ import { RootState } from '../../../../reducer';
|
|
|
3
3
|
import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
4
|
import { Amount } from '../../../../commonStateTypes/amount';
|
|
5
5
|
import { BillPayInfo, BillPaymentMethod, BillStageCodeType, BillTransaction, InternationalTransferFeeBearerPaymentMethod } from '../../../../entity/billPay/billTransaction/billTransactionState';
|
|
6
|
+
import { PaymentAccountState } from '../../../../entity/paymentAccount/paymentAccountState';
|
|
6
7
|
import { Attachment } from '../../../../entity/transaction/stateTypes/attachment';
|
|
7
8
|
import { TransactionWithAccountAndClassLine } from '../../../../entity/transaction/stateTypes/transactionLine';
|
|
8
9
|
import { Vendor } from '../../../../entity/vendor/vendorState';
|
|
@@ -25,6 +26,7 @@ import { VendorDetailLocalData } from '../../../commonVendorView/vendorView/vend
|
|
|
25
26
|
import { AccountBase, RecommendedAccountBase } from '../../../../entity/account/accountState';
|
|
26
27
|
import { ClassBase, RecommendedClassBase } from '../../../../entity/class/classState';
|
|
27
28
|
import { RecurringBillState } from '../../../../entity/billPay/recurringBills/recurringBillsState';
|
|
29
|
+
import { DepositAccountState } from '../../../../entity/depositAccount/depositAccount';
|
|
28
30
|
import { FundingAccount } from '../../commonSetup/setupViewSelector';
|
|
29
31
|
export declare type PaymentToOption = {
|
|
30
32
|
id: ID;
|
|
@@ -119,7 +121,7 @@ export declare const getEditBillDetail: (state: RootState, isVendorRecommendatio
|
|
|
119
121
|
export declare const getBillPayConfigList: (billPayConfigState: BillPayConfigState) => BillPayConfig[];
|
|
120
122
|
export declare const getPaymentMethodType: (billPayConfigState: BillPayConfigState, accType: AccountTypeSubConfigCodeKeyType, paymentMethod?: BillPaymentMethod | undefined, internationalTransferFeeBearerPaymentMethod?: "swift_our" | "swift_sha" | undefined) => BillPayConfig | undefined;
|
|
121
123
|
export declare function getWhatForSection(updatedWhatForSection: WhatForSection | undefined): WhatForSection;
|
|
122
|
-
export declare function getPaymentSection(state: RootState, withdrawFromList: FundingAccount[], updatedPaymentSection: PaymentDetailsSection
|
|
124
|
+
export declare function getPaymentSection(state: RootState, withdrawFromList: FundingAccount[], updatedPaymentSection: PaymentDetailsSection): PaymentDetailsSectionView;
|
|
123
125
|
export declare function toPaymentToOption(paymentMode: PaymentMode): PaymentToOption;
|
|
124
126
|
export interface PaymentDetailsSectionView {
|
|
125
127
|
paymentType?: BillPayConfig;
|
|
@@ -129,7 +131,6 @@ export interface PaymentDetailsSectionView {
|
|
|
129
131
|
paymentTo?: PaymentToOption;
|
|
130
132
|
internationalTransferFeeBearerPaymentMethod?: InternationalTransferFeeBearerPaymentMethod;
|
|
131
133
|
conversionRate?: number;
|
|
132
|
-
defaultSelectedAccount?: FundingAccount;
|
|
133
134
|
}
|
|
134
135
|
export declare const getRecurringBillLocalData: (recurringBillState: RecurringBillState, transaction: BillTransaction) => {
|
|
135
136
|
recurringBillInstancesLocalData: RecurringBillInstance[];
|
|
@@ -137,11 +138,4 @@ export declare const getRecurringBillLocalData: (recurringBillState: RecurringBi
|
|
|
137
138
|
};
|
|
138
139
|
export declare const getInvoiceDate: (billStageCode: BillStageCodeType, invoiceDate: ZeniDate, bookCloseDate?: import("dayjs").Dayjs | undefined) => import("dayjs").Dayjs;
|
|
139
140
|
export declare const getDueDate: (billStageCode: BillStageCodeType, dueDate: ZeniDate, invoiceDate?: import("dayjs").Dayjs | undefined, bookCloseDate?: import("dayjs").Dayjs | undefined) => import("dayjs").Dayjs;
|
|
140
|
-
export declare const getWithdrawFrom: (
|
|
141
|
-
accountId: ID;
|
|
142
|
-
accountType: AccountTypeSubConfigCodeKeyType;
|
|
143
|
-
} | undefined) => FundingAccount | undefined;
|
|
144
|
-
export declare const getDefaultWithdrawFromAccount: (state: RootState, depositAccounts: ID[], companyId: ID, lastSelectedFromAccount?: {
|
|
145
|
-
accountId: ID;
|
|
146
|
-
accountType: AccountTypeSubConfigCodeKeyType;
|
|
147
|
-
} | undefined) => FundingAccount | undefined;
|
|
141
|
+
export declare const getWithdrawFrom: (paymentAccountState: PaymentAccountState, depositAccountState: DepositAccountState, fromAccountId: ID, fromAccountType: string) => FundingAccount | undefined;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.getWithdrawFrom = exports.getDueDate = exports.getInvoiceDate = exports.getRecurringBillLocalData = exports.toPaymentToOption = exports.getPaymentSection = exports.getWhatForSection = exports.getPaymentMethodType = exports.getBillPayConfigList = exports.getEditBillDetail = void 0;
|
|
7
7
|
const get_1 = __importDefault(require("lodash/get"));
|
|
8
8
|
const has_1 = __importDefault(require("lodash/has"));
|
|
9
9
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
@@ -30,9 +30,8 @@ const billPayConfigPayload_1 = require("../billPayConfig/billPayConfigPayload");
|
|
|
30
30
|
const depositAccountListSelector_1 = require("../../zeniAccounts/depositAccountList/depositAccountListSelector");
|
|
31
31
|
const depositAccountSelector_1 = require("../../../../entity/depositAccount/depositAccountSelector");
|
|
32
32
|
const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
33
|
-
const getCompanyView_1 = require("../../../companyView/selectorHelpers/getCompanyView");
|
|
34
33
|
const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAccountsEnabled, billId) => {
|
|
35
|
-
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, _3, _4, _5;
|
|
34
|
+
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, _3, _4, _5, _6, _7;
|
|
36
35
|
const { accountListState, accountState, bankAccountState, billDetailViewState, paymentAccountListState, billTransactionState, billPayConfigState, classListState, classState, editBillDetailViewState, paymentAccountState, vendorState, tenantState, companyState, userState, commonHistoryState, contactState, paymentInstrumentState, recurringBillState, depositAccountListState, depositAccountState, } = state;
|
|
37
36
|
const transaction = (0, get_1.default)(billTransactionState.transactionById, billId !== null && billId !== void 0 ? billId : '', undefined);
|
|
38
37
|
let recommendations = {};
|
|
@@ -113,7 +112,7 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
113
112
|
let editBillInitialDetails = {
|
|
114
113
|
lineDetailSection: {},
|
|
115
114
|
whatForSection: getWhatForSection(undefined),
|
|
116
|
-
paymentDetailsSection: getPaymentSection(state, withdrawFromList, {}
|
|
115
|
+
paymentDetailsSection: getPaymentSection(state, withdrawFromList, {}),
|
|
117
116
|
totalAmount: sourceBillDetail === null || sourceBillDetail === void 0 ? void 0 : sourceBillDetail.billDetailLocalData.totalAmount,
|
|
118
117
|
recipientTotalAmount: sourceBillDetail === null || sourceBillDetail === void 0 ? void 0 : sourceBillDetail.billDetailLocalData.recipientTotalAmount,
|
|
119
118
|
};
|
|
@@ -155,14 +154,14 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
155
154
|
const initialPaymentDetailsSection = {
|
|
156
155
|
paymentType: (0, exports.getPaymentMethodType)(billPayConfigState, (_q = billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.fromAccount.billAccountType) !== null && _q !== void 0 ? _q : 'depositAccount', billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.billPaymentMethodType, billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.internationalTransferFeeBearerPaymentMethod),
|
|
157
156
|
paymentDate: billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.paymentDate,
|
|
158
|
-
withdrawFrom: (0, exports.getWithdrawFrom)(
|
|
159
|
-
paymentTo: ((
|
|
157
|
+
withdrawFrom: (0, exports.getWithdrawFrom)(paymentAccountState, depositAccountState, (_r = billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.fromAccount.billAccountId) !== null && _r !== void 0 ? _r : '', (_s = billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.fromAccount.billAccountType) !== null && _s !== void 0 ? _s : ''),
|
|
158
|
+
paymentTo: ((_t = billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.toAccount.billAccountId) === null || _t === void 0 ? void 0 : _t.length) != null &&
|
|
160
159
|
(billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.toAccount.billAccountId.length) > 0
|
|
161
160
|
? billPayInfo.toAccount.billAccountId
|
|
162
161
|
: undefined,
|
|
163
162
|
internationalTransferFeeBearerPaymentMethod: billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.internationalTransferFeeBearerPaymentMethod,
|
|
164
163
|
};
|
|
165
|
-
const initialPaymentDetailsSectionView = getPaymentSection(state, withdrawFromList, initialPaymentDetailsSection
|
|
164
|
+
const initialPaymentDetailsSectionView = getPaymentSection(state, withdrawFromList, initialPaymentDetailsSection);
|
|
166
165
|
editBillInitialDetails = {
|
|
167
166
|
vendor: initialVendor,
|
|
168
167
|
whatForSection: initialWhatForSection,
|
|
@@ -174,7 +173,7 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
174
173
|
if (sourceBillDetail != null) {
|
|
175
174
|
const billViewState = billDetailViewState.billDetailById[key];
|
|
176
175
|
isCancelled = sourceBillDetail.billDetailLocalData.isCancelled;
|
|
177
|
-
billStage = (
|
|
176
|
+
billStage = (_u = billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.stage.code) !== null && _u !== void 0 ? _u : 'draft';
|
|
178
177
|
if (billViewState != null) {
|
|
179
178
|
fetchState = (0, reduceFetchState_1.reduceFetchState)([
|
|
180
179
|
sourceBillDetail.fetchStatus,
|
|
@@ -186,7 +185,7 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
186
185
|
}
|
|
187
186
|
}
|
|
188
187
|
//recurringBill Details
|
|
189
|
-
isRecurring = (
|
|
188
|
+
isRecurring = (_v = transaction === null || transaction === void 0 ? void 0 : transaction.isRecurring) !== null && _v !== void 0 ? _v : false;
|
|
190
189
|
if (isRecurring && transaction != null) {
|
|
191
190
|
const { recurringConfigLocalData, recurringBillInstancesLocalData } = (0, exports.getRecurringBillLocalData)(recurringBillState, transaction);
|
|
192
191
|
recurringConfig = recurringConfigLocalData;
|
|
@@ -209,16 +208,16 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
209
208
|
lastRecommendedVendorName = updatedRecord.lastRecommendedVendorName;
|
|
210
209
|
paymentDetailsSection =
|
|
211
210
|
updatedRecord.paymentDetailsSection != null
|
|
212
|
-
? getPaymentSection(state, withdrawFromList, updatedRecord.paymentDetailsSection
|
|
211
|
+
? getPaymentSection(state, withdrawFromList, updatedRecord.paymentDetailsSection)
|
|
213
212
|
: undefined;
|
|
214
213
|
vendorDetails =
|
|
215
214
|
updatedRecord.vendor != null
|
|
216
215
|
? (0, vendorSelector_1.getVendorByVendorId)(vendorState, updatedRecord.vendor.id)
|
|
217
216
|
: undefined;
|
|
218
217
|
file = updatedRecord.file;
|
|
219
|
-
const bankAccInBill = (0, bankAccountSelector_1.getBankAccountByBankAccountId)(bankAccountState, (
|
|
220
|
-
const vendorBankAccounts = (0, bankAccountSelector_1.getBankAccountsByBankAccountIds)(bankAccountState, (
|
|
221
|
-
const vendorPaymentInstruments = (0, paymentInstrumentSelector_1.getPaymentInstrumentsByIds)(paymentInstrumentState, (
|
|
218
|
+
const bankAccInBill = (0, bankAccountSelector_1.getBankAccountByBankAccountId)(bankAccountState, (_x = (_w = updatedRecord.paymentDetailsSection) === null || _w === void 0 ? void 0 : _w.paymentTo) !== null && _x !== void 0 ? _x : '');
|
|
219
|
+
const vendorBankAccounts = (0, bankAccountSelector_1.getBankAccountsByBankAccountIds)(bankAccountState, (_y = vendorDetails === null || vendorDetails === void 0 ? void 0 : vendorDetails.bankAccountIds) !== null && _y !== void 0 ? _y : []);
|
|
220
|
+
const vendorPaymentInstruments = (0, paymentInstrumentSelector_1.getPaymentInstrumentsByIds)(paymentInstrumentState, (_z = vendorDetails === null || vendorDetails === void 0 ? void 0 : vendorDetails.paymentInstrumentIds) !== null && _z !== void 0 ? _z : []);
|
|
222
221
|
const isBankAccInBillExistInVendor = bankAccInBill != null
|
|
223
222
|
? vendorBankAccounts
|
|
224
223
|
.map((bankAc) => bankAc.bankAccountId)
|
|
@@ -271,7 +270,7 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
271
270
|
whatForSection.recipientCurrencyCode =
|
|
272
271
|
recommendedVendor.vendorCurrencyCode;
|
|
273
272
|
}
|
|
274
|
-
isRecurring = (
|
|
273
|
+
isRecurring = (_0 = sourceBillDetail.billDetailLocalData.isRecurring) !== null && _0 !== void 0 ? _0 : false;
|
|
275
274
|
recurringConfig = sourceBillDetail.billDetailLocalData.recurringConfig;
|
|
276
275
|
recurringBillInstances =
|
|
277
276
|
sourceBillDetail.billDetailLocalData.recurringBillInstances;
|
|
@@ -291,7 +290,7 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
291
290
|
}
|
|
292
291
|
const vendorContactSaveStatus = editBillDetailViewState.updateVendorContactState;
|
|
293
292
|
const lineDetailSection = {};
|
|
294
|
-
const lineDetailSectionUpdatesByLineId = (
|
|
293
|
+
const lineDetailSectionUpdatesByLineId = (_2 = (_1 = sourceBillDetail === null || sourceBillDetail === void 0 ? void 0 : sourceBillDetail.billDetailLocalData) === null || _1 === void 0 ? void 0 : _1.updatesByLineId) !== null && _2 !== void 0 ? _2 : {};
|
|
295
294
|
const classList = (0, classListSelector_1.getClassList)(classState, classListState);
|
|
296
295
|
if (accountList.fetchState === 'Completed') {
|
|
297
296
|
Object.keys(lineDetailSectionUpdatesByLineId).forEach((lineId) => {
|
|
@@ -312,16 +311,16 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
312
311
|
const accountsHierarchyList = (0, accountListSelector_1.getNestedAccountListHierarchy)(accountListState, 'billPayAccountList');
|
|
313
312
|
const classHierarchyList = (0, classListSelector_1.getNestedClassListHierarchy)(classListState);
|
|
314
313
|
const duplicateBills = (0, billPayReviewSelector_1.getDuplicateBills)(state, billId);
|
|
315
|
-
const isProcessing = (0, helpers_1.isBillProcessing)((
|
|
314
|
+
const isProcessing = (0, helpers_1.isBillProcessing)((_3 = transaction === null || transaction === void 0 ? void 0 : transaction.bulkProcessingDetail) === null || _3 === void 0 ? void 0 : _3.type);
|
|
316
315
|
return {
|
|
317
316
|
showVendorGptRecommendationText,
|
|
318
317
|
recommendedVendor,
|
|
319
318
|
lastRecommendedVendorName,
|
|
320
319
|
duplicateBills,
|
|
321
320
|
fetchState: fetchState,
|
|
322
|
-
saveStatus: (
|
|
323
|
-
error: (
|
|
324
|
-
uploadStatus: (
|
|
321
|
+
saveStatus: (_4 = sourceBillDetail === null || sourceBillDetail === void 0 ? void 0 : sourceBillDetail.saveStatus) !== null && _4 !== void 0 ? _4 : undefined,
|
|
322
|
+
error: (_6 = (_5 = sourceBillDetail === null || sourceBillDetail === void 0 ? void 0 : sourceBillDetail.fetchStatus) === null || _5 === void 0 ? void 0 : _5.error) !== null && _6 !== void 0 ? _6 : undefined,
|
|
323
|
+
uploadStatus: (_7 = sourceBillDetail === null || sourceBillDetail === void 0 ? void 0 : sourceBillDetail.uploadFetchState) !== null && _7 !== void 0 ? _7 : undefined,
|
|
325
324
|
version: 0,
|
|
326
325
|
createdBy,
|
|
327
326
|
createTime,
|
|
@@ -440,13 +439,13 @@ function getWhatForSection(updatedWhatForSection) {
|
|
|
440
439
|
};
|
|
441
440
|
}
|
|
442
441
|
exports.getWhatForSection = getWhatForSection;
|
|
443
|
-
function getPaymentSection(state, withdrawFromList, updatedPaymentSection
|
|
442
|
+
function getPaymentSection(state, withdrawFromList, updatedPaymentSection) {
|
|
444
443
|
var _a, _b;
|
|
445
444
|
const withdrawFrom = (updatedPaymentSection === null || updatedPaymentSection === void 0 ? void 0 : updatedPaymentSection.withdrawFrom) != null
|
|
446
445
|
? updatedPaymentSection === null || updatedPaymentSection === void 0 ? void 0 : updatedPaymentSection.withdrawFrom
|
|
447
446
|
: withdrawFromList.length === 1
|
|
448
447
|
? withdrawFromList[0]
|
|
449
|
-
:
|
|
448
|
+
: undefined;
|
|
450
449
|
const withdrawFromAccountingName = undefined;
|
|
451
450
|
const availablePaymentOptions = state.billPayConfigState.fetchState === 'Completed'
|
|
452
451
|
? (0, exports.getBillPayConfigList)(state.billPayConfigState).filter((option) => { var _a; return option.method.includes((_a = withdrawFrom === null || withdrawFrom === void 0 ? void 0 : withdrawFrom.accType) !== null && _a !== void 0 ? _a : ''); })
|
|
@@ -592,69 +591,17 @@ const getDueDate = (billStageCode, dueDate, invoiceDate, bookCloseDate) => {
|
|
|
592
591
|
}
|
|
593
592
|
};
|
|
594
593
|
exports.getDueDate = getDueDate;
|
|
595
|
-
const getWithdrawFrom = (
|
|
596
|
-
const
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
withdrawFromAsDepositAcc != null) {
|
|
602
|
-
return (0, setupViewSelector_1.mapDepositAccToFundingAccount)(withdrawFromAsDepositAcc);
|
|
603
|
-
}
|
|
604
|
-
if (fromAccountType === 'paymentAccount' &&
|
|
605
|
-
withdrawFromAsPaymentAcc != null) {
|
|
606
|
-
return (0, setupViewSelector_1.mapPaymentAccToFundingAccount)(withdrawFromAsPaymentAcc);
|
|
607
|
-
}
|
|
594
|
+
const getWithdrawFrom = (paymentAccountState, depositAccountState, fromAccountId, fromAccountType) => {
|
|
595
|
+
const withdrawFromAsDepositAcc = (0, depositAccountSelector_1.getDepositAccountByDepositAccountId)(depositAccountState, fromAccountId);
|
|
596
|
+
const withdrawFromAsPaymentAcc = (0, paymentAccountSelector_1.getPaymentAccountByPaymentAccountId)(paymentAccountState, fromAccountId);
|
|
597
|
+
if (fromAccountType === 'depositAccount' &&
|
|
598
|
+
withdrawFromAsDepositAcc != null) {
|
|
599
|
+
return (0, setupViewSelector_1.mapDepositAccToFundingAccount)(withdrawFromAsDepositAcc);
|
|
608
600
|
}
|
|
609
|
-
|
|
610
|
-
|
|
601
|
+
if (fromAccountType === 'paymentAccount' &&
|
|
602
|
+
withdrawFromAsPaymentAcc != null) {
|
|
603
|
+
return (0, setupViewSelector_1.mapPaymentAccToFundingAccount)(withdrawFromAsPaymentAcc);
|
|
611
604
|
}
|
|
612
605
|
return undefined;
|
|
613
606
|
};
|
|
614
607
|
exports.getWithdrawFrom = getWithdrawFrom;
|
|
615
|
-
const getDefaultWithdrawFromAccount = (state, depositAccounts, companyId, lastSelectedFromAccount) => {
|
|
616
|
-
const { depositAccountState, paymentAccountState } = state;
|
|
617
|
-
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
|
|
618
|
-
const primaryAccount = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyBillPayInfo.primaryFundingAccount;
|
|
619
|
-
let defaultAccount = undefined;
|
|
620
|
-
// User paying bill for first time or previously paid with external account
|
|
621
|
-
if (lastSelectedFromAccount == null ||
|
|
622
|
-
(lastSelectedFromAccount === null || lastSelectedFromAccount === void 0 ? void 0 : lastSelectedFromAccount.accountType) === 'paymentAccount') {
|
|
623
|
-
if (depositAccounts.length === 0) {
|
|
624
|
-
defaultAccount = primaryAccount;
|
|
625
|
-
}
|
|
626
|
-
else {
|
|
627
|
-
if ((primaryAccount === null || primaryAccount === void 0 ? void 0 : primaryAccount.accountType) === 'depositAccount') {
|
|
628
|
-
defaultAccount = primaryAccount;
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
else {
|
|
633
|
-
// User paid with Zeni account previously
|
|
634
|
-
if (depositAccounts.length === 1) {
|
|
635
|
-
defaultAccount = primaryAccount;
|
|
636
|
-
}
|
|
637
|
-
else {
|
|
638
|
-
if ((primaryAccount === null || primaryAccount === void 0 ? void 0 : primaryAccount.accountType) === 'depositAccount') {
|
|
639
|
-
defaultAccount = primaryAccount;
|
|
640
|
-
}
|
|
641
|
-
else {
|
|
642
|
-
defaultAccount = lastSelectedFromAccount;
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
if (defaultAccount != null) {
|
|
647
|
-
const defaultAccAsDepositAcc = (0, depositAccountSelector_1.getDepositAccountByDepositAccountId)(depositAccountState, defaultAccount === null || defaultAccount === void 0 ? void 0 : defaultAccount.accountId);
|
|
648
|
-
const defaultAccAsPaymentAcc = (0, paymentAccountSelector_1.getPaymentAccountByPaymentAccountId)(paymentAccountState, defaultAccount === null || defaultAccount === void 0 ? void 0 : defaultAccount.accountId);
|
|
649
|
-
if (defaultAccount.accountType === 'depositAccount' &&
|
|
650
|
-
defaultAccAsDepositAcc != null) {
|
|
651
|
-
return (0, setupViewSelector_1.mapDepositAccToFundingAccount)(defaultAccAsDepositAcc);
|
|
652
|
-
}
|
|
653
|
-
if (defaultAccount.accountType === 'paymentAccount' &&
|
|
654
|
-
defaultAccAsPaymentAcc != null) {
|
|
655
|
-
return (0, setupViewSelector_1.mapPaymentAccToFundingAccount)(defaultAccAsPaymentAcc);
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
return undefined;
|
|
659
|
-
};
|
|
660
|
-
exports.getDefaultWithdrawFromAccount = getDefaultWithdrawFromAccount;
|
package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.js
CHANGED
|
@@ -97,7 +97,7 @@ const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
|
|
|
97
97
|
const editBillState = (0, get_1.default)(state.editBillDetailViewState.editBillStateById, detailKey, undefined);
|
|
98
98
|
const billDetail = (0, get_1.default)(state.billDetailViewState.billDetailById, detailKey, undefined);
|
|
99
99
|
const transaction = (0, get_1.default)(state.billTransactionState.transactionById, billId, undefined);
|
|
100
|
-
const { accountListState, accountState, classListState, classState, recurringBillState, } = state;
|
|
100
|
+
const { accountListState, accountState, classListState, classState, recurringBillState, depositAccountState, paymentAccountState, } = state;
|
|
101
101
|
const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'billPayAccountList');
|
|
102
102
|
const classList = (0, classListSelector_1.getClassList)(classState, classListState);
|
|
103
103
|
const recommendations = transaction === null || transaction === void 0 ? void 0 : transaction.recommendations;
|
|
@@ -161,7 +161,7 @@ const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
|
|
|
161
161
|
const paymentDetailsSection = {
|
|
162
162
|
paymentType: (0, editBillViewSelector_1.getPaymentMethodType)(state.billPayConfigState, (_h = transaction.billPayInfo.fromAccount.billAccountType) !== null && _h !== void 0 ? _h : 'depositAccount', transaction.billPayInfo.billPaymentMethodType, transaction.billPayInfo.internationalTransferFeeBearerPaymentMethod),
|
|
163
163
|
paymentDate: (_j = transaction.billPayInfo.paymentDate) !== null && _j !== void 0 ? _j : (0, zeniDayJS_1.date)((0, workingDayHelper_1.getNextNthWorkingDay)((0, zeniDayJS_1.dateNow)().toDate(), [0, 6], isPayNowEnabled ? 0 : 1).toISOString()),
|
|
164
|
-
withdrawFrom: (0, editBillViewSelector_1.getWithdrawFrom)(
|
|
164
|
+
withdrawFrom: (0, editBillViewSelector_1.getWithdrawFrom)(paymentAccountState, depositAccountState, (_k = transaction.billPayInfo.fromAccount.billAccountId) !== null && _k !== void 0 ? _k : '', (_l = transaction.billPayInfo.fromAccount.billAccountType) !== null && _l !== void 0 ? _l : ''),
|
|
165
165
|
paymentTo: transaction.billPayInfo.toAccount.billAccountId != null &&
|
|
166
166
|
transaction.billPayInfo.toAccount.billAccountId.length > 0
|
|
167
167
|
? transaction.billPayInfo.toAccount.billAccountId
|
|
@@ -248,7 +248,7 @@ const toBillDetailLocalData = (state, showVendorGptRecommendationText, billPaylo
|
|
|
248
248
|
paymentDate: ((_o = billPayload.bill_pay_info) === null || _o === void 0 ? void 0 : _o.payment_date) != null
|
|
249
249
|
? (0, zeniDayJS_1.date)((_p = billPayload.bill_pay_info) === null || _p === void 0 ? void 0 : _p.payment_date)
|
|
250
250
|
: (0, zeniDayJS_1.date)((0, workingDayHelper_1.getNextNthWorkingDay)((0, zeniDayJS_1.dateNow)().toDate(), [0, 6], isPayNowEnabled ? 0 : 1).toISOString()),
|
|
251
|
-
withdrawFrom: (0, editBillViewSelector_1.getWithdrawFrom)(state, (_r = (_q = billPayload.bill_pay_info) === null || _q === void 0 ? void 0 : _q.from_account.account_id) !== null && _r !== void 0 ? _r : '', (_t = (_s = billPayload.bill_pay_info) === null || _s === void 0 ? void 0 : _s.from_account.account_type) !== null && _t !== void 0 ? _t : ''),
|
|
251
|
+
withdrawFrom: (0, editBillViewSelector_1.getWithdrawFrom)(state.paymentAccountState, state.depositAccountState, (_r = (_q = billPayload.bill_pay_info) === null || _q === void 0 ? void 0 : _q.from_account.account_id) !== null && _r !== void 0 ? _r : '', (_t = (_s = billPayload.bill_pay_info) === null || _s === void 0 ? void 0 : _s.from_account.account_type) !== null && _t !== void 0 ? _t : ''),
|
|
252
252
|
internationalTransferFeeBearerPaymentMethod: ((_u = billPayload.bill_pay_info) === null || _u === void 0 ? void 0 : _u.international_transfer_fee_bearer_payment_method) != null
|
|
253
253
|
? (0, billTransactionState_1.toInternationalTransferFeeBearerPaymentMethod)((_v = billPayload.bill_pay_info) === null || _v === void 0 ? void 0 : _v.international_transfer_fee_bearer_payment_method)
|
|
254
254
|
: undefined,
|
|
@@ -5,12 +5,6 @@ export interface ChargeCardConfigPayload {
|
|
|
5
5
|
allowed_credit_limit_span_options: AllowedValueWithCode[];
|
|
6
6
|
credit_terms: CreditTermsPayload;
|
|
7
7
|
repayment_info: RePaymentInfoPayload;
|
|
8
|
-
receipt_required_above_amount: {
|
|
9
|
-
amount: number;
|
|
10
|
-
currency_code: string;
|
|
11
|
-
currency_symbol: string;
|
|
12
|
-
};
|
|
13
|
-
receipt_bot_email: string;
|
|
14
8
|
is_ai_categorization_enabled_for_cards_transactions: boolean;
|
|
15
9
|
}
|
|
16
10
|
interface CreditTermsPayload {
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.clearChargeCardConfig = exports.updateChargeCardConfigFailure = exports.updateChargeCardConfig = exports.fetchChargeCardConfig = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const chargeCard_1 = require("../../../../entity/chargeCard/chargeCard");
|
|
7
|
-
const amount_1 = require("../../../../commonStateTypes/amount");
|
|
8
7
|
const chargeCardConfigPayload_1 = require("./chargeCardConfigPayload");
|
|
9
8
|
exports.initialState = {
|
|
10
9
|
creditLimitFrequency: [],
|
|
@@ -13,12 +12,6 @@ exports.initialState = {
|
|
|
13
12
|
name: '',
|
|
14
13
|
maxVirtualCard: 0,
|
|
15
14
|
},
|
|
16
|
-
receiptRequiredAboveAmount: {
|
|
17
|
-
amount: 0,
|
|
18
|
-
currencyCode: 'USD',
|
|
19
|
-
currencySymbol: '$',
|
|
20
|
-
},
|
|
21
|
-
receiptBotEmail: '',
|
|
22
15
|
isAiCategorizationEnabledForCardsTransactions: false,
|
|
23
16
|
rePaymentInfo: undefined,
|
|
24
17
|
fetchState: 'Not-Started',
|
|
@@ -44,8 +37,6 @@ const chargeCardConfig = (0, toolkit_1.createSlice)({
|
|
|
44
37
|
}));
|
|
45
38
|
draft.creditTerm = (0, chargeCardConfigPayload_1.toCreditTerm)(payload.credit_terms);
|
|
46
39
|
draft.rePaymentInfo = (0, chargeCardConfigPayload_1.toRePaymentInfo)(payload.repayment_info);
|
|
47
|
-
draft.receiptRequiredAboveAmount = (0, amount_1.toAmount)(payload.receipt_required_above_amount.amount, payload.receipt_required_above_amount.currency_code, payload.receipt_required_above_amount.currency_symbol);
|
|
48
|
-
draft.receiptBotEmail = payload.receipt_bot_email;
|
|
49
40
|
draft.isAiCategorizationEnabledForCardsTransactions =
|
|
50
41
|
payload.is_ai_categorization_enabled_for_cards_transactions;
|
|
51
42
|
draft.fetchState = 'Completed';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Amount } from '../../../../commonStateTypes/amount';
|
|
2
1
|
import { FetchedState, ID } from '../../../../commonStateTypes/common';
|
|
3
2
|
import { TimeframeTick } from '../../../../commonStateTypes/timeframeTick';
|
|
4
3
|
import { CreditLimitFrequency } from '../../../../entity/chargeCard/chargeCard';
|
|
@@ -6,8 +5,6 @@ import { ZeniDate } from '../../../../zeniDayJS';
|
|
|
6
5
|
export interface ChargeCardConfigState extends FetchedState {
|
|
7
6
|
creditLimitFrequency: CreditLimitFrequency[];
|
|
8
7
|
creditTerm: CreditTerm;
|
|
9
|
-
receiptRequiredAboveAmount: Amount;
|
|
10
|
-
receiptBotEmail: string;
|
|
11
8
|
isAiCategorizationEnabledForCardsTransactions: boolean;
|
|
12
9
|
rePaymentInfo?: RePaymentInfo;
|
|
13
10
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FetchedState, FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
2
2
|
import { SortOrder } from '../../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
3
|
import { PageToken } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
|
-
import { Attachment } from '../../../../entity/transaction/stateTypes/attachment';
|
|
5
4
|
export interface ChargeCardDetailState {
|
|
6
5
|
detailById: Record<ID, ChargeCardDetail>;
|
|
7
6
|
}
|
|
@@ -10,25 +9,16 @@ interface ChargeCardDetail extends FetchedState {
|
|
|
10
9
|
transactionList: ChargeCardDetailTransactionList;
|
|
11
10
|
updateStatus: FetchStateAndError;
|
|
12
11
|
}
|
|
13
|
-
export declare const toChargeCardTransactionSortKeyType: (v: string) => "type" | "amount" | "merchant" | "paymentDate" | "receipts";
|
|
14
|
-
export declare type ChargeCardTransactionSortKey = ReturnType<typeof toChargeCardTransactionSortKeyType>;
|
|
15
12
|
interface ChargeCardDetailTransactionList extends FetchStateAndError {
|
|
16
13
|
transactionIds: ID[];
|
|
17
|
-
uploadReceiptsFetchStateByTransactionId: Record<ID, FetchStateAndError>;
|
|
18
|
-
uploadReceiptsShowTickByTransactionId: Record<ID, boolean>;
|
|
19
|
-
transactionAttachmentsByTransactionId: Record<ID, TransactionAttachments>;
|
|
20
14
|
uiState: ChargeCardDetailUiState;
|
|
21
15
|
}
|
|
22
|
-
export interface TransactionAttachments extends FetchStateAndError {
|
|
23
|
-
attachments: Attachment[];
|
|
24
|
-
}
|
|
25
|
-
export declare const initialTransactionAttachments: TransactionAttachments;
|
|
26
16
|
export interface ChargeCardDetailUiState {
|
|
27
17
|
sortOrder: SortOrder;
|
|
28
18
|
pageToken: PageToken;
|
|
29
19
|
pageTokenType: PageToken;
|
|
30
20
|
scrollYOffset: number;
|
|
31
|
-
|
|
21
|
+
sortBy: string;
|
|
32
22
|
limit: number;
|
|
33
23
|
}
|
|
34
24
|
export declare const emptyChargeCardDetail: ChargeCardDetail;
|
|
@@ -1,34 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.emptyChargeCardDetail =
|
|
4
|
-
const stringToUnion_1 = require("../../../../commonStateTypes/stringToUnion");
|
|
5
|
-
const ALL_CHARGE_CARD_TRANSACTION_SORT_KEYS = [
|
|
6
|
-
'merchant',
|
|
7
|
-
'paymentDate',
|
|
8
|
-
'receipts',
|
|
9
|
-
'type',
|
|
10
|
-
'amount',
|
|
11
|
-
];
|
|
12
|
-
const toChargeCardTransactionSortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_CHARGE_CARD_TRANSACTION_SORT_KEYS);
|
|
13
|
-
exports.toChargeCardTransactionSortKeyType = toChargeCardTransactionSortKeyType;
|
|
14
|
-
exports.initialTransactionAttachments = {
|
|
15
|
-
attachments: [],
|
|
16
|
-
fetchState: 'Not-Started',
|
|
17
|
-
error: undefined,
|
|
18
|
-
};
|
|
3
|
+
exports.emptyChargeCardDetail = void 0;
|
|
19
4
|
exports.emptyChargeCardDetail = {
|
|
20
5
|
id: '',
|
|
21
6
|
fetchState: 'Not-Started',
|
|
22
7
|
transactionList: {
|
|
23
|
-
transactionAttachmentsByTransactionId: {},
|
|
24
|
-
uploadReceiptsFetchStateByTransactionId: {},
|
|
25
|
-
uploadReceiptsShowTickByTransactionId: {},
|
|
26
8
|
transactionIds: [],
|
|
27
9
|
fetchState: 'Not-Started',
|
|
28
10
|
error: undefined,
|
|
29
11
|
uiState: {
|
|
30
12
|
sortOrder: 'descending',
|
|
31
|
-
|
|
13
|
+
sortBy: 'transaction_date',
|
|
32
14
|
limit: 0,
|
|
33
15
|
pageToken: null,
|
|
34
16
|
scrollYOffset: 0,
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { ChargeCardPayload } from '../../../../entity/chargeCard/chargeCardPayload';
|
|
2
2
|
import { ChargeCardTransactionPayload } from '../../../../entity/chargeCardTransaction/chargeCardTransactionPayload';
|
|
3
|
-
import { AttachmentPayload } from '../../../../entity/transaction/payloadTypes/attachmentPayload';
|
|
4
3
|
import { UserPayload } from '../../../../entity/user/userPayload';
|
|
5
4
|
import { UserRolePayload } from '../../../../entity/userRole/userRolePayload';
|
|
6
5
|
import { ZeniAPIResponse } from '../../../../responsePayload';
|
|
7
|
-
interface ChargeCardTransactionAttachmentPayload {
|
|
8
|
-
attachments: AttachmentPayload[];
|
|
9
|
-
}
|
|
10
|
-
export declare type UpdateChargeCardTransactionAttachmentResponse = ZeniAPIResponse<ChargeCardTransactionAttachmentPayload>;
|
|
11
6
|
interface ChargeCardDetailPayload {
|
|
12
7
|
card: ChargeCardPayload;
|
|
13
8
|
users: UserPayload[];
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
2
2
|
import { FetchState, ID } from '../../../../commonStateTypes/common';
|
|
3
|
+
import { ChargeCardDetailState } from './chargeCardDetail';
|
|
3
4
|
import { PageToken } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
|
-
import { AttachmentPayload } from '../../../../entity/transaction/payloadTypes/attachmentPayload';
|
|
5
|
-
import { ChargeCardDetailState, ChargeCardDetailUiState } from './chargeCardDetail';
|
|
6
5
|
import { ChargeCardTransactionListPayload } from './chargeCardDetailPayload';
|
|
7
6
|
export declare const initialState: ChargeCardDetailState;
|
|
8
7
|
export declare const fetchChargeCardDetailPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[chargeCardId: string, cacheOverride?: any], {
|
|
@@ -19,33 +18,9 @@ export declare const fetchChargeCardDetailPage: import("@reduxjs/toolkit").Actio
|
|
|
19
18
|
chargeCardId: string;
|
|
20
19
|
pageToken: PageToken;
|
|
21
20
|
pageTokenType: PageToken;
|
|
22
|
-
}, string, never, never>,
|
|
23
|
-
chargeCardId: ID;
|
|
24
|
-
uiState: Partial<ChargeCardDetailUiState>;
|
|
25
|
-
}, string>, updateChargeCardTransactionList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
21
|
+
}, string, never, never>, updateChargeCardTransactionList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
26
22
|
chargeCardId: ID;
|
|
27
23
|
data: ChargeCardTransactionListPayload;
|
|
28
|
-
}, string>, updateChargeCardTransactionUploadReceiptsFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
29
|
-
transactionId: ID;
|
|
30
|
-
chargeCardId: ID;
|
|
31
|
-
fetchState: FetchState;
|
|
32
|
-
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
33
|
-
}, string>, fetchChargeCardTransactionAttachments: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cardId: string, transactionId: string, attachmentIds: string[]], {
|
|
34
|
-
cardId: string;
|
|
35
|
-
transactionId: string;
|
|
36
|
-
attachmentIds: string[];
|
|
37
|
-
}, string, never, never>, updateChargeCardTransactionAttachmentsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
38
|
-
cardId: ID;
|
|
39
|
-
transactionId: ID;
|
|
40
|
-
status: ZeniAPIStatus;
|
|
41
|
-
}, string>, updateChargeCardTransactionReceiptsShowTickFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
42
|
-
transactionId: ID;
|
|
43
|
-
chargeCardId: ID;
|
|
44
|
-
shouldShowTick: boolean;
|
|
45
|
-
}, string>, updateChargeCardTransactionAttachmentsInCardDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
46
|
-
cardId: ID;
|
|
47
|
-
transactionId: ID;
|
|
48
|
-
transactionAttachments: AttachmentPayload[];
|
|
49
24
|
}, string>, updateChargeCardTransactionListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
50
25
|
chargeCardId: ID;
|
|
51
26
|
error: ZeniAPIStatus;
|