@zeniai/client-epic-state 4.19.64 → 4.19.66

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 (30) hide show
  1. package/lib/entity/chargeCardRepayment/chargeCardRepayment.d.ts +1 -1
  2. package/lib/entity/chargeCardRepayment/chargeCardRepayment.js +1 -1
  3. package/lib/entity/company/companyPayload.d.ts +11 -11
  4. package/lib/entity/company/companyPayload.js +19 -19
  5. package/lib/entity/company/companyStateTypes.d.ts +11 -11
  6. package/lib/esm/entity/chargeCardRepayment/chargeCardRepayment.js +1 -1
  7. package/lib/esm/entity/company/companyPayload.js +19 -19
  8. package/lib/esm/view/companyView/epic/companyPassport/updateCompanyDetailsEpic.js +0 -3
  9. package/lib/esm/view/companyView/types/companyPassport/companyPassportLocalData.js +0 -12
  10. package/lib/esm/view/companyView/types/companyPassportViewPayload.js +12 -55
  11. package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +3 -3
  12. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  13. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +1 -0
  14. package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryHelpers.js +1 -1
  15. package/lib/esm/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +2 -2
  16. package/lib/view/companyView/epic/companyPassport/updateCompanyDetailsEpic.js +0 -3
  17. package/lib/view/companyView/types/companyPassport/companyDetailsLocalData.d.ts +0 -12
  18. package/lib/view/companyView/types/companyPassport/companyPassportLocalData.js +0 -12
  19. package/lib/view/companyView/types/companyPassportViewPayload.d.ts +1 -1
  20. package/lib/view/companyView/types/companyPassportViewPayload.js +12 -55
  21. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +0 -1
  22. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +2 -3
  23. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +2 -0
  24. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  25. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +2 -0
  26. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +1 -0
  27. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryHelpers.js +1 -1
  28. package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +2 -2
  29. package/package.json +1 -1
  30. package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
