@zeniai/client-epic-state 4.19.79 → 4.19.81-beta0ND
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/account/accountPayload.d.ts +2 -0
- package/lib/entity/account/accountPayload.js +2 -0
- package/lib/entity/account/accountState.d.ts +2 -0
- package/lib/entity/company/companyPayload.d.ts +13 -0
- package/lib/entity/company/companyPayload.js +21 -0
- package/lib/entity/company/companyStateTypes.d.ts +13 -0
- package/lib/esm/entity/account/accountPayload.js +2 -0
- package/lib/esm/entity/chargeCardTransaction/chargeCardTransactionPayload.js +2 -2
- package/lib/esm/entity/company/companyPayload.js +21 -0
- package/lib/esm/index.js +9 -7
- package/lib/esm/view/companyView/epic/companyPassport/updateCompanyDetailsEpic.js +6 -0
- package/lib/esm/view/companyView/types/companyPassport/companyPassportLocalData.js +13 -0
- package/lib/esm/view/companyView/types/companyPassportViewPayload.js +55 -12
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/triggerReviewTabRefetchEpic.js +2 -3
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +22 -0
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +20 -1
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +22 -4
- package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryDownloadSelector.js +2 -2
- package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistorySelector.js +2 -2
- package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailSelector.js +4 -1
- package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/fetchChargeCardRepaymentDetailEpic.js +2 -1
- package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/initiateChargeCardRepaymentEpic.js +1 -1
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +67 -1
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +16 -2
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +15 -1
- package/lib/esm/view/spendManagement/commonSetup/types/businessVerification.js +148 -1
- package/lib/index.d.ts +10 -7
- package/lib/index.js +54 -44
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/companyView/epic/companyPassport/updateCompanyDetailsEpic.js +6 -0
- package/lib/view/companyView/types/companyPassport/companyDetailsLocalData.d.ts +13 -0
- package/lib/view/companyView/types/companyPassport/companyPassportLocalData.js +13 -0
- package/lib/view/companyView/types/companyPassportViewPayload.d.ts +1 -1
- package/lib/view/companyView/types/companyPassportViewPayload.js +55 -12
- package/lib/view/expenseAutomationView/epics/transactionCategorization/triggerReviewTabRefetchEpic.js +2 -3
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +26 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +11 -3
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +21 -2
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +1 -0
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +1 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +22 -3
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryDownloadSelector.js +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistorySelector.js +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailSelector.js +4 -1
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/fetchChargeCardRepaymentDetailEpic.js +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/initiateChargeCardRepaymentEpic.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/initiateChargeCardRepaymentEpic.js +1 -1
- package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +67 -1
- package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +16 -2
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +14 -0
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +15 -1
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +14 -0
- package/lib/view/spendManagement/commonSetup/types/businessVerification.d.ts +43 -0
- package/lib/view/spendManagement/commonSetup/types/businessVerification.js +150 -0
- package/package.json +1 -1
|
@@ -15,6 +15,12 @@ const updateCompanyDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0
|
|
|
15
15
|
...(0, companyPassportViewPayload_1.toCompanyIncInfoUpdatableInfoPayload)(companyDetails.incInfo),
|
|
16
16
|
...(0, companyPassportViewPayload_1.toCompanyTaxInfoUpdatableInfoPayload)(companyDetails.taxDetails),
|
|
17
17
|
...(0, companyPassportViewPayload_1.toCompanyFileInfoPayload)(companyDetails.incInfo, companyDetails.taxDetails),
|
|
18
|
+
...(companyDetails.companyInfo.companyIndustryType != null && {
|
|
19
|
+
company_industry_type: companyDetails.companyInfo.companyIndustryType,
|
|
20
|
+
}),
|
|
21
|
+
...(companyDetails.companyInfo.companySubIndustry != null && {
|
|
22
|
+
company_industry_sub_type: companyDetails.companyInfo.companySubIndustry,
|
|
23
|
+
}),
|
|
18
24
|
};
|
|
19
25
|
const { newAddressState } = state$.value.addressViewState;
|
|
20
26
|
const addressToCreate = newAddressState?.company_address?.addressToCreate;
|
|
@@ -8,8 +8,21 @@ export interface CompanyInfoLocalData {
|
|
|
8
8
|
firstMonthOfFY: Month;
|
|
9
9
|
legalName: string;
|
|
10
10
|
phone: string;
|
|
11
|
+
companyIndustryType?: string;
|
|
12
|
+
companySourceOfFunds?: string;
|
|
13
|
+
companySourceOfFundsDescription?: string;
|
|
14
|
+
companySubIndustry?: string;
|
|
15
|
+
countriesOfOperations?: string[];
|
|
11
16
|
industry?: string;
|
|
12
17
|
meetingLink?: ZeniUrl;
|
|
18
|
+
purposeOfAccount?: string;
|
|
19
|
+
purposeOfAccountDescription?: string;
|
|
20
|
+
regulatedStatus?: string;
|
|
21
|
+
regulatedStatusDescription?: string;
|
|
22
|
+
transactionVolume?: string;
|
|
23
|
+
transactionVolumeDescription?: string;
|
|
24
|
+
usNexus?: string;
|
|
25
|
+
usNexusTypes?: string[];
|
|
13
26
|
website?: ZeniUrl;
|
|
14
27
|
}
|
|
15
28
|
export interface IncInfoLocalData {
|
|
@@ -13,9 +13,22 @@ function toCompanyPassportLocalData(companyView, companyFiles) {
|
|
|
13
13
|
website: companyInfo.companyUrl,
|
|
14
14
|
meetingLink: companyInfo.meetingUrl,
|
|
15
15
|
industry: companyQuestionaire.companyIndustry,
|
|
16
|
+
companyIndustryType: incInfo.companyIndustryType,
|
|
17
|
+
companySubIndustry: incInfo.companySubIndustry,
|
|
16
18
|
businessModel: companyQuestionaire.companyBusinessModel ?? '',
|
|
17
19
|
phone: companyInfo.phone ?? '',
|
|
18
20
|
firstMonthOfFY: companyInfo.firstMonthOfFY,
|
|
21
|
+
companySourceOfFunds: companyInfo.companySourceOfFunds,
|
|
22
|
+
companySourceOfFundsDescription: companyInfo.companySourceOfFundsDescription,
|
|
23
|
+
countriesOfOperations: companyInfo.countriesOfOperations,
|
|
24
|
+
transactionVolume: companyInfo.transactionVolume,
|
|
25
|
+
transactionVolumeDescription: companyInfo.transactionVolumeDescription,
|
|
26
|
+
purposeOfAccount: companyInfo.purposeOfAccount,
|
|
27
|
+
purposeOfAccountDescription: companyInfo.purposeOfAccountDescription,
|
|
28
|
+
regulatedStatus: companyInfo.regulatedStatus,
|
|
29
|
+
regulatedStatusDescription: companyInfo.regulatedStatusDescription,
|
|
30
|
+
usNexus: companyInfo.usNexus,
|
|
31
|
+
usNexusTypes: companyInfo.usNexusTypes,
|
|
19
32
|
},
|
|
20
33
|
incInfo: {
|
|
21
34
|
typeOfInc: incInfo.companyIncType ?? '',
|
|
@@ -2,7 +2,7 @@ import { ID } from '../../../commonStateTypes/common';
|
|
|
2
2
|
import { CompanyConfigInfoPayload, CompanyIncInfoPayload, CompanyInfoPayload, CompanyQuestionairePayload, CompanyTaxInfoPayload } from '../../../entity/company/companyPayload';
|
|
3
3
|
import { UserUpdatableInfo } from '../epic/companyPassport/updatePrimaryContactEpic';
|
|
4
4
|
import { CompanyInfoLocalData, IncInfoLocalData, TaxDetailsLocalData } from './companyPassport/companyDetailsLocalData';
|
|
5
|
-
interface CompanyInfoUpdatableInfoPayload extends Pick<CompanyInfoPayload, 'name' | 'company_url' | 'meeting_url' | 'company_legal_name' | 'phone'>, Pick<CompanyQuestionairePayload, 'company_industry' | 'company_business_model'>, Pick<CompanyConfigInfoPayload, 'is_new_company_industry_verified'> {
|
|
5
|
+
interface CompanyInfoUpdatableInfoPayload extends Pick<CompanyInfoPayload, 'name' | 'company_url' | 'meeting_url' | 'company_legal_name' | 'phone' | 'company_countries_of_operations' | 'company_source_of_funds' | 'company_source_of_funds_desc' | 'company_transaction_vol_expectations' | 'company_transaction_vol_expectations_desc' | 'company_purpose_of_account' | 'company_purpose_of_account_desc' | 'company_regulated_states' | 'company_regulated_states_desc' | 'company_us_nexus' | 'company_us_nexus_desc'>, Pick<CompanyQuestionairePayload, 'company_industry' | 'company_business_model'>, Pick<CompanyConfigInfoPayload, 'is_new_company_industry_verified'> {
|
|
6
6
|
}
|
|
7
7
|
type CompanyIncUpdatableInfoPayload = Pick<CompanyIncInfoPayload, 'company_inc_type' | 'company_inc_state' | 'company_inc_date'>;
|
|
8
8
|
type CompanyTaxUpdatableInfoPayload = Omit<CompanyTaxInfoPayload, 'taxes_filed_date' | 'taxes_due_date'>;
|
|
@@ -1,19 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.toUserUpdatableInfoPayload = exports.toCompanyFileInfoPayload = exports.toCompanyTaxInfoUpdatableInfoPayload = exports.toCompanyIncInfoUpdatableInfoPayload = exports.toCompanyUpdatableInfoPayload = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
company_business_model: info.businessModel,
|
|
11
|
-
company_url: info.website != null ? info.website.toString() : null,
|
|
12
|
-
meeting_url: info.meetingLink != null ? info.meetingLink.toString() : null,
|
|
13
|
-
is_new_company_industry_verified: true,
|
|
14
|
-
};
|
|
15
|
-
return payload;
|
|
4
|
+
/** Maps US nexus display label to API key (for company_us_nexus_desc) */
|
|
5
|
+
const US_NEXUS_LABEL_TO_KEY = {
|
|
6
|
+
Employees: 'employees',
|
|
7
|
+
Customers: 'customers',
|
|
8
|
+
'Physical office or facility': 'physical_office',
|
|
9
|
+
'Banking relationships': 'banking_relationships',
|
|
16
10
|
};
|
|
11
|
+
function toUsNexusTypeKey(value) {
|
|
12
|
+
const key = US_NEXUS_LABEL_TO_KEY[value];
|
|
13
|
+
return key ?? value;
|
|
14
|
+
}
|
|
15
|
+
const toCompanyUpdatableInfoPayload = (info) => ({
|
|
16
|
+
name: info.companyName,
|
|
17
|
+
company_legal_name: info.legalName,
|
|
18
|
+
phone: info.phone,
|
|
19
|
+
company_industry: info.industry,
|
|
20
|
+
company_business_model: info.businessModel,
|
|
21
|
+
company_url: info.website != null ? info.website.toString() : null,
|
|
22
|
+
meeting_url: info.meetingLink != null ? info.meetingLink.toString() : null,
|
|
23
|
+
is_new_company_industry_verified: true,
|
|
24
|
+
...(info.companySourceOfFunds != null && {
|
|
25
|
+
company_source_of_funds: info.companySourceOfFunds,
|
|
26
|
+
}),
|
|
27
|
+
...(info.companySourceOfFundsDescription != null && {
|
|
28
|
+
company_source_of_funds_desc: info.companySourceOfFundsDescription,
|
|
29
|
+
}),
|
|
30
|
+
...(info.countriesOfOperations != null &&
|
|
31
|
+
info.countriesOfOperations.length > 0 && {
|
|
32
|
+
company_countries_of_operations: info.countriesOfOperations,
|
|
33
|
+
}),
|
|
34
|
+
...(info.transactionVolume != null && {
|
|
35
|
+
company_transaction_vol_expectations: info.transactionVolume,
|
|
36
|
+
}),
|
|
37
|
+
...(info.transactionVolumeDescription != null && {
|
|
38
|
+
company_transaction_vol_expectations_desc: info.transactionVolumeDescription,
|
|
39
|
+
}),
|
|
40
|
+
...(info.purposeOfAccount != null && {
|
|
41
|
+
company_purpose_of_account: info.purposeOfAccount,
|
|
42
|
+
}),
|
|
43
|
+
...(info.purposeOfAccountDescription != null && {
|
|
44
|
+
company_purpose_of_account_desc: info.purposeOfAccountDescription,
|
|
45
|
+
}),
|
|
46
|
+
...(info.regulatedStatus != null && {
|
|
47
|
+
company_regulated_states: info.regulatedStatus === 'yes',
|
|
48
|
+
}),
|
|
49
|
+
...(info.regulatedStatusDescription != null && {
|
|
50
|
+
company_regulated_states_desc: info.regulatedStatusDescription,
|
|
51
|
+
}),
|
|
52
|
+
...(info.usNexus != null && {
|
|
53
|
+
company_us_nexus: info.usNexus === 'yes',
|
|
54
|
+
}),
|
|
55
|
+
...(info.usNexusTypes != null &&
|
|
56
|
+
info.usNexusTypes.length > 0 && {
|
|
57
|
+
company_us_nexus_desc: info.usNexusTypes.map(toUsNexusTypeKey),
|
|
58
|
+
}),
|
|
59
|
+
});
|
|
17
60
|
exports.toCompanyUpdatableInfoPayload = toCompanyUpdatableInfoPayload;
|
|
18
61
|
const toCompanyIncInfoUpdatableInfoPayload = (info) => {
|
|
19
62
|
const payload = {
|
|
@@ -7,15 +7,14 @@ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
|
|
|
7
7
|
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
8
8
|
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
9
9
|
const triggerReviewTabRefetchEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.syncTransactionCategorizationFromDetailSave.match), (0, operators_1.mergeMap)((action) => {
|
|
10
|
-
const { pendingReviewLineIds, transactionId, isUncategorizedExpenseCategoryEnabled } = action.payload;
|
|
10
|
+
const { pendingReviewLineIds, transactionId, isUncategorizedExpenseCategoryEnabled, } = action.payload;
|
|
11
11
|
if (pendingReviewLineIds.length === 0) {
|
|
12
12
|
return rxjs_1.EMPTY;
|
|
13
13
|
}
|
|
14
14
|
const state = state$.value;
|
|
15
15
|
// Only trigger when the transaction was auto-only (not in review tab after reducer ran)
|
|
16
16
|
const reviewLocalData = state.expenseAutomationTransactionsViewState
|
|
17
|
-
.transactionCategorizationView.review
|
|
18
|
-
.transactionReviewLocalDataById[transactionId.id];
|
|
17
|
+
.transactionCategorizationView.review.transactionReviewLocalDataById[transactionId.id];
|
|
19
18
|
if (reviewLocalData != null) {
|
|
20
19
|
return rxjs_1.EMPTY;
|
|
21
20
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { updateTransaction } from '../../../../entity/transaction/transactionReducer';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { fetchMonthEndCloseChecks } from '../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer';
|
|
5
|
+
import { uploadTransactionCategorizationReceiptSuccess } from '../../reducers/transactionsViewReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof uploadTransactionCategorizationReceiptSuccess> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof updateTransaction>;
|
|
7
|
+
export declare const uploadTransactionReceiptSuccessEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => import("rxjs").Observable<ActionType>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uploadTransactionReceiptSuccessEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
7
|
+
const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
|
|
8
|
+
const monthEndCloseChecksViewReducer_1 = require("../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer");
|
|
9
|
+
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
10
|
+
const uploadTransactionReceiptSuccessEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.uploadTransactionCategorizationReceiptSuccess.match), (0, operators_1.mergeMap)((action) => {
|
|
11
|
+
const { transactionPayload, updateType } = action.payload;
|
|
12
|
+
const updateActions = [];
|
|
13
|
+
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state$.value);
|
|
14
|
+
const selectedPeriodByTenantId = state$.value.expenseAutomationViewState.selectedPeriodByTenantId;
|
|
15
|
+
updateActions.push((0, transactionReducer_1.updateTransaction)(transactionPayload.transaction_id, transactionPayload, updateType));
|
|
16
|
+
if (currentTenant != null) {
|
|
17
|
+
const monthEndChecksPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
18
|
+
updateActions.push((0, monthEndCloseChecksViewReducer_1.fetchMonthEndCloseChecks)({
|
|
19
|
+
tenantId: currentTenant.tenantId,
|
|
20
|
+
period: monthEndChecksPeriod,
|
|
21
|
+
refreshViewInBackground: true,
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
return (0, rxjs_1.from)(updateActions);
|
|
25
|
+
}));
|
|
26
|
+
exports.uploadTransactionReceiptSuccessEpic = uploadTransactionReceiptSuccessEpic;
|
|
@@ -46,8 +46,8 @@ const filterAutoTabLineItems = (tabView, transactionId, updatedTransaction) => {
|
|
|
46
46
|
if (localData == null) {
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
const currentAutoLineIds = localData.transactionReviewLocalData.tabSpecificLineItems
|
|
50
|
-
|
|
49
|
+
const currentAutoLineIds = localData.transactionReviewLocalData.tabSpecificLineItems.autoCategorized ??
|
|
50
|
+
[];
|
|
51
51
|
const linesById = new Map(updatedTransaction.lines?.map((l) => [l.id, l]));
|
|
52
52
|
const retainedLineIds = currentAutoLineIds.filter((lineId) => {
|
|
53
53
|
const line = linesById.get(lineId);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FetchState, ID } from '../../../commonStateTypes/common';
|
|
1
|
+
import { FetchState, FetchStateAndError, ID, UpdateType } from '../../../commonStateTypes/common';
|
|
2
2
|
import { COTTransactionTrackingByTransactionId, RecommendationWithCOT } from '../../../commonStateTypes/recommendationBase';
|
|
3
3
|
import { MonthYearPeriod, TimePeriod } from '../../../commonStateTypes/timePeriod';
|
|
4
4
|
import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
@@ -7,7 +7,7 @@ import { ClassBase } from '../../../entity/class/classState';
|
|
|
7
7
|
import { CustomerBase } from '../../../entity/customer/customerState';
|
|
8
8
|
import { Entity } from '../../../entity/genericEntity/entity';
|
|
9
9
|
import { RecommendationWithCOTByLineId, TransactionID } from '../../../entity/transaction/stateTypes/transaction';
|
|
10
|
-
import { SupportedTransaction, SupportedTransactionWithCOT } from '../../../entity/transaction/transactionState';
|
|
10
|
+
import { SupportedTransaction, SupportedTransactionPayload, SupportedTransactionWithCOT } from '../../../entity/transaction/transactionState';
|
|
11
11
|
import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
12
12
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
13
13
|
import { UncategorizedAccounts } from '../../accountList/accountListSelector';
|
|
@@ -158,6 +158,14 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
158
158
|
}, "expenseAutomationTransactionsView/syncTransactionCategorizationFromDetailSave", never, never>, backgroundRefetchReviewTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
159
159
|
period: TimePeriod;
|
|
160
160
|
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
161
|
-
}, "expenseAutomationTransactionsView/backgroundRefetchReviewTab", never, never
|
|
161
|
+
}, "expenseAutomationTransactionsView/backgroundRefetchReviewTab", never, never>, updateTransactionCategorizationUploadReceiptState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: string, fetchStatus: FetchStateAndError], {
|
|
162
|
+
selectedTab: "review" | "autoCategorized";
|
|
163
|
+
transactionId: string;
|
|
164
|
+
fetchStatus: FetchStateAndError;
|
|
165
|
+
}, "expenseAutomationTransactionsView/updateTransactionCategorizationUploadReceiptState", never, never>, uploadTransactionCategorizationReceiptSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionPayload: SupportedTransactionPayload, updateType?: UpdateType | undefined], {
|
|
166
|
+
selectedTab: "review" | "autoCategorized";
|
|
167
|
+
transactionPayload: SupportedTransactionPayload;
|
|
168
|
+
updateType: UpdateType;
|
|
169
|
+
}, "expenseAutomationTransactionsView/uploadTransactionCategorizationReceiptSuccess", never, never>;
|
|
162
170
|
declare const _default: import("redux").Reducer<TransactionsViewState>;
|
|
163
171
|
export default _default;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.backgroundRefetchReviewTab = exports.syncTransactionCategorizationFromDetailSave = exports.updateSelectedTransactionId = exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.resetOtherTabsFetchState = exports.fetchTransactionCategorizationSuccess = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedCustomerForTransaction = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateCurrentSelectedTransactionCategorizationTab = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorization = exports.initialState = exports.initialTransactionTabViewState = void 0;
|
|
7
|
+
exports.uploadTransactionCategorizationReceiptSuccess = exports.updateTransactionCategorizationUploadReceiptState = exports.backgroundRefetchReviewTab = exports.syncTransactionCategorizationFromDetailSave = exports.updateSelectedTransactionId = exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.resetOtherTabsFetchState = exports.fetchTransactionCategorizationSuccess = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedCustomerForTransaction = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateCurrentSelectedTransactionCategorizationTab = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorization = exports.initialState = exports.initialTransactionTabViewState = void 0;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
10
10
|
const uniq_1 = __importDefault(require("lodash/uniq"));
|
|
@@ -43,6 +43,7 @@ exports.initialTransactionTabViewState = {
|
|
|
43
43
|
transactionIdsBySelectedPeriod: {},
|
|
44
44
|
selectedCheckBoxTransactionIds: [],
|
|
45
45
|
transactionIdsWithUnsavedData: [],
|
|
46
|
+
uploadReceiptStatusById: {},
|
|
46
47
|
selectedTransactionId: undefined,
|
|
47
48
|
selectedTransactionLineId: undefined,
|
|
48
49
|
};
|
|
@@ -706,6 +707,24 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
706
707
|
clearExpenseAutomationTransactionsView(draft) {
|
|
707
708
|
Object.assign(draft, exports.initialState);
|
|
708
709
|
},
|
|
710
|
+
updateTransactionCategorizationUploadReceiptState: {
|
|
711
|
+
reducer(draft, action) {
|
|
712
|
+
const { transactionId, fetchStatus, selectedTab } = action.payload;
|
|
713
|
+
draft.transactionCategorizationView[selectedTab].uploadReceiptStatusById[transactionId] = fetchStatus;
|
|
714
|
+
},
|
|
715
|
+
prepare(selectedTab, transactionId, fetchStatus) {
|
|
716
|
+
return { payload: { selectedTab, transactionId, fetchStatus } };
|
|
717
|
+
},
|
|
718
|
+
},
|
|
719
|
+
uploadTransactionCategorizationReceiptSuccess: {
|
|
720
|
+
reducer(draft, action) {
|
|
721
|
+
const { transactionPayload, selectedTab } = action.payload;
|
|
722
|
+
draft.transactionCategorizationView[selectedTab].uploadReceiptStatusById[transactionPayload.transaction_id] = { fetchState: 'Completed', error: undefined };
|
|
723
|
+
},
|
|
724
|
+
prepare(selectedTab, transactionPayload, updateType = 'merge') {
|
|
725
|
+
return { payload: { selectedTab, transactionPayload, updateType } };
|
|
726
|
+
},
|
|
727
|
+
},
|
|
709
728
|
syncTransactionCategorizationFromDetailSave: {
|
|
710
729
|
prepare(transactionId, updatedTransaction, pendingReviewLineIds, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled) {
|
|
711
730
|
return {
|
|
@@ -777,5 +796,5 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
777
796
|
},
|
|
778
797
|
},
|
|
779
798
|
});
|
|
780
|
-
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = _a.updateStatusForTransactionNotMiscategorizedUpdateForCategorization, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.updateSelectedCustomerForTransaction = _a.updateSelectedCustomerForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.resetOtherTabsFetchState = _a.resetOtherTabsFetchState, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization, exports.updateSelectedTransactionId = _a.updateSelectedTransactionId, exports.syncTransactionCategorizationFromDetailSave = _a.syncTransactionCategorizationFromDetailSave, exports.backgroundRefetchReviewTab = _a.backgroundRefetchReviewTab;
|
|
799
|
+
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = _a.updateStatusForTransactionNotMiscategorizedUpdateForCategorization, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.updateSelectedCustomerForTransaction = _a.updateSelectedCustomerForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.resetOtherTabsFetchState = _a.resetOtherTabsFetchState, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization, exports.updateSelectedTransactionId = _a.updateSelectedTransactionId, exports.syncTransactionCategorizationFromDetailSave = _a.syncTransactionCategorizationFromDetailSave, exports.backgroundRefetchReviewTab = _a.backgroundRefetchReviewTab, exports.updateTransactionCategorizationUploadReceiptState = _a.updateTransactionCategorizationUploadReceiptState, exports.uploadTransactionCategorizationReceiptSuccess = _a.uploadTransactionCategorizationReceiptSuccess;
|
|
781
800
|
exports.default = expenseAutomationTransactionsView.reducer;
|
|
@@ -28,6 +28,7 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
|
|
|
28
28
|
transactions: SupportedTransactionWithCOT[];
|
|
29
29
|
uiState: TransactionsViewUIState;
|
|
30
30
|
uncategorizedAccounts: UncategorizedAccounts;
|
|
31
|
+
uploadReceiptStatusById: Record<ID, FetchStateAndError>;
|
|
31
32
|
selectedTransactionId?: ID;
|
|
32
33
|
selectedTransactionLineId?: ID;
|
|
33
34
|
}
|
|
@@ -16,7 +16,7 @@ const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAu
|
|
|
16
16
|
function getExpenseAutomationTransactionView(state) {
|
|
17
17
|
const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
|
|
18
18
|
const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
|
|
19
|
-
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
19
|
+
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
20
20
|
const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
|
|
21
21
|
const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
|
|
22
22
|
const classList = (0, classListSelector_1.getClassList)(classState, classListState);
|
|
@@ -100,6 +100,7 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
100
100
|
completionStatus,
|
|
101
101
|
totalCountByTab,
|
|
102
102
|
fetchStateByTransactionTabs: fetchStateByTab,
|
|
103
|
+
uploadReceiptStatusById,
|
|
103
104
|
selectedTransactionId,
|
|
104
105
|
selectedTransactionLineId,
|
|
105
106
|
};
|
|
@@ -97,6 +97,7 @@ export interface TransactionsTabViewState extends FetchedState {
|
|
|
97
97
|
transactionIdsWithUnsavedData: ID[];
|
|
98
98
|
transactionReviewLocalDataById: Record<ID | TransactionDetailKey, SupportedTransactionCategorization>;
|
|
99
99
|
uiState: TransactionsViewUIState;
|
|
100
|
+
uploadReceiptStatusById: Record<ID, FetchStateAndError>;
|
|
100
101
|
selectedTransactionId?: ID;
|
|
101
102
|
selectedTransactionLineId?: ID;
|
|
102
103
|
}
|
|
@@ -53,4 +53,5 @@ export declare const onboardingStepsData: (isValidConnection: boolean, productSe
|
|
|
53
53
|
allStepsData: OnboardingStep[];
|
|
54
54
|
requiredStepsData: OnboardingStep[];
|
|
55
55
|
};
|
|
56
|
+
export declare function isCompanyDetailsSavePending(fileState: FileState, company?: CompanyView, primaryContact?: User, companyDetailsLocalData?: CompanyDetails): boolean;
|
|
56
57
|
export declare const getProductSettingsString: (productSettings: TenantProductSettings | undefined) => string;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getProductSettingsString = exports.onboardingStepsData = void 0;
|
|
4
4
|
exports.getOnboardingCustomerView = getOnboardingCustomerView;
|
|
5
5
|
exports.isOfficerDetailsCompleted = isOfficerDetailsCompleted;
|
|
6
|
+
exports.isCompanyDetailsSavePending = isCompanyDetailsSavePending;
|
|
6
7
|
const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
|
|
7
8
|
const fileSelector_1 = require("../../../entity/file/fileSelector");
|
|
8
9
|
const paymentAccountSelector_1 = require("../../../entity/paymentAccount/paymentAccountSelector");
|
|
@@ -229,12 +230,12 @@ function isCompanyDetailsSavePending(fileState, company, primaryContact, company
|
|
|
229
230
|
return false;
|
|
230
231
|
}
|
|
231
232
|
const { companyInfo, incInfo, taxInfo, questionaire } = company.company.company;
|
|
232
|
-
const { companyDescription, companyLegalName, companyUrl, phone } = companyInfo;
|
|
233
|
-
const { fileIds, companyIncDate: incDate, companyIncType } = incInfo;
|
|
233
|
+
const { companyDescription, companyLegalName, companyUrl, phone, companySourceOfFunds, companySourceOfFundsDescription, countriesOfOperations, transactionVolume, transactionVolumeDescription, purposeOfAccount, purposeOfAccountDescription, regulatedStatus, regulatedStatusDescription, usNexus, usNexusTypes, } = companyInfo;
|
|
234
|
+
const { fileIds, companyIncDate: incDate, companyIncState, companyIncType, companySubIndustry, } = incInfo;
|
|
234
235
|
const { companyIndustry } = questionaire;
|
|
235
236
|
const { taxId } = taxInfo;
|
|
236
237
|
const companyFileIds = (0, fileSelector_1.getFilesByFileIds)(fileState, fileIds).map((file) => file.fileId);
|
|
237
|
-
const { companyDescription: companyDescriptionLocalData, companyIndustry: companyIndustryLocalData, companyLegalName: companyLegalNameLocalData, taxIdOrEIN: taxIdLocalData, incDate: incDateLocalData, phone: companyPhoneLocalData, website: companyUrlLocalData, companyFiles: companyFilesLocalData, typeOfIncorporation: companyIncTypeLocalData, primaryContactLocalData, } = companyDetailsLocalData;
|
|
238
|
+
const { companyDescription: companyDescriptionLocalData, companyIndustry: companyIndustryLocalData, companyLegalName: companyLegalNameLocalData, taxIdOrEIN: taxIdLocalData, incDate: incDateLocalData, phone: companyPhoneLocalData, website: companyUrlLocalData, companyFiles: companyFilesLocalData, stateOfIncorporation: stateOfIncorporationLocalData, typeOfIncorporation: companyIncTypeLocalData, companySourceOfFunds: companySourceOfFundsLocalData, companySourceOfFundsDescription: companySourceOfFundsDescriptionLocalData, countriesOfOperations: countriesOfOperationsLocalData, companySubIndustry: companySubIndustryLocalData, transactionVolume: transactionVolumeLocalData, transactionVolumeDescription: transactionVolumeDescriptionLocalData, purposeOfAccount: purposeOfAccountLocalData, purposeOfAccountDescription: purposeOfAccountDescriptionLocalData, regulatedStatus: regulatedStatusLocalData, regulatedStatusDescription: regulatedStatusDescriptionLocalData, usNexus: usNexusLocalData, usNexusTypes: usNexusTypesLocalData, primaryContactLocalData, } = companyDetailsLocalData;
|
|
238
239
|
const fileIdsLocalData = companyFilesLocalData.map((file) => file.fileId);
|
|
239
240
|
if (primaryContact != null) {
|
|
240
241
|
const { firstName, lastName, email } = primaryContact;
|
|
@@ -244,6 +245,10 @@ function isCompanyDetailsSavePending(fileState, company, primaryContact, company
|
|
|
244
245
|
return true;
|
|
245
246
|
}
|
|
246
247
|
}
|
|
248
|
+
const countriesOfOperationsMatch = JSON.stringify(countriesOfOperations ?? []) ===
|
|
249
|
+
JSON.stringify(countriesOfOperationsLocalData ?? []);
|
|
250
|
+
const usNexusTypesMatch = JSON.stringify(usNexusTypes ?? []) ===
|
|
251
|
+
JSON.stringify(usNexusTypesLocalData ?? []);
|
|
247
252
|
return (companyDescription != companyDescriptionLocalData ||
|
|
248
253
|
companyIndustry != companyIndustryLocalData ||
|
|
249
254
|
companyLegalName != companyLegalNameLocalData ||
|
|
@@ -251,7 +256,21 @@ function isCompanyDetailsSavePending(fileState, company, primaryContact, company
|
|
|
251
256
|
incDate?.toString() != incDateLocalData?.toString() ||
|
|
252
257
|
phone != companyPhoneLocalData ||
|
|
253
258
|
companyUrl?.toString() != companyUrlLocalData?.toString() ||
|
|
259
|
+
companyIncState != stateOfIncorporationLocalData ||
|
|
260
|
+
companySourceOfFunds != companySourceOfFundsLocalData ||
|
|
261
|
+
companySourceOfFundsDescription !=
|
|
262
|
+
companySourceOfFundsDescriptionLocalData ||
|
|
263
|
+
!countriesOfOperationsMatch ||
|
|
254
264
|
companyIncType != companyIncTypeLocalData ||
|
|
265
|
+
transactionVolume != transactionVolumeLocalData ||
|
|
266
|
+
transactionVolumeDescription != transactionVolumeDescriptionLocalData ||
|
|
267
|
+
purposeOfAccount != purposeOfAccountLocalData ||
|
|
268
|
+
purposeOfAccountDescription != purposeOfAccountDescriptionLocalData ||
|
|
269
|
+
regulatedStatus != regulatedStatusLocalData ||
|
|
270
|
+
regulatedStatusDescription != regulatedStatusDescriptionLocalData ||
|
|
271
|
+
usNexus != usNexusLocalData ||
|
|
272
|
+
!usNexusTypesMatch ||
|
|
273
|
+
companySubIndustry != companySubIndustryLocalData ||
|
|
255
274
|
!(fileIdsLocalData.length === companyFileIds.length &&
|
|
256
275
|
companyFileIds.every((fileId) => fileIdsLocalData.includes(fileId))));
|
|
257
276
|
}
|
|
@@ -5,8 +5,8 @@ const chargeCardRepaymentSelector_1 = require("../../../../entity/chargeCardRepa
|
|
|
5
5
|
const userSelector_1 = require("../../../../entity/user/userSelector");
|
|
6
6
|
const chargeCardPaymentHistoryHelpers_1 = require("./chargeCardPaymentHistoryHelpers");
|
|
7
7
|
const getChargeCardPaymentHistoryDownloadReport = (state) => {
|
|
8
|
-
const { chargeCardPaymentHistoryState, chargeCardRepaymentState, userState
|
|
9
|
-
const { filters, repaymentHistoryIds, searchText, uiState, fetchState, error
|
|
8
|
+
const { chargeCardPaymentHistoryState, chargeCardRepaymentState, userState } = state;
|
|
9
|
+
const { filters, repaymentHistoryIds, searchText, uiState, fetchState, error } = chargeCardPaymentHistoryState;
|
|
10
10
|
const repaymentHistory = (0, chargeCardRepaymentSelector_1.getChargeCardRepaymentByIds)(chargeCardRepaymentState, repaymentHistoryIds);
|
|
11
11
|
const repaymentHistoryUserIds = Array.from(new Set(repaymentHistory.map((r) => r.paidById)));
|
|
12
12
|
const repaymentHistoryUsers = (0, userSelector_1.getUsersByUserIds)(userState, repaymentHistoryUserIds);
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getChargeCardPaymentHistoryView = void 0;
|
|
4
4
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
5
5
|
const chargeCardRepaymentSelector_1 = require("../../../../entity/chargeCardRepayment/chargeCardRepaymentSelector");
|
|
6
|
-
const userSelector_1 = require("../../../../entity/user/userSelector");
|
|
7
|
-
const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
8
6
|
const depositAccountSelector_1 = require("../../../../entity/depositAccount/depositAccountSelector");
|
|
9
7
|
const paymentAccountSelector_1 = require("../../../../entity/paymentAccount/paymentAccountSelector");
|
|
8
|
+
const userSelector_1 = require("../../../../entity/user/userSelector");
|
|
9
|
+
const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
10
10
|
const depositAccountListSelector_1 = require("../../zeniAccounts/depositAccountList/depositAccountListSelector");
|
|
11
11
|
const paymentAccountListSelector_1 = require("../../zeniAccounts/paymentAccountList/paymentAccountListSelector");
|
|
12
12
|
const chargeCardPaymentHistoryHelpers_1 = require("./chargeCardPaymentHistoryHelpers");
|
|
@@ -18,7 +18,10 @@ const getChargeCardRepaymentDetail = (state) => {
|
|
|
18
18
|
else {
|
|
19
19
|
const depositFundingFromLimit = Object.values(depositAccountState.depositAccountLimitForChargeCardByID ?? {}).map(setupViewSelector_1.mapDepositAccountWithLimitToFundingAccount);
|
|
20
20
|
const paymentFundingAccounts = (0, setupViewSelector_1.getAllFundingAccounts)([], paymentAccountsView.paymentAccounts, paymentAccountListState.paymentAccountBalanceFetchStatus);
|
|
21
|
-
transferFromAccounts = [
|
|
21
|
+
transferFromAccounts = [
|
|
22
|
+
...depositFundingFromLimit,
|
|
23
|
+
...paymentFundingAccounts,
|
|
24
|
+
];
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
27
|
const reducedFetchState = (0, reduceFetchState_1.reduceAnyCompletedFetchState)([
|
|
@@ -10,7 +10,8 @@ const fetchChargeCardRepaymentDetailEpic = (actions$, state$) => actions$.pipe((
|
|
|
10
10
|
const fetchChargeCardRepaymentDetailActions = [];
|
|
11
11
|
const state = state$.value;
|
|
12
12
|
const depositAccounts = state.depositAccountListState;
|
|
13
|
-
const willFetchDeposit = depositAccounts.fetchState !== 'In-Progress' &&
|
|
13
|
+
const willFetchDeposit = depositAccounts.fetchState !== 'In-Progress' &&
|
|
14
|
+
depositAccounts.fetchState !== 'Completed';
|
|
14
15
|
if (willFetchDeposit) {
|
|
15
16
|
fetchChargeCardRepaymentDetailActions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
|
|
16
17
|
}
|
|
@@ -4,8 +4,8 @@ import { updateChargeCardRepayment } from '../../../../entity/chargeCardRepaymen
|
|
|
4
4
|
import { updateCompanyPrimaryAccount, updateEnableAutoPayForChargeCard } from '../../../../entity/company/companyReducer';
|
|
5
5
|
import { RootState } from '../../../../reducer';
|
|
6
6
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
7
|
-
import { addRepaymentToChargeCardPaymentHistory } from '../chargeCardPaymentHistory/chargeCardPaymentHistoryReducer';
|
|
8
7
|
import { updateCreditAccountRepaymentAmountAndDate } from '../chargeCardList/chargeCardListReducer';
|
|
8
|
+
import { addRepaymentToChargeCardPaymentHistory } from '../chargeCardPaymentHistory/chargeCardPaymentHistoryReducer';
|
|
9
9
|
import { initiateChargeCardRepayment, updateChargeCardRepaymentStatus } from './chargeCardRepaymentDetailReducer';
|
|
10
10
|
export type ActionType = ReturnType<typeof addRepaymentToChargeCardPaymentHistory> | ReturnType<typeof initiateChargeCardRepayment> | ReturnType<typeof updateChargeCardRepayment> | ReturnType<typeof updateCreditAccountRepaymentAmountAndDate> | ReturnType<typeof updateChargeCardRepaymentStatus> | ReturnType<typeof updateCompanyPrimaryAccount> | ReturnType<typeof updateEnableAutoPayForChargeCard>;
|
|
11
11
|
export declare const initiateChargeCardRepaymentEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -12,8 +12,8 @@ const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
|
|
|
12
12
|
const helpers_1 = require("../../helpers");
|
|
13
13
|
const depositAccountListSelector_1 = require("../../zeniAccounts/depositAccountList/depositAccountListSelector");
|
|
14
14
|
const paymentAccountListSelector_1 = require("../../zeniAccounts/paymentAccountList/paymentAccountListSelector");
|
|
15
|
-
const chargeCardPaymentHistoryReducer_1 = require("../chargeCardPaymentHistory/chargeCardPaymentHistoryReducer");
|
|
16
15
|
const chargeCardListReducer_1 = require("../chargeCardList/chargeCardListReducer");
|
|
16
|
+
const chargeCardPaymentHistoryReducer_1 = require("../chargeCardPaymentHistory/chargeCardPaymentHistoryReducer");
|
|
17
17
|
const chargeCardRepaymentDetailReducer_1 = require("./chargeCardRepaymentDetailReducer");
|
|
18
18
|
const initiateChargeCardRepaymentEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardRepaymentDetailReducer_1.initiateChargeCardRepayment.match), (0, operators_1.switchMap)((action) => {
|
|
19
19
|
const state = state$.value;
|
package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js
CHANGED
|
@@ -122,8 +122,28 @@ const updateBusinessVerificationDetailsEpic = (actions$, state$, zeniAPI) => act
|
|
|
122
122
|
}
|
|
123
123
|
}));
|
|
124
124
|
exports.updateBusinessVerificationDetailsEpic = updateBusinessVerificationDetailsEpic;
|
|
125
|
+
/** US Nexus API keys. Form may submit these or display labels; we send keys to API. */
|
|
126
|
+
const US_NEXUS_KEYS = new Set([
|
|
127
|
+
'employees',
|
|
128
|
+
'customers',
|
|
129
|
+
'physical_office',
|
|
130
|
+
'banking_relationships',
|
|
131
|
+
]);
|
|
132
|
+
/** Maps display label → API key for US nexus types (English labels from strings). */
|
|
133
|
+
const US_NEXUS_LABEL_TO_KEY = {
|
|
134
|
+
Employees: 'employees',
|
|
135
|
+
Customers: 'customers',
|
|
136
|
+
'Physical office or facility': 'physical_office',
|
|
137
|
+
'Banking relationships': 'banking_relationships',
|
|
138
|
+
};
|
|
139
|
+
function toUsNexusTypeKey(value) {
|
|
140
|
+
if (US_NEXUS_KEYS.has(value)) {
|
|
141
|
+
return value;
|
|
142
|
+
}
|
|
143
|
+
return US_NEXUS_LABEL_TO_KEY[value] ?? value;
|
|
144
|
+
}
|
|
125
145
|
const toBusinessVerificationCompanyDataPayload = (companyLocalData, sendForVerification, companyAddressData, registeredAddressData, setupViewType) => {
|
|
126
|
-
const { companyDescription, companyLegalName, companyIndustry, website, incDate, taxIdOrEIN, phone, syncToken, fileIds, typeOfIncorporation, sourceOfFunds, } = companyLocalData;
|
|
146
|
+
const { companyDescription, companyLegalName, companyIndustry, companyIndustryType, companySubIndustry, countriesOfOperations, companySourceOfFunds, companySourceOfFundsDescription, transactionVolume, transactionVolumeDescription, purposeOfAccount, purposeOfAccountDescription, regulatedStatus, regulatedStatusDescription, usNexus, usNexusTypes, website, incDate, taxIdOrEIN, phone, syncToken, fileIds, typeOfIncorporation, stateOfIncorporation, sourceOfFunds, } = companyLocalData;
|
|
127
147
|
const company = {
|
|
128
148
|
is_ready_for_verification: sendForVerification,
|
|
129
149
|
file_ids: fileIds,
|
|
@@ -174,9 +194,55 @@ const toBusinessVerificationCompanyDataPayload = (companyLocalData, sendForVerif
|
|
|
174
194
|
if (typeOfIncorporation != null) {
|
|
175
195
|
company['company_inc_type'] = typeOfIncorporation;
|
|
176
196
|
}
|
|
197
|
+
if (stateOfIncorporation != null) {
|
|
198
|
+
company['company_inc_state'] = stateOfIncorporation;
|
|
199
|
+
}
|
|
177
200
|
if (companyIndustry != null) {
|
|
178
201
|
company['company_industry'] = companyIndustry;
|
|
179
202
|
}
|
|
203
|
+
Object.assign(company, {
|
|
204
|
+
...(companyIndustryType != null && {
|
|
205
|
+
company_industry_type: companyIndustryType,
|
|
206
|
+
}),
|
|
207
|
+
...(companySubIndustry != null && {
|
|
208
|
+
company_industry_sub_type: companySubIndustry,
|
|
209
|
+
}),
|
|
210
|
+
...(countriesOfOperations != null &&
|
|
211
|
+
countriesOfOperations.length > 0 && {
|
|
212
|
+
company_countries_of_operations: countriesOfOperations,
|
|
213
|
+
}),
|
|
214
|
+
...(companySourceOfFunds != null && {
|
|
215
|
+
company_source_of_funds: companySourceOfFunds,
|
|
216
|
+
}),
|
|
217
|
+
...(companySourceOfFundsDescription != null && {
|
|
218
|
+
company_source_of_funds_desc: companySourceOfFundsDescription,
|
|
219
|
+
}),
|
|
220
|
+
...(transactionVolume != null && {
|
|
221
|
+
company_transaction_vol_expectations: transactionVolume,
|
|
222
|
+
}),
|
|
223
|
+
...(transactionVolumeDescription != null && {
|
|
224
|
+
company_transaction_vol_expectations_desc: transactionVolumeDescription,
|
|
225
|
+
}),
|
|
226
|
+
...(purposeOfAccount != null && {
|
|
227
|
+
company_purpose_of_account: purposeOfAccount,
|
|
228
|
+
}),
|
|
229
|
+
...(purposeOfAccountDescription != null && {
|
|
230
|
+
company_purpose_of_account_desc: purposeOfAccountDescription,
|
|
231
|
+
}),
|
|
232
|
+
...(regulatedStatus != null && {
|
|
233
|
+
company_regulated_states: regulatedStatus === 'yes',
|
|
234
|
+
}),
|
|
235
|
+
...(regulatedStatusDescription != null && {
|
|
236
|
+
company_regulated_states_desc: regulatedStatusDescription,
|
|
237
|
+
}),
|
|
238
|
+
...(usNexus != null && {
|
|
239
|
+
company_us_nexus: usNexus === 'yes',
|
|
240
|
+
}),
|
|
241
|
+
...(usNexusTypes != null &&
|
|
242
|
+
usNexusTypes.length > 0 && {
|
|
243
|
+
company_us_nexus_desc: usNexusTypes.map(toUsNexusTypeKey),
|
|
244
|
+
}),
|
|
245
|
+
});
|
|
180
246
|
if (setupViewType === 'zeni_treasury' && sourceOfFunds != null) {
|
|
181
247
|
company['source_of_funds'] = sourceOfFunds;
|
|
182
248
|
}
|
package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js
CHANGED
|
@@ -51,16 +51,21 @@ exports.updateSetupViewLocalStoreDataEpic = updateSetupViewLocalStoreDataEpic;
|
|
|
51
51
|
*/
|
|
52
52
|
function toSetupViewLocalData(company, users, userRoles, primaryContact) {
|
|
53
53
|
const { companyInfo, incInfo, taxInfo, questionaire, companyBillPayInfo } = company;
|
|
54
|
-
const { companyId, companyDescription, companyLegalName, companyUrl, phone, syncToken, sourceOfFunds, } = companyInfo;
|
|
54
|
+
const { companyId, companyDescription, companyLegalName, companyUrl, phone, syncToken, sourceOfFunds, companySourceOfFunds: incCompanySourceOfFunds, companySourceOfFundsDescription, countriesOfOperations, transactionVolume, transactionVolumeDescription, purposeOfAccount, purposeOfAccountDescription, regulatedStatus, regulatedStatusDescription, usNexus, usNexusTypes, } = companyInfo;
|
|
55
55
|
const { usersSelectedForVerification: usersSelected } = companyBillPayInfo;
|
|
56
|
-
const { fileIds, companyIncDate: incDate, companyIncType } = incInfo;
|
|
56
|
+
const { fileIds, companyIncDate: incDate, companyIncType, companyIncState, companySubIndustry, companyIndustryType, } = incInfo;
|
|
57
57
|
const { companyIndustry } = questionaire;
|
|
58
58
|
const { taxId } = taxInfo;
|
|
59
59
|
const companyDetails = {
|
|
60
60
|
companyId,
|
|
61
61
|
companyDescription,
|
|
62
62
|
companyIndustry,
|
|
63
|
+
companyIndustryType,
|
|
63
64
|
companyLegalName,
|
|
65
|
+
companySubIndustry,
|
|
66
|
+
companySourceOfFunds: incCompanySourceOfFunds,
|
|
67
|
+
companySourceOfFundsDescription,
|
|
68
|
+
countriesOfOperations,
|
|
64
69
|
taxIdOrEIN: taxId,
|
|
65
70
|
incDate,
|
|
66
71
|
phone,
|
|
@@ -69,6 +74,15 @@ function toSetupViewLocalData(company, users, userRoles, primaryContact) {
|
|
|
69
74
|
syncToken,
|
|
70
75
|
typeOfIncorporation: companyIncType,
|
|
71
76
|
sourceOfFunds,
|
|
77
|
+
stateOfIncorporation: companyIncState,
|
|
78
|
+
transactionVolume,
|
|
79
|
+
transactionVolumeDescription,
|
|
80
|
+
purposeOfAccount,
|
|
81
|
+
purposeOfAccountDescription,
|
|
82
|
+
regulatedStatus,
|
|
83
|
+
regulatedStatusDescription,
|
|
84
|
+
usNexus,
|
|
85
|
+
usNexusTypes,
|
|
72
86
|
};
|
|
73
87
|
let primaryContactDetails = undefined;
|
|
74
88
|
if (primaryContact != null) {
|