@zeniai/client-epic-state 4.19.82 → 4.19.83

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.
Files changed (49) hide show
  1. package/lib/entity/company/companyPayload.d.ts +0 -13
  2. package/lib/entity/company/companyPayload.js +0 -21
  3. package/lib/entity/company/companyStateTypes.d.ts +0 -13
  4. package/lib/esm/entity/chargeCardTransaction/chargeCardTransactionPayload.js +2 -2
  5. package/lib/esm/entity/company/companyPayload.js +0 -21
  6. package/lib/esm/index.js +5 -7
  7. package/lib/esm/view/companyView/epic/companyPassport/updateCompanyDetailsEpic.js +0 -6
  8. package/lib/esm/view/companyView/types/companyPassport/companyPassportLocalData.js +0 -13
  9. package/lib/esm/view/companyView/types/companyPassportViewPayload.js +12 -55
  10. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/triggerReviewTabRefetchEpic.js +3 -2
  11. package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  12. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +4 -22
  13. package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryDownloadSelector.js +2 -2
  14. package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistorySelector.js +2 -2
  15. package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailSelector.js +1 -4
  16. package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/fetchChargeCardRepaymentDetailEpic.js +1 -2
  17. package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/initiateChargeCardRepaymentEpic.js +1 -1
  18. package/lib/esm/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +1 -67
  19. package/lib/esm/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +2 -16
  20. package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +1 -15
  21. package/lib/esm/view/spendManagement/commonSetup/types/businessVerification.js +1 -148
  22. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
  23. package/lib/index.d.ts +5 -8
  24. package/lib/index.js +33 -41
  25. package/lib/view/companyView/epic/companyPassport/updateCompanyDetailsEpic.js +0 -6
  26. package/lib/view/companyView/types/companyPassport/companyDetailsLocalData.d.ts +0 -13
  27. package/lib/view/companyView/types/companyPassport/companyPassportLocalData.js +0 -13
  28. package/lib/view/companyView/types/companyPassportViewPayload.d.ts +1 -1
  29. package/lib/view/companyView/types/companyPassportViewPayload.js +12 -55
  30. package/lib/view/expenseAutomationView/epics/transactionCategorization/triggerReviewTabRefetchEpic.js +3 -2
  31. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
  32. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +0 -1
  33. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +3 -22
  34. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryDownloadSelector.js +2 -2
  35. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistorySelector.js +2 -2
  36. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailSelector.js +1 -4
  37. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/fetchChargeCardRepaymentDetailEpic.js +1 -2
  38. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/initiateChargeCardRepaymentEpic.d.ts +1 -1
  39. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/initiateChargeCardRepaymentEpic.js +1 -1
  40. package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +1 -67
  41. package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +2 -16
  42. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +0 -14
  43. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -15
  44. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -14
  45. package/lib/view/spendManagement/commonSetup/types/businessVerification.d.ts +0 -43
  46. package/lib/view/spendManagement/commonSetup/types/businessVerification.js +0 -150
  47. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
  48. package/package.json +1 -1
  49. package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
