@zeniai/client-epic-state 4.19.63 → 4.19.64

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.
@@ -15,6 +15,9 @@ 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.companySubIndustry != null && {
19
+ company_industry_sub_type: companyDetails.companyInfo.companySubIndustry,
20
+ }),
18
21
  };
19
22
  const { newAddressState } = state$.value.addressViewState;
20
23
  const addressToCreate = newAddressState?.company_address?.addressToCreate;
@@ -8,8 +8,20 @@ export interface CompanyInfoLocalData {
8
8
  firstMonthOfFY: Month;
9
9
  legalName: string;
10
10
  phone: string;
11
+ companySourceOfFunds?: string;
12
+ companySourceOfFundsDescription?: string;
13
+ companySubIndustry?: string;
14
+ countriesOfOperations?: string[];
11
15
  industry?: string;
12
16
  meetingLink?: ZeniUrl;
17
+ purposeOfAccount?: string;
18
+ purposeOfAccountDescription?: string;
19
+ regulatedStatus?: string;
20
+ regulatedStatusDescription?: string;
21
+ transactionVolume?: string;
22
+ transactionVolumeDescription?: string;
23
+ usNexus?: string;
24
+ usNexusTypes?: string[];
13
25
  website?: ZeniUrl;
14
26
  }
15
27
  export interface IncInfoLocalData {
@@ -13,9 +13,21 @@ function toCompanyPassportLocalData(companyView, companyFiles) {
13
13
  website: companyInfo.companyUrl,
14
14
  meetingLink: companyInfo.meetingUrl,
15
15
  industry: companyQuestionaire.companyIndustry,
16
+ companySubIndustry: incInfo.companySubIndustry,
16
17
  businessModel: companyQuestionaire.companyBusinessModel ?? '',
17
18
  phone: companyInfo.phone ?? '',
18
19
  firstMonthOfFY: companyInfo.firstMonthOfFY,
20
+ companySourceOfFunds: companyInfo.companySourceOfFunds,
21
+ companySourceOfFundsDescription: companyInfo.companySourceOfFundsDescription,
22
+ countriesOfOperations: companyInfo.countriesOfOperations,
23
+ transactionVolume: companyInfo.transactionVolume,
24
+ transactionVolumeDescription: companyInfo.transactionVolumeDescription,
25
+ purposeOfAccount: companyInfo.purposeOfAccount,
26
+ purposeOfAccountDescription: companyInfo.purposeOfAccountDescription,
27
+ regulatedStatus: companyInfo.regulatedStatus,
28
+ regulatedStatusDescription: companyInfo.regulatedStatusDescription,
29
+ usNexus: companyInfo.usNexus,
30
+ usNexusTypes: companyInfo.usNexusTypes,
19
31
  },
20
32
  incInfo: {
21
33
  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
- 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;
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 = {
@@ -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,8 +230,8 @@ 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, companyIncState, companyIncType, companySourceOfFunds, companySourceOfFundsDescription, companySubIndustry, countriesOfOperations, transactionVolume, transactionVolumeDescription, purposeOfAccount, purposeOfAccountDescription, regulatedStatus, regulatedStatusDescription, usNexus, usNexusTypes, } = 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);
@@ -51,9 +51,9 @@ 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, companyIncState, companySubIndustry, countriesOfOperations, companySourceOfFunds: incCompanySourceOfFunds, companySourceOfFundsDescription, transactionVolume, transactionVolumeDescription, purposeOfAccount, purposeOfAccountDescription, regulatedStatus, regulatedStatusDescription, usNexus, usNexusTypes, } = incInfo;
56
+ const { fileIds, companyIncDate: incDate, companyIncType, companyIncState, companySubIndustry, } = incInfo;
57
57
  const { companyIndustry } = questionaire;
58
58
  const { taxId } = taxInfo;
59
59
  const companyDetails = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.19.63",
3
+ "version": "4.19.64",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",