@zeniai/client-epic-state 4.19.63 → 4.19.65

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 +3 -0
  9. package/lib/esm/view/companyView/types/companyPassport/companyPassportLocalData.js +12 -0
  10. package/lib/esm/view/companyView/types/companyPassportViewPayload.js +55 -12
  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/tsconfig.typecheck.tsbuildinfo +1 -1
  17. package/lib/view/companyView/epic/companyPassport/updateCompanyDetailsEpic.js +3 -0
  18. package/lib/view/companyView/types/companyPassport/companyDetailsLocalData.d.ts +12 -0
  19. package/lib/view/companyView/types/companyPassport/companyPassportLocalData.js +12 -0
  20. package/lib/view/companyView/types/companyPassportViewPayload.d.ts +1 -1
  21. package/lib/view/companyView/types/companyPassportViewPayload.js +55 -12
  22. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +1 -0
  23. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +3 -2
  24. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +2 -0
  25. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
  26. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +2 -0
  27. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +1 -0
  28. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryHelpers.js +1 -1
  29. package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +2 -2
  30. package/package.json +1 -1
@@ -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);
@@ -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, } = 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.65",
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",