@@ -1,62 +1,19 @@
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
- /** 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',
4
+ const toCompanyUpdatableInfoPayload = (info) => {
5
+ const payload = {
6
+ name: info.companyName,
7
+ company_legal_name: info.legalName,
8
+ phone: info.phone,
9
+ company_industry: info.industry,
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;
10
16
  };
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
- });
60
17
  exports.toCompanyUpdatableInfoPayload = toCompanyUpdatableInfoPayload;
61
18
  const toCompanyIncInfoUpdatableInfoPayload = (info) => {
62
19
  const payload = {
@@ -7,14 +7,15 @@ 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.transactionReviewLocalDataById[transactionId.id];
17
+ .transactionCategorizationView.review
18
+ .transactionReviewLocalDataById[transactionId.id];
18
19
  if (reviewLocalData != null) {
19
20
  return rxjs_1.EMPTY;
20
21
  }
@@ -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.autoCategorized ??
50
- [];
49
+ const currentAutoLineIds = localData.transactionReviewLocalData.tabSpecificLineItems
50
+ .autoCategorized ?? [];
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);
@@ -53,5 +53,4 @@ 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;
57
56
  export declare const getProductSettingsString: (productSettings: TenantProductSettings | undefined) => string;
@@ -3,7 +3,6 @@ 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;
7
6
  const reduceFetchState_1 = require("../../../commonStateTypes/reduceFetchState");
8
7
  const fileSelector_1 = require("../../../entity/file/fileSelector");
9
8
  const paymentAccountSelector_1 = require("../../../entity/paymentAccount/paymentAccountSelector");
@@ -230,12 +229,12 @@ function isCompanyDetailsSavePending(fileState, company, primaryContact, company
230
229
  return false;
231
230
  }
232
231
  const { companyInfo, incInfo, taxInfo, questionaire } = company.company.company;
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;
232
+ const { companyDescription, companyLegalName, companyUrl, phone } = companyInfo;
233
+ const { fileIds, companyIncDate: incDate, companyIncType } = incInfo;
235
234
  const { companyIndustry } = questionaire;
236
235
  const { taxId } = taxInfo;
237
236
  const companyFileIds = (0, fileSelector_1.getFilesByFileIds)(fileState, fileIds).map((file) => file.fileId);
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;
237
+ const { companyDescription: companyDescriptionLocalData, companyIndustry: companyIndustryLocalData, companyLegalName: companyLegalNameLocalData, taxIdOrEIN: taxIdLocalData, incDate: incDateLocalData, phone: companyPhoneLocalData, website: companyUrlLocalData, companyFiles: companyFilesLocalData, typeOfIncorporation: companyIncTypeLocalData, primaryContactLocalData, } = companyDetailsLocalData;
239
238
  const fileIdsLocalData = companyFilesLocalData.map((file) => file.fileId);
240
239
  if (primaryContact != null) {
241
240
  const { firstName, lastName, email } = primaryContact;
@@ -245,10 +244,6 @@ function isCompanyDetailsSavePending(fileState, company, primaryContact, company
245
244
  return true;
246
245
  }
247
246
  }
248
- const countriesOfOperationsMatch = JSON.stringify(countriesOfOperations ?? []) ===
249
- JSON.stringify(countriesOfOperationsLocalData ?? []);
250
- const usNexusTypesMatch = JSON.stringify(usNexusTypes ?? []) ===
251
- JSON.stringify(usNexusTypesLocalData ?? []);
252
247
  return (companyDescription != companyDescriptionLocalData ||
253
248
  companyIndustry != companyIndustryLocalData ||
254
249
  companyLegalName != companyLegalNameLocalData ||
@@ -256,21 +251,7 @@ function isCompanyDetailsSavePending(fileState, company, primaryContact, company
256
251
  incDate?.toString() != incDateLocalData?.toString() ||
257
252
  phone != companyPhoneLocalData ||
258
253
  companyUrl?.toString() != companyUrlLocalData?.toString() ||
259
- companyIncState != stateOfIncorporationLocalData ||
260
- companySourceOfFunds != companySourceOfFundsLocalData ||
261
- companySourceOfFundsDescription !=
262
- companySourceOfFundsDescriptionLocalData ||
263
- !countriesOfOperationsMatch ||
264
254
  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 ||
274
255
  !(fileIdsLocalData.length === companyFileIds.length &&
275
256
  companyFileIds.every((fileId) => fileIdsLocalData.includes(fileId))));
276
257
  }
@@ -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 } = state;
9
- const { filters, repaymentHistoryIds, searchText, uiState, fetchState, error } = chargeCardPaymentHistoryState;
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 depositAccountSelector_1 = require("../../../../entity/depositAccount/depositAccountSelector");
7
- const paymentAccountSelector_1 = require("../../../../entity/paymentAccount/paymentAccountSelector");
8
6
  const userSelector_1 = require("../../../../entity/user/userSelector");
9
7
  const setupViewSelector_1 = require("../../commonSetup/setupViewSelector");
8
+ const depositAccountSelector_1 = require("../../../../entity/depositAccount/depositAccountSelector");
9
+ const paymentAccountSelector_1 = require("../../../../entity/paymentAccount/paymentAccountSelector");
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,10 +18,7 @@ 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 = [
22
- ...depositFundingFromLimit,
23
- ...paymentFundingAccounts,
24
- ];
21
+ transferFromAccounts = [...depositFundingFromLimit, ...paymentFundingAccounts];
25
22
  }
26
23
  }
27
24
  const reducedFetchState = (0, reduceFetchState_1.reduceAnyCompletedFetchState)([
@@ -10,8 +10,7 @@ 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' &&
14
- depositAccounts.fetchState !== 'Completed';
13
+ const willFetchDeposit = depositAccounts.fetchState !== 'In-Progress' && depositAccounts.fetchState !== 'Completed';
15
14
  if (willFetchDeposit) {
16
15
  fetchChargeCardRepaymentDetailActions.push((0, depositAccountListReducer_1.fetchDepositAccountList)());
17
16
  }
@@ -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 { updateCreditAccountRepaymentAmountAndDate } from '../chargeCardList/chargeCardListReducer';
8
7
  import { addRepaymentToChargeCardPaymentHistory } from '../chargeCardPaymentHistory/chargeCardPaymentHistoryReducer';
8
+ import { updateCreditAccountRepaymentAmountAndDate } from '../chargeCardList/chargeCardListReducer';
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 chargeCardListReducer_1 = require("../chargeCardList/chargeCardListReducer");
16
15
  const chargeCardPaymentHistoryReducer_1 = require("../chargeCardPaymentHistory/chargeCardPaymentHistoryReducer");
16
+ const chargeCardListReducer_1 = require("../chargeCardList/chargeCardListReducer");
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;
@@ -122,28 +122,8 @@ 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
- }
145
125
  const toBusinessVerificationCompanyDataPayload = (companyLocalData, sendForVerification, companyAddressData, registeredAddressData, setupViewType) => {
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;
126
+ const { companyDescription, companyLegalName, companyIndustry, website, incDate, taxIdOrEIN, phone, syncToken, fileIds, typeOfIncorporation, sourceOfFunds, } = companyLocalData;
147
127
  const company = {
148
128
  is_ready_for_verification: sendForVerification,
149
129
  file_ids: fileIds,
@@ -194,55 +174,9 @@ const toBusinessVerificationCompanyDataPayload = (companyLocalData, sendForVerif
194
174
  if (typeOfIncorporation != null) {
195
175
  company['company_inc_type'] = typeOfIncorporation;
196
176
  }
197
- if (stateOfIncorporation != null) {
198
- company['company_inc_state'] = stateOfIncorporation;
199
- }
200
177
  if (companyIndustry != null) {
201
178
  company['company_industry'] = companyIndustry;
202
179
  }
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
- });
246
180
  if (setupViewType === 'zeni_treasury' && sourceOfFunds != null) {
247
181
  company['source_of_funds'] = sourceOfFunds;
248
182
  }
@@ -51,21 +51,16 @@ 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, companySourceOfFunds: incCompanySourceOfFunds, companySourceOfFundsDescription, countriesOfOperations, transactionVolume, transactionVolumeDescription, purposeOfAccount, purposeOfAccountDescription, regulatedStatus, regulatedStatusDescription, usNexus, usNexusTypes, } = companyInfo;
54
+ const { companyId, companyDescription, companyLegalName, companyUrl, phone, syncToken, sourceOfFunds, } = companyInfo;
55
55
  const { usersSelectedForVerification: usersSelected } = companyBillPayInfo;
56
- const { fileIds, companyIncDate: incDate, companyIncType, companyIncState, companySubIndustry, companyIndustryType, } = incInfo;
56
+ const { fileIds, companyIncDate: incDate, companyIncType } = 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,
64
63
  companyLegalName,
65
- companySubIndustry,
66
- companySourceOfFunds: incCompanySourceOfFunds,
67
- companySourceOfFundsDescription,
68
- countriesOfOperations,
69
64
  taxIdOrEIN: taxId,
70
65
  incDate,
71
66
  phone,
@@ -74,15 +69,6 @@ function toSetupViewLocalData(company, users, userRoles, primaryContact) {
74
69
  syncToken,
75
70
  typeOfIncorporation: companyIncType,
76
71
  sourceOfFunds,
77
- stateOfIncorporation: companyIncState,
78
- transactionVolume,
79
- transactionVolumeDescription,
80
- purposeOfAccount,
81
- purposeOfAccountDescription,
82
- regulatedStatus,
83
- regulatedStatusDescription,
84
- usNexus,
85
- usNexusTypes,
86
72
  };
87
73
  let primaryContactDetails = undefined;
88
74
  if (primaryContact != null) {
@@ -69,29 +69,15 @@ export interface CompanyDetails {
69
69
  addressStatus?: NewAddressData;
70
70
  companyDescription?: string;
71
71
  companyIndustry?: string;
72
- companyIndustryType?: string;
73
72
  companyLegalName?: string;
74
- companySourceOfFunds?: string;
75
- companySourceOfFundsDescription?: string;
76
- companySubIndustry?: string;
77
- countriesOfOperations?: string[];
78
73
  incDate?: ZeniDate;
79
74
  phone?: string;
80
75
  primaryContactLocalData?: PrimaryContactLocalData;
81
- purposeOfAccount?: string;
82
- purposeOfAccountDescription?: string;
83
76
  registeredAddressStatus?: NewAddressData;
84
- regulatedStatus?: string;
85
- regulatedStatusDescription?: string;
86
77
  sourceOfFunds?: string;
87
- stateOfIncorporation?: string;
88
78
  syncToken?: string;
89
79
  taxIdOrEIN?: string;
90
- transactionVolume?: string;
91
- transactionVolumeDescription?: string;
92
80
  typeOfIncorporation?: string;
93
- usNexus?: string;
94
- usNexusTypes?: string[];
95
81
  website?: ZeniUrl;
96
82
  }
97
83
  interface CompanyAndOfficerLocalData {
@@ -114,7 +114,7 @@ const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentityDetail
114
114
  if (companyDetails.localData != null) {
115
115
  const deleteFileStatusById = {};
116
116
  const updateFileStatusById = {};
117
- const { syncToken, companyDescription, companyLegalName, website, companyIndustry, companyIndustryType, companySubIndustry, companySourceOfFunds, companySourceOfFundsDescription, countriesOfOperations, phone, taxIdOrEIN, incDate, fileIds, typeOfIncorporation, sourceOfFunds, transactionVolume, transactionVolumeDescription, purposeOfAccount, purposeOfAccountDescription, regulatedStatus, regulatedStatusDescription, stateOfIncorporation, usNexus, usNexusTypes, } = companyDetails.localData;
117
+ const { syncToken, companyDescription, companyLegalName, website, companyIndustry, phone, taxIdOrEIN, incDate, fileIds, typeOfIncorporation, sourceOfFunds, } = companyDetails.localData;
118
118
  fileIds.forEach((fileId) => {
119
119
  deleteFileStatusById[fileId] = (0, fileViewSelector_1.getFileDeleteStatusById)(state, fileId);
120
120
  });
@@ -128,11 +128,6 @@ const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentityDetail
128
128
  companyDescription,
129
129
  companyLegalName,
130
130
  companyIndustry,
131
- companyIndustryType,
132
- companySubIndustry,
133
- companySourceOfFunds,
134
- companySourceOfFundsDescription,
135
- countriesOfOperations,
136
131
  website,
137
132
  phone,
138
133
  taxIdOrEIN,
@@ -146,15 +141,6 @@ const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentityDetail
146
141
  primaryContactLocalData,
147
142
  typeOfIncorporation,
148
143
  sourceOfFunds,
149
- transactionVolume,
150
- transactionVolumeDescription,
151
- purposeOfAccount,
152
- purposeOfAccountDescription,
153
- regulatedStatus,
154
- regulatedStatusDescription,
155
- stateOfIncorporation,
156
- usNexus,
157
- usNexusTypes,
158
144
  };
159
145
  }
160
146
  const companyOfficerLocalData = {
@@ -16,27 +16,13 @@ export interface CompanyDetailsLocalData {
16
16
  fileIds: ID[];
17
17
  companyDescription?: string;
18
18
  companyIndustry?: string;
19
- companyIndustryType?: string;
20
19
  companyLegalName?: string;
21
- companySourceOfFunds?: string;
22
- companySourceOfFundsDescription?: string;
23
- companySubIndustry?: string;
24
- countriesOfOperations?: string[];
25
20
  incDate?: ZeniDate;
26
21
  phone?: string;
27
- purposeOfAccount?: string;
28
- purposeOfAccountDescription?: string;
29
- regulatedStatus?: string;
30
- regulatedStatusDescription?: string;
31
22
  sourceOfFunds?: string;
32
- stateOfIncorporation?: string;
33
23
  syncToken?: string;
34
24
  taxIdOrEIN?: string;
35
- transactionVolume?: string;
36
- transactionVolumeDescription?: string;
37
25
  typeOfIncorporation?: string;
38
- usNexus?: string;
39
- usNexusTypes?: string[];
40
26
  website?: ZeniUrl;
41
27
  }
42
28
  export interface PrimaryContactLocalData {
@@ -1,34 +1,5 @@
1
1
  import { ID } from '../../../../commonStateTypes/common';
2
2
  import { AddressUpdatableInfoPayload } from '../../../addressView/addressViewPayload';
3
- export declare const COMPANY_TRANSACTION_VOLUME_CODES: readonly ["less_than_10000", "10000_50000", "50001_250000", "250001_1000000", "1000001_2000000", "over_2000000"];
4
- export type CompanyTransactionVolumeCode = (typeof COMPANY_TRANSACTION_VOLUME_CODES)[number];
5
- export declare const COMPANY_SOURCE_OF_FUNDS_CODES: readonly ["sales_of_goods", "sales_of_services", "customer_payments", "investment_capital", "business_loans", "owner_contributions", "franchise_revenue", "rental_income", "government_contracts_grants", "donations_fundraising", "membership_fees_subscriptions", "licensing_royalties", "commission_income", "import_export_revenue", "cryptocurrency_activity"];
6
- export type CompanySourceOfFundsCode = (typeof COMPANY_SOURCE_OF_FUNDS_CODES)[number];
7
- export declare const COMPANY_PURPOSE_OF_ACCOUNT_CODES: readonly ["retail_sales", "ecommerce_sales", "cash_heavy_operations", "import_export_trade", "professional_services_not_handling_funds", "professional_services_handling_funds", "holding_investment_company", "property_management_real_estate", "charitable_nonprofit", "construction_contracting", "commercial_cash_operations", "freight_forwarding_logistics", "third_party_payment_processing", "technology_startup", "wholesale_distribution", "franchise_operation", "healthcare_provider", "educational_institution"];
8
- export type CompanyPurposeOfAccountCode = (typeof COMPANY_PURPOSE_OF_ACCOUNT_CODES)[number];
9
- /** Keys for company_us_nexus_desc / form usNexusTypes (labels from usNexusOptions in app locale). */
10
- export declare const COMPANY_US_NEXUS_TYPE_CODES: readonly ["employees", "customers", "physical_office", "banking_relationships"];
11
- export type CompanyUsNexusTypeCode = (typeof COMPANY_US_NEXUS_TYPE_CODES)[number];
12
- /** Industry type codes for onboarding / business verification (paired with sub-industry). */
13
- export declare const COMPANY_ONBOARDING_INDUSTRY_TYPE_CODES: readonly ["retail_consumer_goods", "financial_services", "food_agriculture", "healthcare_pharmaceuticals", "professional_services", "manufacturing_industrial", "real_estate_construction", "logistics_transportation", "wholesale_trade", "business_support_services", "escort_dating_adult_entertainment"];
14
- export type CompanyOnboardingIndustryTypeCode = (typeof COMPANY_ONBOARDING_INDUSTRY_TYPE_CODES)[number];
15
- export declare const COMPANY_ONBOARDING_SUB_INDUSTRY_CODES_BY_INDUSTRY: {
16
- readonly retail_consumer_goods: readonly ["grocery_stores_supermarkets", "convenience_stores", "specialty_food_retailers", "gas_stations_retail", "general_merchandise_department", "online_retail_ecommerce", "subscription_membership", "direct_to_consumer", "cannabis"];
17
- readonly financial_services: readonly ["banks_credit_unions", "fintech_payment_processing", "insurance_providers", "investment_advisors_broker", "lending_mortgage", "treasury_management", "personal_finance_apps", "retirement_planning", "real_estate_investment", "money_service_businesses", "cryptocurrency", "debt_collection", "payday_lending", "gambling"];
18
- readonly food_agriculture: readonly ["farms_agricultural", "food_wholesalers_distributors", "restaurants_cafes", "bars_nightclubs", "catering_services", "farmers_markets", "restaurant_tech_pos"];
19
- readonly healthcare_pharmaceuticals: readonly ["hospitals_clinics", "pharmacies", "medical_equipment", "biotechnology", "home_health", "healthcare_staffing", "wellness_benefits", "healthcare_social_assistance"];
20
- readonly professional_services: readonly ["legal_services", "accounting_auditing", "consulting_firms", "marketing_advertising", "real_estate_agents_property", "corporate_services_incorporation", "hr_workforce_management", "direct_marketing_telemarketing", "legal_accounting_consulting_programming"];
21
- readonly manufacturing_industrial: readonly ["chemical_manufacturing", "electronics_hardware", "automotive_manufacturing", "construction_materials", "textiles_apparel", "mining"];
22
- readonly real_estate_construction: readonly ["real_estate", "construction"];
23
- readonly logistics_transportation: readonly ["transportation_warehousing"];
24
- readonly wholesale_trade: readonly ["wholesale_trade"];
25
- readonly business_support_services: readonly ["business_support_building"];
26
- readonly escort_dating_adult_entertainment: readonly ["escort_services", "dating_adult_entertainment"];
27
- };
28
- export type CompanyOnboardingSubIndustryTypeCode = {
29
- [K in keyof typeof COMPANY_ONBOARDING_SUB_INDUSTRY_CODES_BY_INDUSTRY]: (typeof COMPANY_ONBOARDING_SUB_INDUSTRY_CODES_BY_INDUSTRY)[K][number];
30
- }[keyof typeof COMPANY_ONBOARDING_SUB_INDUSTRY_CODES_BY_INDUSTRY];
31
- export declare function getCompanyOnboardingSubIndustryCodesForIndustry(industryTypeCode: string | undefined | null): CompanyOnboardingSubIndustryTypeCode[];
32
3
  export interface CompanyOfficerVerificationPayload {
33
4
  additional_submitted_documents_for_verification_file_ids: {
34
5
  social_security_card: ID[];
@@ -92,20 +63,6 @@ export interface CompanyDetailsVerificationPayload {
92
63
  source_of_funds: string;
93
64
  sync_token: string;
94
65
  tax_id: string;
95
- company_countries_of_operations?: string[];
96
- company_inc_state?: string | null;
97
- company_industry_sub_type?: string;
98
- company_industry_type?: string;
99
- company_purpose_of_account?: CompanyPurposeOfAccountCode;
100
- company_purpose_of_account_desc?: string;
101
- company_regulated_states?: boolean;
102
- company_regulated_states_desc?: string;
103
- company_source_of_funds?: CompanySourceOfFundsCode;
104
- company_source_of_funds_desc?: string;
105
- company_transaction_vol_expectations?: CompanyTransactionVolumeCode;
106
- company_transaction_vol_expectations_desc?: string;
107
- company_us_nexus?: boolean;
108
- company_us_nexus_desc?: string[];
109
66
  subscription_billing_address?: AddressUpdatableInfoPayload;
110
67
  }
111
68
  export interface BusinessVerificationDataPayload {