@@ -31,7 +31,7 @@ export interface ChargeCardRepayment {
31
31
  export interface ChargeCardRepaymentState {
32
32
  chargeCardRepaymentByID: Record<ID, ChargeCardRepayment>;
33
33
  }
34
- export declare const toChargeCardRepaymentStatusCodeType: (v: string) => "PendingReview" | "Pending" | "Sent" | "Clear" | "Rejected" | "Returned";
34
+ export declare const toChargeCardRepaymentStatusCodeType: (v: string) => "PendingReview" | "Pending" | "Sent" | "Clearing" | "Rejected" | "Returned";
35
35
  export type ChargeCardRepaymentStatusCodeType = ReturnType<typeof toChargeCardRepaymentStatusCodeType>;
36
36
  export declare const toChargeCardRepaymentType: (v: string) => "scheduled" | "onDemand" | undefined;
37
37
  export type ChargeCardRepaymentType = ReturnType<typeof toChargeCardRepaymentType>;
@@ -6,7 +6,7 @@ const ALL_CHARGE_CARD_REPAYMENT_STATUS_CODE = [
6
6
  'PendingReview',
7
7
  'Pending',
8
8
  'Sent',
9
- 'Clear',
9
+ 'Clearing',
10
10
  'Rejected',
11
11
  'Returned',
12
12
  ];
@@ -18,17 +18,6 @@ export interface CompanyInfoPayload {
18
18
  primary_email_domain: string;
19
19
  source_of_funds: string | null;
20
20
  update_time: string;
21
- company_countries_of_operations?: string[] | null;
22
- company_purpose_of_account?: string | null;
23
- company_purpose_of_account_desc?: string | null;
24
- company_regulated_states?: boolean | null;
25
- company_regulated_states_desc?: string | null;
26
- company_source_of_funds?: string | null;
27
- company_source_of_funds_desc?: string | null;
28
- company_transaction_vol_expectations?: string | null;
29
- company_transaction_vol_expectations_desc?: string | null;
30
- company_us_nexus?: boolean | null;
31
- company_us_nexus_desc?: string[] | null;
32
21
  first_month_of_fiscal_year?: string | undefined;
33
22
  sync_token?: string | null;
34
23
  }
@@ -47,7 +36,18 @@ export interface CompanyIncInfoPayload {
47
36
  company_inc_state: string | null;
48
37
  company_inc_state_code: string | null;
49
38
  company_inc_type: string | null;
39
+ company_countries_of_operations?: string[] | null;
50
40
  company_industry_sub_type?: string | null;
41
+ company_purpose_of_account?: string | null;
42
+ company_purpose_of_account_desc?: string | null;
43
+ company_regulated_states?: boolean | null;
44
+ company_regulated_states_desc?: string | null;
45
+ company_source_of_funds?: string | null;
46
+ company_source_of_funds_desc?: string | null;
47
+ company_transaction_vol_expectations?: string | null;
48
+ company_transaction_vol_expectations_desc?: string | null;
49
+ company_us_nexus?: boolean | null;
50
+ company_us_nexus_desc?: string[] | null;
51
51
  file_ids?: ID[] | null;
52
52
  }
53
53
  export interface CompanyTaxInfoPayload {
@@ -36,25 +36,6 @@ const toCompanyInfo = (payload, companyIdTenantIdMapping, companyInStore) => {
36
36
  phone: payload.phone ?? undefined,
37
37
  firstMonthOfFY: (0, timePeriod_1.getMonthFromMonthName)(payload.first_month_of_fiscal_year) ?? 1,
38
38
  sourceOfFunds: payload.source_of_funds ?? undefined,
39
- companySourceOfFunds: payload.company_source_of_funds ?? undefined,
40
- companySourceOfFundsDescription: payload.company_source_of_funds_desc ?? undefined,
41
- countriesOfOperations: payload.company_countries_of_operations ?? undefined,
42
- transactionVolume: payload.company_transaction_vol_expectations ?? undefined,
43
- transactionVolumeDescription: payload.company_transaction_vol_expectations_desc ?? undefined,
44
- purposeOfAccount: payload.company_purpose_of_account ?? undefined,
45
- purposeOfAccountDescription: payload.company_purpose_of_account_desc ?? undefined,
46
- regulatedStatus: payload.company_regulated_states == null
47
- ? undefined
48
- : payload.company_regulated_states
49
- ? 'yes'
50
- : 'no',
51
- regulatedStatusDescription: payload.company_regulated_states_desc ?? undefined,
52
- usNexus: payload.company_us_nexus == null
53
- ? undefined
54
- : payload.company_us_nexus
55
- ? 'yes'
56
- : 'no',
57
- usNexusTypes: payload.company_us_nexus_desc ?? undefined,
58
39
  };
59
40
  };
60
41
  const toCompanyLocaleInfo = (payload) => ({
@@ -76,6 +57,25 @@ const toCompanyIncInfo = (payload) => ({
76
57
  companyIncCountryCode: payload.company_inc_country_code ?? undefined,
77
58
  fileIds: payload.file_ids ?? [],
78
59
  companySubIndustry: payload.company_industry_sub_type ?? undefined,
60
+ countriesOfOperations: payload.company_countries_of_operations ?? undefined,
61
+ companySourceOfFunds: payload.company_source_of_funds ?? undefined,
62
+ companySourceOfFundsDescription: payload.company_source_of_funds_desc ?? undefined,
63
+ transactionVolume: payload.company_transaction_vol_expectations ?? undefined,
64
+ transactionVolumeDescription: payload.company_transaction_vol_expectations_desc ?? undefined,
65
+ purposeOfAccount: payload.company_purpose_of_account ?? undefined,
66
+ purposeOfAccountDescription: payload.company_purpose_of_account_desc ?? undefined,
67
+ regulatedStatus: payload.company_regulated_states === true
68
+ ? 'yes'
69
+ : payload.company_regulated_states === false
70
+ ? 'no'
71
+ : undefined,
72
+ regulatedStatusDescription: payload.company_regulated_states_desc ?? undefined,
73
+ usNexus: payload.company_us_nexus === true
74
+ ? 'yes'
75
+ : payload.company_us_nexus === false
76
+ ? 'no'
77
+ : undefined,
78
+ usNexusTypes: payload.company_us_nexus_desc ?? undefined,
79
79
  });
80
80
  const toCompanyTaxInfo = (payload) => ({
81
81
  taxesFiledDate: payload.taxes_filed_date != null
@@ -27,23 +27,12 @@ export interface CompanyInfo {
27
27
  bookCloseDate?: ZeniDate;
28
28
  companyDescription?: string;
29
29
  companyLegalName?: string;
30
- companySourceOfFunds?: string;
31
- companySourceOfFundsDescription?: string;
32
30
  companyUrl?: ZeniUrl;
33
- countriesOfOperations?: string[];
34
31
  meetingUrl?: ZeniUrl;
35
32
  phone?: string;
36
- purposeOfAccount?: string;
37
- purposeOfAccountDescription?: string;
38
- regulatedStatus?: string;
39
- regulatedStatusDescription?: string;
40
33
  sourceOfFunds?: string;
41
34
  syncToken?: string;
42
35
  tenantId?: ID;
43
- transactionVolume?: string;
44
- transactionVolumeDescription?: string;
45
- usNexus?: string;
46
- usNexusTypes?: string[];
47
36
  }
48
37
  export interface CompanyLocaleInfo {
49
38
  companyIncCountryCode: string;
@@ -61,7 +50,18 @@ export interface CompanyIncInfo {
61
50
  companyIncState?: string;
62
51
  companyIncStateCode?: string;
63
52
  companyIncType?: string;
53
+ companySourceOfFunds?: string;
54
+ companySourceOfFundsDescription?: string;
64
55
  companySubIndustry?: string;
56
+ countriesOfOperations?: string[];
57
+ purposeOfAccount?: string;
58
+ purposeOfAccountDescription?: string;
59
+ regulatedStatus?: string;
60
+ regulatedStatusDescription?: string;
61
+ transactionVolume?: string;
62
+ transactionVolumeDescription?: string;
63
+ usNexus?: string;
64
+ usNexusTypes?: string[];
65
65
  }
66
66
  export interface CompanyTaxInfo {
67
67
  taxesFiledYears: number[];
@@ -3,7 +3,7 @@ const ALL_CHARGE_CARD_REPAYMENT_STATUS_CODE = [
3
3
  'PendingReview',
4
4
  'Pending',
5
5
  'Sent',
6
- 'Clear',
6
+ 'Clearing',
7
7
  'Rejected',
8
8
  'Returned',
9
9
  ];
@@ -33,25 +33,6 @@ const toCompanyInfo = (payload, companyIdTenantIdMapping, companyInStore) => {
33
33
  phone: payload.phone ?? undefined,
34
34
  firstMonthOfFY: getMonthFromMonthName(payload.first_month_of_fiscal_year) ?? 1,
35
35
  sourceOfFunds: payload.source_of_funds ?? undefined,
36
- companySourceOfFunds: payload.company_source_of_funds ?? undefined,
37
- companySourceOfFundsDescription: payload.company_source_of_funds_desc ?? undefined,
38
- countriesOfOperations: payload.company_countries_of_operations ?? undefined,
39
- transactionVolume: payload.company_transaction_vol_expectations ?? undefined,
40
- transactionVolumeDescription: payload.company_transaction_vol_expectations_desc ?? undefined,
41
- purposeOfAccount: payload.company_purpose_of_account ?? undefined,
42
- purposeOfAccountDescription: payload.company_purpose_of_account_desc ?? undefined,
43
- regulatedStatus: payload.company_regulated_states == null
44
- ? undefined
45
- : payload.company_regulated_states
46
- ? 'yes'
47
- : 'no',
48
- regulatedStatusDescription: payload.company_regulated_states_desc ?? undefined,
49
- usNexus: payload.company_us_nexus == null
50
- ? undefined
51
- : payload.company_us_nexus
52
- ? 'yes'
53
- : 'no',
54
- usNexusTypes: payload.company_us_nexus_desc ?? undefined,
55
36
  };
56
37
  };
57
38
  const toCompanyLocaleInfo = (payload) => ({
@@ -73,6 +54,25 @@ const toCompanyIncInfo = (payload) => ({
73
54
  companyIncCountryCode: payload.company_inc_country_code ?? undefined,
74
55
  fileIds: payload.file_ids ?? [],
75
56
  companySubIndustry: payload.company_industry_sub_type ?? undefined,
57
+ countriesOfOperations: payload.company_countries_of_operations ?? undefined,
58
+ companySourceOfFunds: payload.company_source_of_funds ?? undefined,
59
+ companySourceOfFundsDescription: payload.company_source_of_funds_desc ?? undefined,
60
+ transactionVolume: payload.company_transaction_vol_expectations ?? undefined,
61
+ transactionVolumeDescription: payload.company_transaction_vol_expectations_desc ?? undefined,
62
+ purposeOfAccount: payload.company_purpose_of_account ?? undefined,
63
+ purposeOfAccountDescription: payload.company_purpose_of_account_desc ?? undefined,
64
+ regulatedStatus: payload.company_regulated_states === true
65
+ ? 'yes'
66
+ : payload.company_regulated_states === false
67
+ ? 'no'
68
+ : undefined,
69
+ regulatedStatusDescription: payload.company_regulated_states_desc ?? undefined,
70
+ usNexus: payload.company_us_nexus === true
71
+ ? 'yes'
72
+ : payload.company_us_nexus === false
73
+ ? 'no'
74
+ : undefined,
75
+ usNexusTypes: payload.company_us_nexus_desc ?? undefined,
76
76
  });
77
77
  const toCompanyTaxInfo = (payload) => ({
78
78
  taxesFiledDate: payload.taxes_filed_date != null
@@ -12,9 +12,6 @@ export const updateCompanyDetailsEpic = (actions$, state$, zeniAPI) => actions$.
12
12
  ...toCompanyIncInfoUpdatableInfoPayload(companyDetails.incInfo),
13
13
  ...toCompanyTaxInfoUpdatableInfoPayload(companyDetails.taxDetails),
14
14
  ...toCompanyFileInfoPayload(companyDetails.incInfo, companyDetails.taxDetails),
15
- ...(companyDetails.companyInfo.companySubIndustry != null && {
16
- company_industry_sub_type: companyDetails.companyInfo.companySubIndustry,
17
- }),
18
15
  };
19
16
  const { newAddressState } = state$.value.addressViewState;
20
17
  const addressToCreate = newAddressState?.company_address?.addressToCreate;
@@ -10,21 +10,9 @@ export function toCompanyPassportLocalData(companyView, companyFiles) {
10
10
  website: companyInfo.companyUrl,
11
11
  meetingLink: companyInfo.meetingUrl,
12
12
  industry: companyQuestionaire.companyIndustry,
13
- companySubIndustry: incInfo.companySubIndustry,
14
13
  businessModel: companyQuestionaire.companyBusinessModel ?? '',
15
14
  phone: companyInfo.phone ?? '',
16
15
  firstMonthOfFY: companyInfo.firstMonthOfFY,
17
- companySourceOfFunds: companyInfo.companySourceOfFunds,
18
- companySourceOfFundsDescription: companyInfo.companySourceOfFundsDescription,
19
- countriesOfOperations: companyInfo.countriesOfOperations,
20
- transactionVolume: companyInfo.transactionVolume,
21
- transactionVolumeDescription: companyInfo.transactionVolumeDescription,
22
- purposeOfAccount: companyInfo.purposeOfAccount,
23
- purposeOfAccountDescription: companyInfo.purposeOfAccountDescription,
24
- regulatedStatus: companyInfo.regulatedStatus,
25
- regulatedStatusDescription: companyInfo.regulatedStatusDescription,
26
- usNexus: companyInfo.usNexus,
27
- usNexusTypes: companyInfo.usNexusTypes,
28
16
  },
29
17
  incInfo: {
30
18
  typeOfInc: incInfo.companyIncType ?? '',
@@ -1,59 +1,16 @@
1
- /** Maps US nexus display label to API key (for company_us_nexus_desc) */
2
- const US_NEXUS_LABEL_TO_KEY = {
3
- Employees: 'employees',
4
- Customers: 'customers',
5
- 'Physical office or facility': 'physical_office',
6
- 'Banking relationships': 'banking_relationships',
1
+ export const toCompanyUpdatableInfoPayload = (info) => {
2
+ const payload = {
3
+ name: info.companyName,
4
+ company_legal_name: info.legalName,
5
+ phone: info.phone,
6
+ company_industry: info.industry,
7
+ company_business_model: info.businessModel,
8
+ company_url: info.website != null ? info.website.toString() : null,
9
+ meeting_url: info.meetingLink != null ? info.meetingLink.toString() : null,
10
+ is_new_company_industry_verified: true,
11
+ };
12
+ return payload;
7
13
  };
8
- function toUsNexusTypeKey(value) {
9
- const key = US_NEXUS_LABEL_TO_KEY[value];
10
- return key ?? value;
11
- }
12
- export const toCompanyUpdatableInfoPayload = (info) => ({
13
- name: info.companyName,
14
- company_legal_name: info.legalName,
15
- phone: info.phone,
16
- company_industry: info.industry,
17
- company_business_model: info.businessModel,
18
- company_url: info.website != null ? info.website.toString() : null,
19
- meeting_url: info.meetingLink != null ? info.meetingLink.toString() : null,
20
- is_new_company_industry_verified: true,
21
- ...(info.companySourceOfFunds != null && {
22
- company_source_of_funds: info.companySourceOfFunds,
23
- }),
24
- ...(info.companySourceOfFundsDescription != null && {
25
- company_source_of_funds_desc: info.companySourceOfFundsDescription,
26
- }),
27
- ...(info.countriesOfOperations != null &&
28
- info.countriesOfOperations.length > 0 && {
29
- company_countries_of_operations: info.countriesOfOperations,
30
- }),
31
- ...(info.transactionVolume != null && {
32
- company_transaction_vol_expectations: info.transactionVolume,
33
- }),
34
- ...(info.transactionVolumeDescription != null && {
35
- company_transaction_vol_expectations_desc: info.transactionVolumeDescription,
36
- }),
37
- ...(info.purposeOfAccount != null && {
38
- company_purpose_of_account: info.purposeOfAccount,
39
- }),
40
- ...(info.purposeOfAccountDescription != null && {
41
- company_purpose_of_account_desc: info.purposeOfAccountDescription,
42
- }),
43
- ...(info.regulatedStatus != null && {
44
- company_regulated_states: info.regulatedStatus === 'yes',
45
- }),
46
- ...(info.regulatedStatusDescription != null && {
47
- company_regulated_states_desc: info.regulatedStatusDescription,
48
- }),
49
- ...(info.usNexus != null && {
50
- company_us_nexus: info.usNexus === 'yes',
51
- }),
52
- ...(info.usNexusTypes != null &&
53
- info.usNexusTypes.length > 0 && {
54
- company_us_nexus_desc: info.usNexusTypes.map(toUsNexusTypeKey),
55
- }),
56
- });
57
14
  export const toCompanyIncInfoUpdatableInfoPayload = (info) => {
58
15
  const payload = {
59
16
  company_inc_type: info.typeOfInc,
@@ -218,13 +218,13 @@ export const onboardingStepsData = (isValidConnection, productSettings, accounti
218
218
  requiredStepsData: requiredStepsData.map((step) => toOnboardingStepType(step)),
219
219
  };
220
220
  };
221
- export function isCompanyDetailsSavePending(fileState, company, primaryContact, companyDetailsLocalData) {
221
+ function isCompanyDetailsSavePending(fileState, company, primaryContact, companyDetailsLocalData) {
222
222
  if (company == null || companyDetailsLocalData == null) {
223
223
  return false;
224
224
  }
225
225
  const { companyInfo, incInfo, taxInfo, questionaire } = company.company.company;
226
- const { companyDescription, companyLegalName, companyUrl, phone, companySourceOfFunds, companySourceOfFundsDescription, countriesOfOperations, transactionVolume, transactionVolumeDescription, purposeOfAccount, purposeOfAccountDescription, regulatedStatus, regulatedStatusDescription, usNexus, usNexusTypes, } = companyInfo;
227
- const { fileIds, companyIncDate: incDate, companyIncState, companyIncType, companySubIndustry, } = incInfo;
226
+ const { companyDescription, companyLegalName, companyUrl, phone } = companyInfo;
227
+ const { fileIds, companyIncDate: incDate, companyIncState, companyIncType, companySourceOfFunds, companySourceOfFundsDescription, companySubIndustry, countriesOfOperations, transactionVolume, transactionVolumeDescription, purposeOfAccount, purposeOfAccountDescription, regulatedStatus, regulatedStatusDescription, usNexus, usNexusTypes, } = incInfo;
228
228
  const { companyIndustry } = questionaire;
229
229
  const { taxId } = taxInfo;
230
230
  const companyFileIds = getFilesByFileIds(fileState, fileIds).map((file) => file.fileId);
@@ -68,6 +68,7 @@ export const initialCreditAccountRepayment = {
68
68
  nextRepaymentDueDate: dateNow(),
69
69
  remainingAmountDue: { amount: 0, currencyCode: 'USD', currencySymbol: '$' },
70
70
  initiatedRepaymentDate: undefined,
71
+ paymentMethod: undefined,
71
72
  };
72
73
  const ALL_CHARGE_CARD_SORT_KEYS = [
73
74
  'owner',
@@ -340,6 +340,7 @@ const toCreditAccountRepayment = (payload) => ({
340
340
  initiatedRepaymentDate: payload.initiated_repayment_date != null
341
341
  ? date(payload.initiated_repayment_date)
342
342
  : undefined,
343
+ paymentMethod: payload.payment_method ?? undefined,
343
344
  providerCreditAccountId: payload.provider_credit_account_id,
344
345
  remainingAmountDue: toAmount(payload.remaining_amount_due, payload.currency_code, payload.currency_symbol),
345
346
  remainingAmountOverdue: toAmount(payload.remaining_amount_overdue, payload.currency_code, payload.currency_symbol),
@@ -12,7 +12,7 @@ export function getPaymentStatusDisplayText(status) {
12
12
  PendingReview: 'In Progress',
13
13
  Pending: 'In Progress',
14
14
  Sent: 'Complete',
15
- Clear: 'Complete',
15
+ Clearing: 'In Progress',
16
16
  Rejected: 'Failed',
17
17
  Returned: 'Failed',
18
18
  };
@@ -43,9 +43,9 @@ export const updateSetupViewLocalStoreDataEpic = (actions$, state$) => actions$.
43
43
  */
44
44
  export function toSetupViewLocalData(company, users, userRoles, primaryContact) {
45
45
  const { companyInfo, incInfo, taxInfo, questionaire, companyBillPayInfo } = company;
46
- const { companyId, companyDescription, companyLegalName, companyUrl, phone, syncToken, sourceOfFunds, companySourceOfFunds: incCompanySourceOfFunds, companySourceOfFundsDescription, countriesOfOperations, transactionVolume, transactionVolumeDescription, purposeOfAccount, purposeOfAccountDescription, regulatedStatus, regulatedStatusDescription, usNexus, usNexusTypes, } = companyInfo;
46
+ const { companyId, companyDescription, companyLegalName, companyUrl, phone, syncToken, sourceOfFunds, } = companyInfo;
47
47
  const { usersSelectedForVerification: usersSelected } = companyBillPayInfo;
48
- const { fileIds, companyIncDate: incDate, companyIncType, companyIncState, companySubIndustry, } = incInfo;
48
+ const { fileIds, companyIncDate: incDate, companyIncType, companyIncState, companySubIndustry, countriesOfOperations, companySourceOfFunds: incCompanySourceOfFunds, companySourceOfFundsDescription, transactionVolume, transactionVolumeDescription, purposeOfAccount, purposeOfAccountDescription, regulatedStatus, regulatedStatusDescription, usNexus, usNexusTypes, } = incInfo;
49
49
  const { companyIndustry } = questionaire;
50
50
  const { taxId } = taxInfo;
51
51
  const companyDetails = {
@@ -15,9 +15,6 @@ 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
- }),
21
18
  };
22
19
  const { newAddressState } = state$.value.addressViewState;
23
20
  const addressToCreate = newAddressState?.company_address?.addressToCreate;
@@ -8,20 +8,8 @@ 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[];
15
11
  industry?: string;
16
12
  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[];
25
13
  website?: ZeniUrl;
26
14
  }
27
15
  export interface IncInfoLocalData {
@@ -13,21 +13,9 @@ function toCompanyPassportLocalData(companyView, companyFiles) {
13
13
  website: companyInfo.companyUrl,
14
14
  meetingLink: companyInfo.meetingUrl,
15
15
  industry: companyQuestionaire.companyIndustry,
16
- companySubIndustry: incInfo.companySubIndustry,
17
16
  businessModel: companyQuestionaire.companyBusinessModel ?? '',
18
17
  phone: companyInfo.phone ?? '',
19
18
  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,
31
19
  },
32
20
  incInfo: {
33
21
  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' | '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'> {
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'> {
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,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 = {
@@ -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,8 +229,8 @@ 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, companyIncState, companyIncType, companySourceOfFunds, companySourceOfFundsDescription, companySubIndustry, countriesOfOperations, transactionVolume, transactionVolumeDescription, purposeOfAccount, purposeOfAccountDescription, regulatedStatus, regulatedStatusDescription, usNexus, usNexusTypes, } = 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);
@@ -1,5 +1,6 @@
1
1
  import { Amount } from '../../../../commonStateTypes/amount';
2
2
  import { FetchStateAndError, FetchedState, ID } from '../../../../commonStateTypes/common';
3
+ import { ChargeCardPaymentMethod } from './chargeCardListPayload';
3
4
  import { ZeniDate } from '../../../../zeniDayJS';
4
5
  import { SpendManagementUIState } from '../../billPay/billList/billListState';
5
6
  export interface ChargeCardListState extends FetchedState {
@@ -54,6 +55,7 @@ export interface CreditAccountRepayment extends FetchStateAndError {
54
55
  statementPeriodEnd: ZeniDate;
55
56
  statementPeriodStart: ZeniDate;
56
57
  initiatedRepaymentDate?: ZeniDate;
58
+ paymentMethod?: ChargeCardPaymentMethod;
57
59
  }
58
60
  export declare const initialCreditAcc: CreditAccount;
59
61
  export declare const initialDebitCardSummaries: DebitCardSummaries;
@@ -71,6 +71,7 @@ exports.initialCreditAccountRepayment = {
71
71
  nextRepaymentDueDate: (0, zeniDayJS_1.dateNow)(),
72
72
  remainingAmountDue: { amount: 0, currencyCode: 'USD', currencySymbol: '$' },
73
73
  initiatedRepaymentDate: undefined,
74
+ paymentMethod: undefined,
74
75
  };
75
76
  const ALL_CHARGE_CARD_SORT_KEYS = [
76
77
  'owner',
@@ -33,6 +33,7 @@ export interface CreditAccountPayload {
33
33
  update_time: string;
34
34
  cashback_amount?: number | null;
35
35
  }
36
+ export type ChargeCardPaymentMethod = "ACH" | "Book Transfer";
36
37
  export interface CreditAccountRepaymentPayload {
37
38
  credit_account_id: string;
38
39
  currency_code: string;
@@ -46,6 +47,7 @@ export interface CreditAccountRepaymentPayload {
46
47
  statement_period_end: string;
47
48
  statement_period_start: string;
48
49
  initiated_repayment_date?: string | null;
50
+ payment_method?: ChargeCardPaymentMethod | null;
49
51
  }
50
52
  interface CreditAccountListPayload {
51
53
  credit_accounts: CreditAccountPayload[];
@@ -344,6 +344,7 @@ const toCreditAccountRepayment = (payload) => ({
344
344
  initiatedRepaymentDate: payload.initiated_repayment_date != null
345
345
  ? (0, zeniDayJS_1.date)(payload.initiated_repayment_date)
346
346
  : undefined,
347
+ paymentMethod: payload.payment_method ?? undefined,
347
348
  providerCreditAccountId: payload.provider_credit_account_id,
348
349
  remainingAmountDue: (0, amount_1.toAmount)(payload.remaining_amount_due, payload.currency_code, payload.currency_symbol),
349
350
  remainingAmountOverdue: (0, amount_1.toAmount)(payload.remaining_amount_overdue, payload.currency_code, payload.currency_symbol),
@@ -20,7 +20,7 @@ function getPaymentStatusDisplayText(status) {
20
20
  PendingReview: 'In Progress',
21
21
  Pending: 'In Progress',
22
22
  Sent: 'Complete',
23
- Clear: 'Complete',
23
+ Clearing: 'In Progress',
24
24
  Rejected: 'Failed',
25
25
  Returned: 'Failed',
26
26
  };
@@ -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, 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, } = incInfo;
56
+ const { fileIds, companyIncDate: incDate, companyIncType, companyIncState, companySubIndustry, countriesOfOperations, companySourceOfFunds: incCompanySourceOfFunds, companySourceOfFundsDescription, transactionVolume, transactionVolumeDescription, purposeOfAccount, purposeOfAccountDescription, regulatedStatus, regulatedStatusDescription, usNexus, usNexusTypes, } = 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.64",
3
+ "version": "4.19.66",
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",