@zeniai/client-epic-state 5.0.90-betaAS2 → 5.0.90-betaAS3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/esm/index.js CHANGED
@@ -385,8 +385,8 @@ import { getAllTopExpenses, getTop6Expenses, getTopExpenses, } from './view/topE
385
385
  */
386
386
  import { TOP_EX_TIME_PERIODS, } from './view/topEx/topExState';
387
387
  import { getAccountingProviderAttachment, } from './view/transactionDetail/getAccountingProviderAttachmentSelector';
388
- import { getChangedLineItemCountFromLocalData, isAccountUncategorized, } from './view/transactionDetail/transactionDetailLocalDataHelper';
389
388
  import { JOURNAL_ENTRY_SORT_KEYS, filterJournalEntryLinesExcludingLinked, journalEntryDefaultSortConfig, journalEntryTotalsByPostingSide, sortJournalEntryLines, sumJournalEntryAmounts, toJournalEntrySortKey, } from './view/transactionDetail/journalEntryLinesViewModel';
389
+ import { getChangedLineItemCountFromLocalData, isAccountUncategorized, } from './view/transactionDetail/transactionDetailLocalDataHelper';
390
390
  import { clearTransactionDetailSaveStatus, deleteTransactionAttachment, downloadAccountingProviderAttachment, downloadAccountingProviderAttachmentFailure, downloadAccountingProviderAttachmentSuccess, fetchTransactionDetail, initializeTransactionDetailLocalData, markCategoryClassRecommendationsFailureForTransactionDetail, removeEntityRecommendationForLineIdForTransactionDetail, resetAllLineItemsToVendor, resetLineItemsCategoryClassInLocalData, resetSelectedCustomer, resetVendor, saveTransactionDetail, saveTransactionDetailLocalData, setAllLineItemsLocalDataIsUpdateAllChecked, setAllLineItemsToCategoryClassInLocalData, setIsVendorUpdateAllChecked, updateLatestSelectedEntity, updateLocalDataWithTransactionsUpdateWithVendorCheckbox, updateSelectedCustomer, updateSelectedVendor, updateTransactionDetail, updateVendorBulkRecommendationsFetchStatus, updateVendorToAllLineItems, uploadMissingAttachmentSuccess, } from './view/transactionDetail/transactionDetailReducer';
391
391
  import { getInitialUpdatablePeriodsForTransactionRecommendations, getTransactionDetail, getTransactionDetailForTransaction, } from './view/transactionDetail/transactionDetailSelector';
392
392
  import { getThirdPartyIdFromTransactionId, } from './view/transactionDetail/transactionDetailState';
@@ -638,6 +638,7 @@ export { ALL_WEEK_DAYS, SEMI_WEEKLY_REQUIRED_DAYS_COUNT, getMinAllowedEndDate, g
638
638
  export { fetchCompanyTaskManagerView, fetchTaskManagerMetrics, getCompanyTaskManagerView, createTaskFromTaskGroupTemplate, };
639
639
  export { InternationalWireVerificationFormOrder, sortVerificationFormFields, fetchInternationalVerificationForm, submitInternationalVerificationForm, updateVerificationFormLocalData, getIntlWireVerificationView, };
640
640
  export { InternationalWireVerificationBooleanWithSubfieldsFieldNameList, InternationalWireVerificationBooleanWithSubfieldsFieldNames, InternationalWireVerificationControllingPersonFieldName, InternationalWireVerificationFormFieldNames, InternationalWireVerificationStakeHolderFieldName, InternationalWireVerificationSubfieldNames, } from './view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationFieldConstants';
641
+ export { IntlWireVerificationLocalDataSuffix, toIntlWireVerificationFormDetails, toIntlWireVerificationSubmitPayload, } from './view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSubmitPayload';
641
642
  export { fetchExpressPayInitialDetails, updateExpressPayFormLocalData, submitExpressPay, resetExpressPayLocalData, getExpressPayView, };
642
643
  export { acceptTreasuryTerms, fetchTreasurySetupView, clearTreasurySetupView, fetchTreasuryFunds, updatePortfolioAllocation, fetchPortfolioAllocation, updateFundAllocationLocalData, updateTreasuryPromoIntroClosedByOutsideClick, updateTreasuryPromoRemindMeLaterClicked, updateTreasuryVideoViewed, getTreasurySetupViewDetails, getTreasuryFundsMaximumYield, };
643
644
  // ── AI Accountant Entity ──
@@ -3,6 +3,7 @@ import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
3
  import { updateInternationalWireOnboardingStatus } from '../../../../../entity/company/companyReducer';
4
4
  import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
5
5
  import { createZeniAPIStatus, isSuccessResponse, } from '../../../../../responsePayload';
6
+ import { toIntlWireVerificationSubmitPayload } from '../internationalWireVerificationSubmitPayload';
6
7
  import { submitInternationalVerificationForm, updateVerificationFormSubmissionStatus, } from '../internationalWireVerificationReducer';
7
8
  export const submitIntlVerificationEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(submitInternationalVerificationForm.match), switchMap((action) => {
8
9
  const { internationalWireVerificationState } = state$.value;
@@ -10,7 +11,7 @@ export const submitIntlVerificationEpic = (actions$, state$, zeniAPI) => actions
10
11
  const localData = internationalWireVerificationState.verificationFormLocalData;
11
12
  if (localData != null) {
12
13
  return zeniAPI
13
- .postAndGetJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/international-wire/onboarding`, toIntlWireVerificationPayload(localData))
14
+ .postAndGetJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/international-wire/onboarding`, toIntlWireVerificationSubmitPayload(localData))
14
15
  .pipe(mergeMap((response) => {
15
16
  const actions = [];
16
17
  if (isSuccessResponse(response) && response.data != null) {
@@ -54,9 +55,3 @@ export const submitIntlVerificationEpic = (actions$, state$, zeniAPI) => actions
54
55
  return from([]);
55
56
  }
56
57
  }));
57
- const toIntlWireVerificationPayload = (localData) => {
58
- return {
59
- is_applicant_declaration: true,
60
- form_details: localData,
61
- };
62
- };
@@ -0,0 +1,154 @@
1
+ import { InternationalWireVerificationBooleanWithSubfieldsFieldNames, InternationalWireVerificationFormFieldNames, InternationalWireVerificationSubfieldNames, } from './internationalWireVerificationFieldConstants';
2
+ export const IntlWireVerificationLocalDataSuffix = {
3
+ documentOption: '_option',
4
+ documentBack: '_back',
5
+ nameFirst: '_first_name',
6
+ nameLast: '_last_name',
7
+ };
8
+ const MULTI_OPTION_FILE_FIELD_NAMES = new Set([
9
+ InternationalWireVerificationFormFieldNames.businessOwnership,
10
+ InternationalWireVerificationFormFieldNames.companyProofOfAddress,
11
+ InternationalWireVerificationFormFieldNames.companyOfficerProofOfAddress,
12
+ ]);
13
+ const BOOLEAN_WITH_SUBFIELDS_FIELD_NAMES = new Set([
14
+ InternationalWireVerificationBooleanWithSubfieldsFieldNames.stakeHolder,
15
+ InternationalWireVerificationBooleanWithSubfieldsFieldNames.controllingPerson,
16
+ ]);
17
+ const FILE_SUBFIELD_NAMES = new Set([
18
+ InternationalWireVerificationSubfieldNames.proofOfIdentity,
19
+ InternationalWireVerificationSubfieldNames.proofOfAddress,
20
+ ]);
21
+ const isInternalLocalDataKey = (key) => key.endsWith(IntlWireVerificationLocalDataSuffix.documentOption) ||
22
+ key.endsWith(IntlWireVerificationLocalDataSuffix.documentBack) ||
23
+ key.endsWith(IntlWireVerificationLocalDataSuffix.nameFirst) ||
24
+ key.endsWith(IntlWireVerificationLocalDataSuffix.nameLast);
25
+ const isPersonSubfieldKey = (key) => key.startsWith(`${InternationalWireVerificationBooleanWithSubfieldsFieldNames.stakeHolder}_`) ||
26
+ key.startsWith(`${InternationalWireVerificationBooleanWithSubfieldsFieldNames.controllingPerson}_`);
27
+ const toFileOptionPayloads = (localData, baseKey) => {
28
+ const option = localData[`${baseKey}${IntlWireVerificationLocalDataSuffix.documentOption}`];
29
+ if (typeof option !== 'string' || option.length === 0) {
30
+ return undefined;
31
+ }
32
+ const payloads = [];
33
+ const frontFileId = localData[baseKey];
34
+ if (typeof frontFileId === 'string' && frontFileId.length > 0) {
35
+ payloads.push({ file_id: frontFileId, option });
36
+ }
37
+ const backFileId = localData[`${baseKey}${IntlWireVerificationLocalDataSuffix.documentBack}`];
38
+ if (typeof backFileId === 'string' && backFileId.length > 0) {
39
+ payloads.push({ file_id: backFileId, option });
40
+ }
41
+ return payloads.length > 0 ? payloads : undefined;
42
+ };
43
+ const buildPersonPayload = (localData, keyPrefix) => {
44
+ const person = {};
45
+ const nameBaseKey = `${keyPrefix}_${InternationalWireVerificationSubfieldNames.name}`;
46
+ const firstName = localData[`${nameBaseKey}${IntlWireVerificationLocalDataSuffix.nameFirst}`];
47
+ const lastName = localData[`${nameBaseKey}${IntlWireVerificationLocalDataSuffix.nameLast}`];
48
+ if (typeof firstName === 'string' || typeof lastName === 'string') {
49
+ person.name = {
50
+ first_name: typeof firstName === 'string' ? firstName : '',
51
+ last_name: typeof lastName === 'string' ? lastName : '',
52
+ };
53
+ }
54
+ const assignStringField = (subfieldName, assign) => {
55
+ const value = localData[`${keyPrefix}_${subfieldName}`];
56
+ if (typeof value === 'string' && value.length > 0) {
57
+ assign(value);
58
+ }
59
+ };
60
+ assignStringField(InternationalWireVerificationSubfieldNames.nationality, (value) => {
61
+ person.nationality = value;
62
+ });
63
+ assignStringField(InternationalWireVerificationSubfieldNames.email, (value) => {
64
+ person.email = value;
65
+ });
66
+ assignStringField(InternationalWireVerificationSubfieldNames.companyRole, (value) => {
67
+ person.company_role = value;
68
+ });
69
+ assignStringField(InternationalWireVerificationSubfieldNames.ssn, (value) => {
70
+ person.ssn = value;
71
+ });
72
+ assignStringField(InternationalWireVerificationSubfieldNames.dateOfBirth, (value) => {
73
+ person.date_of_birth = value;
74
+ });
75
+ const ownershipValue = localData[`${keyPrefix}_${InternationalWireVerificationSubfieldNames.ownershipPercentage}`];
76
+ if (ownershipValue != null && ownershipValue !== '') {
77
+ person.ownership_percentage = Number(ownershipValue);
78
+ }
79
+ FILE_SUBFIELD_NAMES.forEach((subfieldName) => {
80
+ const filePayloads = toFileOptionPayloads(localData, `${keyPrefix}_${subfieldName}`);
81
+ if (filePayloads != null) {
82
+ if (subfieldName ===
83
+ InternationalWireVerificationSubfieldNames.proofOfIdentity) {
84
+ person.proof_of_identity = filePayloads;
85
+ }
86
+ else {
87
+ person.proof_of_address = filePayloads;
88
+ }
89
+ }
90
+ });
91
+ return person;
92
+ };
93
+ const getStakeHolderOwnerIndices = (localData) => {
94
+ const stakeHolderPrefix = `${InternationalWireVerificationBooleanWithSubfieldsFieldNames.stakeHolder}_`;
95
+ const indices = new Set();
96
+ Object.keys(localData).forEach((key) => {
97
+ const match = key.match(/^stake_holder_(\d+)_/);
98
+ if (match != null) {
99
+ indices.add(Number.parseInt(match[1], 10));
100
+ }
101
+ });
102
+ if (indices.size === 0) {
103
+ const hasUnindexedStakeHolderData = Object.keys(localData).some((key) => key.startsWith(stakeHolderPrefix) &&
104
+ !/^stake_holder_(true|false)$/.test(key));
105
+ if (hasUnindexedStakeHolderData) {
106
+ indices.add(0);
107
+ }
108
+ }
109
+ return Array.from(indices).sort((a, b) => a - b);
110
+ };
111
+ const hasPersonPayloadData = (person) => Object.keys(person).length > 0;
112
+ export const toIntlWireVerificationFormDetails = (localData) => {
113
+ const formDetails = {};
114
+ Object.entries(localData).forEach(([key, value]) => {
115
+ if (BOOLEAN_WITH_SUBFIELDS_FIELD_NAMES.has(key) ||
116
+ isInternalLocalDataKey(key) ||
117
+ isPersonSubfieldKey(key)) {
118
+ return;
119
+ }
120
+ if (MULTI_OPTION_FILE_FIELD_NAMES.has(key)) {
121
+ const filePayloads = toFileOptionPayloads(localData, key);
122
+ if (filePayloads != null) {
123
+ formDetails[key] = filePayloads;
124
+ }
125
+ return;
126
+ }
127
+ if (value == null || value === '') {
128
+ return;
129
+ }
130
+ formDetails[key] = value;
131
+ });
132
+ const stakeHolderSelection = localData[InternationalWireVerificationBooleanWithSubfieldsFieldNames.stakeHolder];
133
+ if (stakeHolderSelection === 'true') {
134
+ formDetails[InternationalWireVerificationBooleanWithSubfieldsFieldNames.stakeHolder] = getStakeHolderOwnerIndices(localData)
135
+ .map((ownerIndex) => buildPersonPayload(localData, `${InternationalWireVerificationBooleanWithSubfieldsFieldNames.stakeHolder}_${ownerIndex}`))
136
+ .filter(hasPersonPayloadData);
137
+ }
138
+ else if (stakeHolderSelection === 'false') {
139
+ formDetails[InternationalWireVerificationBooleanWithSubfieldsFieldNames.stakeHolder] = [];
140
+ }
141
+ const controllingPersonSelection = localData[InternationalWireVerificationBooleanWithSubfieldsFieldNames
142
+ .controllingPerson];
143
+ if (controllingPersonSelection === 'false') {
144
+ const controllingPerson = buildPersonPayload(localData, InternationalWireVerificationBooleanWithSubfieldsFieldNames.controllingPerson);
145
+ if (hasPersonPayloadData(controllingPerson)) {
146
+ formDetails[InternationalWireVerificationBooleanWithSubfieldsFieldNames.controllingPerson] = controllingPerson;
147
+ }
148
+ }
149
+ return formDetails;
150
+ };
151
+ export const toIntlWireVerificationSubmitPayload = (localData) => ({
152
+ is_applicant_declaration: true,
153
+ form_details: toIntlWireVerificationFormDetails(localData),
154
+ });
package/lib/index.d.ts CHANGED
@@ -571,8 +571,8 @@ import { TopExAccount, TopExReport, TopExTimePeriodWithMetaData, TopExpenses } f
571
571
  */
572
572
  import { TOP_EX_TIME_PERIODS, TopExTimePeriod, TopExpense } from './view/topEx/topExState';
573
573
  import { AccountingProviderAttachmentSelector, getAccountingProviderAttachment } from './view/transactionDetail/getAccountingProviderAttachmentSelector';
574
- import { getChangedLineItemCountFromLocalData, isAccountUncategorized } from './view/transactionDetail/transactionDetailLocalDataHelper';
575
574
  import { JOURNAL_ENTRY_SORT_KEYS, JournalEntryRowSortConfig, JournalEntrySortAccessors, JournalEntrySortKey, filterJournalEntryLinesExcludingLinked, journalEntryDefaultSortConfig, journalEntryTotalsByPostingSide, sortJournalEntryLines, sumJournalEntryAmounts, toJournalEntrySortKey } from './view/transactionDetail/journalEntryLinesViewModel';
575
+ import { getChangedLineItemCountFromLocalData, isAccountUncategorized } from './view/transactionDetail/transactionDetailLocalDataHelper';
576
576
  import { clearTransactionDetailSaveStatus, deleteTransactionAttachment, downloadAccountingProviderAttachment, downloadAccountingProviderAttachmentFailure, downloadAccountingProviderAttachmentSuccess, fetchTransactionDetail, initializeTransactionDetailLocalData, markCategoryClassRecommendationsFailureForTransactionDetail, removeEntityRecommendationForLineIdForTransactionDetail, resetAllLineItemsToVendor, resetLineItemsCategoryClassInLocalData, resetSelectedCustomer, resetVendor, saveTransactionDetail, saveTransactionDetailLocalData, setAllLineItemsLocalDataIsUpdateAllChecked, setAllLineItemsToCategoryClassInLocalData, setIsVendorUpdateAllChecked, updateLatestSelectedEntity, updateLocalDataWithTransactionsUpdateWithVendorCheckbox, updateSelectedCustomer, updateSelectedVendor, updateTransactionDetail, updateVendorBulkRecommendationsFetchStatus, updateVendorToAllLineItems, uploadMissingAttachmentSuccess } from './view/transactionDetail/transactionDetailReducer';
577
577
  import { TransactionDetailReport, VendorDetailsView, getInitialUpdatablePeriodsForTransactionRecommendations, getTransactionDetail, getTransactionDetailForTransaction } from './view/transactionDetail/transactionDetailSelector';
578
578
  import { TransactionUpdates, getThirdPartyIdFromTransactionId } from './view/transactionDetail/transactionDetailState';
@@ -899,6 +899,7 @@ export { fetchCompanyTaskManagerView, fetchTaskManagerMetrics, CompanyTaskManage
899
899
  export { Country };
900
900
  export { InternationalWireVerificationState, VerificationFormField, VerificationFormFieldOption, VerificationFormLocalData, VerificationFormSubField, FieldValueType, InternationalWireVerificationFormOrder, sortVerificationFormFields, fetchInternationalVerificationForm, submitInternationalVerificationForm, updateVerificationFormLocalData, getIntlWireVerificationView, InternationalWireVerificationView, };
901
901
  export { InternationalWireVerificationBooleanWithSubfieldsFieldNameList, InternationalWireVerificationBooleanWithSubfieldsFieldNames, InternationalWireVerificationControllingPersonFieldName, InternationalWireVerificationFormFieldNames, InternationalWireVerificationStakeHolderFieldName, InternationalWireVerificationSubfieldNames, } from './view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationFieldConstants';
902
+ export { IntlWireVerificationLocalDataSuffix, toIntlWireVerificationFormDetails, toIntlWireVerificationSubmitPayload, } from './view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSubmitPayload';
902
903
  export type { InternationalWireVerificationBooleanWithSubfieldsFieldName, InternationalWireVerificationFormFieldName, InternationalWireVerificationSubfieldName, } from './view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationFieldConstants';
903
904
  export { fetchExpressPayInitialDetails, updateExpressPayFormLocalData, submitExpressPay, resetExpressPayLocalData, ExpressPayFormLocalData, ExpressPayView, getExpressPayView, };
904
905
  export { acceptTreasuryTerms, fetchTreasurySetupView, clearTreasurySetupView, fetchTreasuryFunds, updatePortfolioAllocation, fetchPortfolioAllocation, updateFundAllocationLocalData, updateTreasuryPromoIntroClosedByOutsideClick, updateTreasuryPromoRemindMeLaterClicked, updateTreasuryVideoViewed, FundAllocationOption, FundComposition, FundData, TreasurySetupView, getTreasurySetupViewDetails, getTreasuryFundsMaximumYield, };
package/lib/index.js CHANGED
@@ -69,10 +69,10 @@ exports.getDefaultSelectedTimeframeForScheduleType = exports.getFetchStateForSch
69
69
  exports.getTaskDetail = exports.fetchTaskListPage = exports.getAllTasks = exports.getTaskGroupById = exports.toRecurringBillFrequencyStrict = exports.toRecurringBillFrequency = exports.updateArAgingNodeCollapseState = exports.getArAgingDetailForCustomer = exports.getArAgingReport = exports.updateArAgingDetailUIState = exports.fetchArAgingDetail = exports.updateArAgingUIState = exports.fetchArAging = exports.updateVendorGlobalReviewViewLocalData = exports.toVendorGlobalReviewColumnSortKeyType = exports.getTenantMerchantByMerchantId = exports.getVendorGlobalReviewView = exports.updateVendorGlobalReviewViewUIState = exports.updateSelectedGlobalMerchant = exports.fetchVendorGlobalReviewView = exports.rejectVendorGlobalReview = exports.approveVendorGlobalReview = exports.getGlobalMerchantView = exports.clearGlobalMerchantView = exports.updateCreateGlobalMerchantLocalData = exports.createGlobalMerchant = exports.fetchGlobalMerchantRecommendation = exports.getVendorDetailSelectorView = exports.saveVendorDetailsView = exports.updateReviewVendorDetailLocalData = exports.clearGlobalMerchantAutoCompleteResults = exports.fetchGlobalMerchantAutoCompleteView = exports.updateVendorFirstReviewSortUiState = exports.updateVendorFirstReviewViewLocalData = exports.saveVendorFirstReviewView = exports.clearRecentlySavedErroredVendorData = exports.updateVendorFirstReviewViewPageToken = exports.resetVendorFirstReviewLocalData = exports.updateVendorFirstReviewViewScrollYOffset = exports.fetchVendorFirstReviewAttachments = exports.fetchVendorFirstReviewView = exports.getVendorFirstReviewAttachmentView = exports.getVendorFirstReviewView = exports.getGlobalMerchantAutoCompleteResults = exports.toVendorFirstReviewViewColumnKeyType = exports.getVendorTabView = exports.updateVendorTabViewTab = exports.fetchVendorTabView = exports.resetMarkAsCompleteStatus = exports.markAsCompleteScheduleDetail = void 0;
70
70
  exports.fetchPaymentSources = exports.addCardPaymentSource = exports.confirmCardSetupIntent = exports.createCardSetupIntent = exports.getAllCardsAndBankPaymentMethods = exports.deleteTag = exports.createTag = exports.fetchTagList = exports.getAllTags = exports.ALL_TASK_LIST_TABS = exports.initialTaskDetailLocalData = exports.convertHHMMStrToMinutes = exports.unsnoozeTask = exports.snoozeTask = exports.removeTaskFromList = exports.updateTaskListTab = exports.updateTaskFromListView = exports.toDueDateGroupKeyType = exports.toTaskStatusCodeType = exports.toPriorityCodeType = exports.getDueDateValueFromDueDateGroupId = exports.initialTaskDetail = exports.fetchAllTaskGroups = exports.getTaskUpdates = exports.toTaskListGroupByKeyTypeStrict = exports.toTaskListGroupByKeyType = exports.updateTaskGroupName = exports.dragNDropTasks = exports.updateTaskListLocalData = exports.deleteTaskGroup = exports.initiateTaskListLocalData = exports.createNewTaskGroup = exports.bulkUpdateTaskList = exports.discardTaskUpdatesInLocalStore = exports.deleteTask = exports.TASK_LIST_GROUP_BY_CATEGORIES = exports.TASK_LIST_FILTER_CATEGORIES = exports.updateTaskFilters = exports.allTaskPriority = exports.allTaskStatus = exports.updateTaskListUIState = exports.updateTaskListSearchText = exports.getCannedResponsesView = exports.deleteCannedResponse = exports.saveCannedResponse = exports.fetchCannedResponses = exports.archiveTask = exports.saveTaskDetail = exports.saveTaskUpdatesToLocalStore = exports.fetchTaskDetailPage = void 0;
71
71
  exports.getInviteFormView = exports.getReferralListView = exports.getNotifications = exports.getLastNotificationTime = exports.pushToastNotification = exports.isFeatureInterestRegistered = exports.getRegisteredInterestsByFeature = exports.getRegisteredInterests = exports.getFeatureNotificationView = exports.notifyMeForFeature = exports.fetchRegisteredInterests = exports.clearFeatureNotificationView = exports.getNotificationsForSelectedSubTab = exports.getExternalNotificationsForSelectedSubTab = exports.getNotificationView = exports.updateNotificationViewUIState = exports.updateNotificationViewSubTab = exports.updateNotificationViewCurrentTabAndSubTab = exports.updateNotificationViewTabState = exports.updateNotificationViewNotificationStatus = exports.updateNotificationViewAllNotificationsStatus = exports.fetchNotificationUnreadCountSuccess = exports.fetchNotificationUnreadCount = exports.fetchNotificationView = exports.toNotificationTabTypeStrict = exports.toNotificationSubTabTypeStrict = exports.updateCommentsNotificationsStatuses = exports.updateCommentsNotifications = exports.toNotificationModeStrict = exports.parseOAuthParams = exports.getZeniOAuthApproveRedirectUrl = exports.getZeniOAuthApproveFetchState = exports.getZeniOAuthApproveError = exports.clearZeniOAuthView = exports.approveOAuthConsentSuccess = exports.approveOAuthConsentFailure = exports.approveOAuthConsent = exports.fetchZeniAccountsPromoCard = exports.getZeniAccountsPromoCard = exports.getAuthenticationView = exports.fetchCollaborationAuthToken = exports.clearAuditReportGroupViewByCompanyId = exports.saveReasonForAuditRule = exports.fetchAuditReportGroupView = exports.fetchAuditRuleGroupView = exports.getUserFromAllUsers = exports.getAuditRuleGroupViewSelectorView = exports.getAuditReportGroupViewSelectorView = exports.clearCardPaymentView = exports.resetCardPaymentErrorStatuses = void 0;
72
- exports.getTreasurySetupViewDetails = exports.updateTreasuryVideoViewed = exports.updateTreasuryPromoRemindMeLaterClicked = exports.updateTreasuryPromoIntroClosedByOutsideClick = exports.updateFundAllocationLocalData = exports.fetchPortfolioAllocation = exports.updatePortfolioAllocation = exports.fetchTreasuryFunds = exports.clearTreasurySetupView = exports.fetchTreasurySetupView = exports.acceptTreasuryTerms = exports.getExpressPayView = exports.resetExpressPayLocalData = exports.submitExpressPay = exports.updateExpressPayFormLocalData = exports.fetchExpressPayInitialDetails = exports.InternationalWireVerificationSubfieldNames = exports.InternationalWireVerificationStakeHolderFieldName = exports.InternationalWireVerificationFormFieldNames = exports.InternationalWireVerificationControllingPersonFieldName = exports.InternationalWireVerificationBooleanWithSubfieldsFieldNames = exports.InternationalWireVerificationBooleanWithSubfieldsFieldNameList = exports.getIntlWireVerificationView = exports.updateVerificationFormLocalData = exports.submitInternationalVerificationForm = exports.fetchInternationalVerificationForm = exports.sortVerificationFormFields = exports.InternationalWireVerificationFormOrder = exports.createTaskFromTaskGroupTemplate = exports.getCompanyTaskManagerView = exports.fetchTaskManagerMetrics = exports.fetchCompanyTaskManagerView = exports.toRecurringFrequency = exports.toDayOfWeek = exports.getRecurringEndDateFromCount = exports.getMinAllowedEndDate = exports.SEMI_WEEKLY_REQUIRED_DAYS_COUNT = exports.ALL_WEEK_DAYS = exports.updateReferViewed = exports.getRewardsPlanCard = exports.fetchRewardsPlan = exports.resendReferralInvite = exports.updateReferralListSortUiState = exports.saveReferralFormDataInLocalStore = exports.clearReferrals = exports.sendReferralInvite = exports.fetchReferrals = exports.AmountStatusTypes = exports.StatusTypes = exports.toReferralListViewSortKeyType = void 0;
73
- exports.setSessions = exports.setNewSession = exports.getSuggestedQuestionsForPageContext = exports.getAiCfoView = exports.clearAiCfoSidePanelHostPageContext = exports.applyAiCfoSidePanelHostPageTransition = exports.fetchSuggestedQuestionsFailure = exports.fetchSuggestedQuestionsSuccess = exports.fetchSuggestedQuestions = exports.updateResponseState = exports.deleteChatSession = exports.acceptMasterTOS = exports.fetchChatHistory = exports.stopSubmitQuestion = exports.stopSubmit = exports.createSessionAndSubmit = exports.clearLastContextMessage = exports.clearDeleteChatSessionStatus = exports.clearCurrentSessionId = exports.clearAiCfoView = exports.setSession = exports.clearInput = exports.updateCotCollapsedState = exports.updateCurrentInput = exports.updateAiCfoViewScrollPosition = exports.submitQuestion = exports.createSession = exports.fetchChatSessionsForUser = exports.getAiAccountantCockpitView = exports.updateAiAccountantUIState = exports.triggerAiAccountantJob = exports.setSelectedTenantIdsForJobTrigger = exports.fetchAiAccountantJobs = exports.fetchAiAccountantCustomers = exports.clearAiAccountantView = exports.cancelAiAccountantOnboarding = exports.getAiAccountantJobsByTenantId = exports.getAiAccountantCustomers = exports.updateAiAccountantJobs = exports.updateAiAccountantCustomer = exports.updateAiAccountantCustomers = exports.clearAllAiAccountantCustomers = exports.toAiAccountantJob = exports.toAiAccountantEnrollment = exports.toAiAccountantCustomer = exports.toAiAccountantOperationType = exports.toAiAccountantJobStatus = exports.toAiAccountantEnrollmentStatus = exports.getAllowedOperationsForStatus = exports.getTreasuryFundsMaximumYield = void 0;
74
- exports.fetchTransactionActivityLog = exports.BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = exports.BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = exports.getAutoTransferRuleHistory = exports.getAutoTransferRuleById = exports.getAutoTransferRules = exports.clearRuleUpdateLocalData = exports.updateRuleLocalData = exports.fetchAutoTransferReviewDetail = exports.fetchAutoTransferRuleHistory = exports.deleteAutoTransferRule = exports.updateAutoTransferRule = exports.createAutoTransferRule = exports.fetchAutoTransferRules = exports.getTreasuryTaxLetters = exports.fetchTreasuryTaxLetterList = exports.getTreasuryStatements = exports.fetchTreasuryStatementList = exports.getTreasuryTransferMoney = exports.clearTreasuryTransferMoney = exports.updateTreasuryTransferMoneyLocalData = exports.executeTreasuryTransferMoney = exports.getTreasuryDetail = exports.updateTreasuryTransactionListUIState = exports.fetchTreasuryTransactionList = exports.fetchTreasuryOverviewDetail = exports.toMessageType = exports.toMessageSender = exports.toAiCfoAnswerResponseTypeStrict = exports.toAiCfoAnswerResponseType = exports.toAiCfoAnswerStateTypeStrict = exports.toAiCfoAnswerStateType = exports.toAiCfoChartTypeStrict = exports.toAiCfoChartType = exports.toAiCfoVisualizationTypeStrict = exports.toAiCfoVisualizationType = exports.ALL_AI_CFO_ANSWER_RESPONSE_TYPES = exports.ALL_AI_CFO_ANSWER_STATE_TYPES = exports.ALL_AI_CFO_VISUALIZATION_TYPES = exports.ALL_AI_CFO_CHARTS_TYPES = exports.getAiCfoSelectorView = exports.getAllQuestionsForChatSession = exports.getQuestionAnswerByIdForChatSession = exports.getAllQuestionAnswersForChatSession = exports.toAiCfoVisualization = exports.clearAiCfo = exports.clearSession = exports.addQuestionPayload = exports.upsertOrAddQuestionAnswerPayload = exports.upsertAnswerPayload = void 0;
75
- exports.DEFAULT_SESSION_CONFIG = exports.SessionManager = exports.getTransactionActivityLogView = void 0;
72
+ exports.updateTreasuryPromoIntroClosedByOutsideClick = exports.updateFundAllocationLocalData = exports.fetchPortfolioAllocation = exports.updatePortfolioAllocation = exports.fetchTreasuryFunds = exports.clearTreasurySetupView = exports.fetchTreasurySetupView = exports.acceptTreasuryTerms = exports.getExpressPayView = exports.resetExpressPayLocalData = exports.submitExpressPay = exports.updateExpressPayFormLocalData = exports.fetchExpressPayInitialDetails = exports.toIntlWireVerificationSubmitPayload = exports.toIntlWireVerificationFormDetails = exports.IntlWireVerificationLocalDataSuffix = exports.InternationalWireVerificationSubfieldNames = exports.InternationalWireVerificationStakeHolderFieldName = exports.InternationalWireVerificationFormFieldNames = exports.InternationalWireVerificationControllingPersonFieldName = exports.InternationalWireVerificationBooleanWithSubfieldsFieldNames = exports.InternationalWireVerificationBooleanWithSubfieldsFieldNameList = exports.getIntlWireVerificationView = exports.updateVerificationFormLocalData = exports.submitInternationalVerificationForm = exports.fetchInternationalVerificationForm = exports.sortVerificationFormFields = exports.InternationalWireVerificationFormOrder = exports.createTaskFromTaskGroupTemplate = exports.getCompanyTaskManagerView = exports.fetchTaskManagerMetrics = exports.fetchCompanyTaskManagerView = exports.toRecurringFrequency = exports.toDayOfWeek = exports.getRecurringEndDateFromCount = exports.getMinAllowedEndDate = exports.SEMI_WEEKLY_REQUIRED_DAYS_COUNT = exports.ALL_WEEK_DAYS = exports.updateReferViewed = exports.getRewardsPlanCard = exports.fetchRewardsPlan = exports.resendReferralInvite = exports.updateReferralListSortUiState = exports.saveReferralFormDataInLocalStore = exports.clearReferrals = exports.sendReferralInvite = exports.fetchReferrals = exports.AmountStatusTypes = exports.StatusTypes = exports.toReferralListViewSortKeyType = void 0;
73
+ exports.getAiCfoView = exports.clearAiCfoSidePanelHostPageContext = exports.applyAiCfoSidePanelHostPageTransition = exports.fetchSuggestedQuestionsFailure = exports.fetchSuggestedQuestionsSuccess = exports.fetchSuggestedQuestions = exports.updateResponseState = exports.deleteChatSession = exports.acceptMasterTOS = exports.fetchChatHistory = exports.stopSubmitQuestion = exports.stopSubmit = exports.createSessionAndSubmit = exports.clearLastContextMessage = exports.clearDeleteChatSessionStatus = exports.clearCurrentSessionId = exports.clearAiCfoView = exports.setSession = exports.clearInput = exports.updateCotCollapsedState = exports.updateCurrentInput = exports.updateAiCfoViewScrollPosition = exports.submitQuestion = exports.createSession = exports.fetchChatSessionsForUser = exports.getAiAccountantCockpitView = exports.updateAiAccountantUIState = exports.triggerAiAccountantJob = exports.setSelectedTenantIdsForJobTrigger = exports.fetchAiAccountantJobs = exports.fetchAiAccountantCustomers = exports.clearAiAccountantView = exports.cancelAiAccountantOnboarding = exports.getAiAccountantJobsByTenantId = exports.getAiAccountantCustomers = exports.updateAiAccountantJobs = exports.updateAiAccountantCustomer = exports.updateAiAccountantCustomers = exports.clearAllAiAccountantCustomers = exports.toAiAccountantJob = exports.toAiAccountantEnrollment = exports.toAiAccountantCustomer = exports.toAiAccountantOperationType = exports.toAiAccountantJobStatus = exports.toAiAccountantEnrollmentStatus = exports.getAllowedOperationsForStatus = exports.getTreasuryFundsMaximumYield = exports.getTreasurySetupViewDetails = exports.updateTreasuryVideoViewed = exports.updateTreasuryPromoRemindMeLaterClicked = void 0;
74
+ exports.getAutoTransferRuleHistory = exports.getAutoTransferRuleById = exports.getAutoTransferRules = exports.clearRuleUpdateLocalData = exports.updateRuleLocalData = exports.fetchAutoTransferReviewDetail = exports.fetchAutoTransferRuleHistory = exports.deleteAutoTransferRule = exports.updateAutoTransferRule = exports.createAutoTransferRule = exports.fetchAutoTransferRules = exports.getTreasuryTaxLetters = exports.fetchTreasuryTaxLetterList = exports.getTreasuryStatements = exports.fetchTreasuryStatementList = exports.getTreasuryTransferMoney = exports.clearTreasuryTransferMoney = exports.updateTreasuryTransferMoneyLocalData = exports.executeTreasuryTransferMoney = exports.getTreasuryDetail = exports.updateTreasuryTransactionListUIState = exports.fetchTreasuryTransactionList = exports.fetchTreasuryOverviewDetail = exports.toMessageType = exports.toMessageSender = exports.toAiCfoAnswerResponseTypeStrict = exports.toAiCfoAnswerResponseType = exports.toAiCfoAnswerStateTypeStrict = exports.toAiCfoAnswerStateType = exports.toAiCfoChartTypeStrict = exports.toAiCfoChartType = exports.toAiCfoVisualizationTypeStrict = exports.toAiCfoVisualizationType = exports.ALL_AI_CFO_ANSWER_RESPONSE_TYPES = exports.ALL_AI_CFO_ANSWER_STATE_TYPES = exports.ALL_AI_CFO_VISUALIZATION_TYPES = exports.ALL_AI_CFO_CHARTS_TYPES = exports.getAiCfoSelectorView = exports.getAllQuestionsForChatSession = exports.getQuestionAnswerByIdForChatSession = exports.getAllQuestionAnswersForChatSession = exports.toAiCfoVisualization = exports.clearAiCfo = exports.clearSession = exports.addQuestionPayload = exports.upsertOrAddQuestionAnswerPayload = exports.upsertAnswerPayload = exports.setSessions = exports.setNewSession = exports.getSuggestedQuestionsForPageContext = void 0;
75
+ exports.DEFAULT_SESSION_CONFIG = exports.SessionManager = exports.getTransactionActivityLogView = exports.fetchTransactionActivityLog = exports.BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = exports.BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = void 0;
76
76
  const allowedValue_1 = require("./commonStateTypes/allowedValue");
77
77
  Object.defineProperty(exports, "isAllowedValueWithCode", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithCode; } });
78
78
  Object.defineProperty(exports, "isAllowedValueWithID", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithID; } });
@@ -1943,9 +1943,6 @@ const topExState_1 = require("./view/topEx/topExState");
1943
1943
  Object.defineProperty(exports, "TOP_EX_TIME_PERIODS", { enumerable: true, get: function () { return topExState_1.TOP_EX_TIME_PERIODS; } });
1944
1944
  const getAccountingProviderAttachmentSelector_1 = require("./view/transactionDetail/getAccountingProviderAttachmentSelector");
1945
1945
  Object.defineProperty(exports, "getAccountingProviderAttachment", { enumerable: true, get: function () { return getAccountingProviderAttachmentSelector_1.getAccountingProviderAttachment; } });
1946
- const transactionDetailLocalDataHelper_1 = require("./view/transactionDetail/transactionDetailLocalDataHelper");
1947
- Object.defineProperty(exports, "getChangedLineItemCountFromLocalData", { enumerable: true, get: function () { return transactionDetailLocalDataHelper_1.getChangedLineItemCountFromLocalData; } });
1948
- Object.defineProperty(exports, "isAccountUncategorized", { enumerable: true, get: function () { return transactionDetailLocalDataHelper_1.isAccountUncategorized; } });
1949
1946
  const journalEntryLinesViewModel_1 = require("./view/transactionDetail/journalEntryLinesViewModel");
1950
1947
  Object.defineProperty(exports, "JOURNAL_ENTRY_SORT_KEYS", { enumerable: true, get: function () { return journalEntryLinesViewModel_1.JOURNAL_ENTRY_SORT_KEYS; } });
1951
1948
  Object.defineProperty(exports, "filterJournalEntryLinesExcludingLinked", { enumerable: true, get: function () { return journalEntryLinesViewModel_1.filterJournalEntryLinesExcludingLinked; } });
@@ -1954,6 +1951,9 @@ Object.defineProperty(exports, "journalEntryTotalsByPostingSide", { enumerable:
1954
1951
  Object.defineProperty(exports, "sortJournalEntryLines", { enumerable: true, get: function () { return journalEntryLinesViewModel_1.sortJournalEntryLines; } });
1955
1952
  Object.defineProperty(exports, "sumJournalEntryAmounts", { enumerable: true, get: function () { return journalEntryLinesViewModel_1.sumJournalEntryAmounts; } });
1956
1953
  Object.defineProperty(exports, "toJournalEntrySortKey", { enumerable: true, get: function () { return journalEntryLinesViewModel_1.toJournalEntrySortKey; } });
1954
+ const transactionDetailLocalDataHelper_1 = require("./view/transactionDetail/transactionDetailLocalDataHelper");
1955
+ Object.defineProperty(exports, "getChangedLineItemCountFromLocalData", { enumerable: true, get: function () { return transactionDetailLocalDataHelper_1.getChangedLineItemCountFromLocalData; } });
1956
+ Object.defineProperty(exports, "isAccountUncategorized", { enumerable: true, get: function () { return transactionDetailLocalDataHelper_1.isAccountUncategorized; } });
1957
1957
  const transactionDetailReducer_1 = require("./view/transactionDetail/transactionDetailReducer");
1958
1958
  Object.defineProperty(exports, "clearTransactionDetailSaveStatus", { enumerable: true, get: function () { return transactionDetailReducer_1.clearTransactionDetailSaveStatus; } });
1959
1959
  Object.defineProperty(exports, "deleteTransactionAttachment", { enumerable: true, get: function () { return transactionDetailReducer_1.deleteTransactionAttachment; } });
@@ -2224,6 +2224,10 @@ Object.defineProperty(exports, "InternationalWireVerificationControllingPersonFi
2224
2224
  Object.defineProperty(exports, "InternationalWireVerificationFormFieldNames", { enumerable: true, get: function () { return internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames; } });
2225
2225
  Object.defineProperty(exports, "InternationalWireVerificationStakeHolderFieldName", { enumerable: true, get: function () { return internationalWireVerificationFieldConstants_1.InternationalWireVerificationStakeHolderFieldName; } });
2226
2226
  Object.defineProperty(exports, "InternationalWireVerificationSubfieldNames", { enumerable: true, get: function () { return internationalWireVerificationFieldConstants_1.InternationalWireVerificationSubfieldNames; } });
2227
+ var internationalWireVerificationSubmitPayload_1 = require("./view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSubmitPayload");
2228
+ Object.defineProperty(exports, "IntlWireVerificationLocalDataSuffix", { enumerable: true, get: function () { return internationalWireVerificationSubmitPayload_1.IntlWireVerificationLocalDataSuffix; } });
2229
+ Object.defineProperty(exports, "toIntlWireVerificationFormDetails", { enumerable: true, get: function () { return internationalWireVerificationSubmitPayload_1.toIntlWireVerificationFormDetails; } });
2230
+ Object.defineProperty(exports, "toIntlWireVerificationSubmitPayload", { enumerable: true, get: function () { return internationalWireVerificationSubmitPayload_1.toIntlWireVerificationSubmitPayload; } });
2227
2231
  // ── AI Accountant Entity ──
2228
2232
  var aiAccountantCustomerState_1 = require("./entity/aiAccountantCustomer/aiAccountantCustomerState");
2229
2233
  Object.defineProperty(exports, "getAllowedOperationsForStatus", { enumerable: true, get: function () { return aiAccountantCustomerState_1.getAllowedOperationsForStatus; } });
@@ -6,6 +6,7 @@ const operators_1 = require("rxjs/operators");
6
6
  const companyReducer_1 = require("../../../../../entity/company/companyReducer");
7
7
  const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
8
8
  const responsePayload_1 = require("../../../../../responsePayload");
9
+ const internationalWireVerificationSubmitPayload_1 = require("../internationalWireVerificationSubmitPayload");
9
10
  const internationalWireVerificationReducer_1 = require("../internationalWireVerificationReducer");
10
11
  const submitIntlVerificationEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(internationalWireVerificationReducer_1.submitInternationalVerificationForm.match), (0, operators_1.switchMap)((action) => {
11
12
  const { internationalWireVerificationState } = state$.value;
@@ -13,7 +14,7 @@ const submitIntlVerificationEpic = (actions$, state$, zeniAPI) => actions$.pipe(
13
14
  const localData = internationalWireVerificationState.verificationFormLocalData;
14
15
  if (localData != null) {
15
16
  return zeniAPI
16
- .postAndGetJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/international-wire/onboarding`, toIntlWireVerificationPayload(localData))
17
+ .postAndGetJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/international-wire/onboarding`, (0, internationalWireVerificationSubmitPayload_1.toIntlWireVerificationSubmitPayload)(localData))
17
18
  .pipe((0, operators_1.mergeMap)((response) => {
18
19
  const actions = [];
19
20
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
@@ -58,9 +59,3 @@ const submitIntlVerificationEpic = (actions$, state$, zeniAPI) => actions$.pipe(
58
59
  }
59
60
  }));
60
61
  exports.submitIntlVerificationEpic = submitIntlVerificationEpic;
61
- const toIntlWireVerificationPayload = (localData) => {
62
- return {
63
- is_applicant_declaration: true,
64
- form_details: localData,
65
- };
66
- };
@@ -5,7 +5,8 @@ export interface InternationalWireVerificationState {
5
5
  verificationFormLocalData: VerificationFormLocalData;
6
6
  verificationFormSubmitState: FetchStateAndError;
7
7
  }
8
- export type VerificationFormLocalData = Record<string, string | string[]>;
8
+ export type VerificationFormLocalDataValue = string | string[] | number;
9
+ export type VerificationFormLocalData = Record<string, VerificationFormLocalDataValue>;
9
10
  export interface FieldValueType {
10
11
  code: string;
11
12
  description: string;
@@ -0,0 +1,32 @@
1
+ import { VerificationFormLocalData } from './internationalWireVerificationState';
2
+ export interface IntlWireFileOptionPayload {
3
+ file_id: string;
4
+ option: string;
5
+ }
6
+ export interface IntlWirePersonNamePayload {
7
+ first_name: string;
8
+ last_name: string;
9
+ }
10
+ export interface IntlWirePersonPayload {
11
+ company_role?: string;
12
+ date_of_birth?: string;
13
+ email?: string;
14
+ name?: IntlWirePersonNamePayload;
15
+ nationality?: string;
16
+ ownership_percentage?: number;
17
+ proof_of_address?: IntlWireFileOptionPayload[];
18
+ proof_of_identity?: IntlWireFileOptionPayload[];
19
+ ssn?: string;
20
+ }
21
+ export type IntlWireFormDetailsPayload = Record<string, string | string[] | number | IntlWireFileOptionPayload[] | IntlWirePersonPayload | IntlWirePersonPayload[]>;
22
+ export declare const IntlWireVerificationLocalDataSuffix: {
23
+ readonly documentOption: "_option";
24
+ readonly documentBack: "_back";
25
+ readonly nameFirst: "_first_name";
26
+ readonly nameLast: "_last_name";
27
+ };
28
+ export declare const toIntlWireVerificationFormDetails: (localData: VerificationFormLocalData) => IntlWireFormDetailsPayload;
29
+ export declare const toIntlWireVerificationSubmitPayload: (localData: VerificationFormLocalData) => {
30
+ is_applicant_declaration: boolean;
31
+ form_details: IntlWireFormDetailsPayload;
32
+ };
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toIntlWireVerificationSubmitPayload = exports.toIntlWireVerificationFormDetails = exports.IntlWireVerificationLocalDataSuffix = void 0;
4
+ const internationalWireVerificationFieldConstants_1 = require("./internationalWireVerificationFieldConstants");
5
+ exports.IntlWireVerificationLocalDataSuffix = {
6
+ documentOption: '_option',
7
+ documentBack: '_back',
8
+ nameFirst: '_first_name',
9
+ nameLast: '_last_name',
10
+ };
11
+ const MULTI_OPTION_FILE_FIELD_NAMES = new Set([
12
+ internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.businessOwnership,
13
+ internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.companyProofOfAddress,
14
+ internationalWireVerificationFieldConstants_1.InternationalWireVerificationFormFieldNames.companyOfficerProofOfAddress,
15
+ ]);
16
+ const BOOLEAN_WITH_SUBFIELDS_FIELD_NAMES = new Set([
17
+ internationalWireVerificationFieldConstants_1.InternationalWireVerificationBooleanWithSubfieldsFieldNames.stakeHolder,
18
+ internationalWireVerificationFieldConstants_1.InternationalWireVerificationBooleanWithSubfieldsFieldNames.controllingPerson,
19
+ ]);
20
+ const FILE_SUBFIELD_NAMES = new Set([
21
+ internationalWireVerificationFieldConstants_1.InternationalWireVerificationSubfieldNames.proofOfIdentity,
22
+ internationalWireVerificationFieldConstants_1.InternationalWireVerificationSubfieldNames.proofOfAddress,
23
+ ]);
24
+ const isInternalLocalDataKey = (key) => key.endsWith(exports.IntlWireVerificationLocalDataSuffix.documentOption) ||
25
+ key.endsWith(exports.IntlWireVerificationLocalDataSuffix.documentBack) ||
26
+ key.endsWith(exports.IntlWireVerificationLocalDataSuffix.nameFirst) ||
27
+ key.endsWith(exports.IntlWireVerificationLocalDataSuffix.nameLast);
28
+ const isPersonSubfieldKey = (key) => key.startsWith(`${internationalWireVerificationFieldConstants_1.InternationalWireVerificationBooleanWithSubfieldsFieldNames.stakeHolder}_`) ||
29
+ key.startsWith(`${internationalWireVerificationFieldConstants_1.InternationalWireVerificationBooleanWithSubfieldsFieldNames.controllingPerson}_`);
30
+ const toFileOptionPayloads = (localData, baseKey) => {
31
+ const option = localData[`${baseKey}${exports.IntlWireVerificationLocalDataSuffix.documentOption}`];
32
+ if (typeof option !== 'string' || option.length === 0) {
33
+ return undefined;
34
+ }
35
+ const payloads = [];
36
+ const frontFileId = localData[baseKey];
37
+ if (typeof frontFileId === 'string' && frontFileId.length > 0) {
38
+ payloads.push({ file_id: frontFileId, option });
39
+ }
40
+ const backFileId = localData[`${baseKey}${exports.IntlWireVerificationLocalDataSuffix.documentBack}`];
41
+ if (typeof backFileId === 'string' && backFileId.length > 0) {
42
+ payloads.push({ file_id: backFileId, option });
43
+ }
44
+ return payloads.length > 0 ? payloads : undefined;
45
+ };
46
+ const buildPersonPayload = (localData, keyPrefix) => {
47
+ const person = {};
48
+ const nameBaseKey = `${keyPrefix}_${internationalWireVerificationFieldConstants_1.InternationalWireVerificationSubfieldNames.name}`;
49
+ const firstName = localData[`${nameBaseKey}${exports.IntlWireVerificationLocalDataSuffix.nameFirst}`];
50
+ const lastName = localData[`${nameBaseKey}${exports.IntlWireVerificationLocalDataSuffix.nameLast}`];
51
+ if (typeof firstName === 'string' || typeof lastName === 'string') {
52
+ person.name = {
53
+ first_name: typeof firstName === 'string' ? firstName : '',
54
+ last_name: typeof lastName === 'string' ? lastName : '',
55
+ };
56
+ }
57
+ const assignStringField = (subfieldName, assign) => {
58
+ const value = localData[`${keyPrefix}_${subfieldName}`];
59
+ if (typeof value === 'string' && value.length > 0) {
60
+ assign(value);
61
+ }
62
+ };
63
+ assignStringField(internationalWireVerificationFieldConstants_1.InternationalWireVerificationSubfieldNames.nationality, (value) => {
64
+ person.nationality = value;
65
+ });
66
+ assignStringField(internationalWireVerificationFieldConstants_1.InternationalWireVerificationSubfieldNames.email, (value) => {
67
+ person.email = value;
68
+ });
69
+ assignStringField(internationalWireVerificationFieldConstants_1.InternationalWireVerificationSubfieldNames.companyRole, (value) => {
70
+ person.company_role = value;
71
+ });
72
+ assignStringField(internationalWireVerificationFieldConstants_1.InternationalWireVerificationSubfieldNames.ssn, (value) => {
73
+ person.ssn = value;
74
+ });
75
+ assignStringField(internationalWireVerificationFieldConstants_1.InternationalWireVerificationSubfieldNames.dateOfBirth, (value) => {
76
+ person.date_of_birth = value;
77
+ });
78
+ const ownershipValue = localData[`${keyPrefix}_${internationalWireVerificationFieldConstants_1.InternationalWireVerificationSubfieldNames.ownershipPercentage}`];
79
+ if (ownershipValue != null && ownershipValue !== '') {
80
+ person.ownership_percentage = Number(ownershipValue);
81
+ }
82
+ FILE_SUBFIELD_NAMES.forEach((subfieldName) => {
83
+ const filePayloads = toFileOptionPayloads(localData, `${keyPrefix}_${subfieldName}`);
84
+ if (filePayloads != null) {
85
+ if (subfieldName ===
86
+ internationalWireVerificationFieldConstants_1.InternationalWireVerificationSubfieldNames.proofOfIdentity) {
87
+ person.proof_of_identity = filePayloads;
88
+ }
89
+ else {
90
+ person.proof_of_address = filePayloads;
91
+ }
92
+ }
93
+ });
94
+ return person;
95
+ };
96
+ const getStakeHolderOwnerIndices = (localData) => {
97
+ const stakeHolderPrefix = `${internationalWireVerificationFieldConstants_1.InternationalWireVerificationBooleanWithSubfieldsFieldNames.stakeHolder}_`;
98
+ const indices = new Set();
99
+ Object.keys(localData).forEach((key) => {
100
+ const match = key.match(/^stake_holder_(\d+)_/);
101
+ if (match != null) {
102
+ indices.add(Number.parseInt(match[1], 10));
103
+ }
104
+ });
105
+ if (indices.size === 0) {
106
+ const hasUnindexedStakeHolderData = Object.keys(localData).some((key) => key.startsWith(stakeHolderPrefix) &&
107
+ !/^stake_holder_(true|false)$/.test(key));
108
+ if (hasUnindexedStakeHolderData) {
109
+ indices.add(0);
110
+ }
111
+ }
112
+ return Array.from(indices).sort((a, b) => a - b);
113
+ };
114
+ const hasPersonPayloadData = (person) => Object.keys(person).length > 0;
115
+ const toIntlWireVerificationFormDetails = (localData) => {
116
+ const formDetails = {};
117
+ Object.entries(localData).forEach(([key, value]) => {
118
+ if (BOOLEAN_WITH_SUBFIELDS_FIELD_NAMES.has(key) ||
119
+ isInternalLocalDataKey(key) ||
120
+ isPersonSubfieldKey(key)) {
121
+ return;
122
+ }
123
+ if (MULTI_OPTION_FILE_FIELD_NAMES.has(key)) {
124
+ const filePayloads = toFileOptionPayloads(localData, key);
125
+ if (filePayloads != null) {
126
+ formDetails[key] = filePayloads;
127
+ }
128
+ return;
129
+ }
130
+ if (value == null || value === '') {
131
+ return;
132
+ }
133
+ formDetails[key] = value;
134
+ });
135
+ const stakeHolderSelection = localData[internationalWireVerificationFieldConstants_1.InternationalWireVerificationBooleanWithSubfieldsFieldNames.stakeHolder];
136
+ if (stakeHolderSelection === 'true') {
137
+ formDetails[internationalWireVerificationFieldConstants_1.InternationalWireVerificationBooleanWithSubfieldsFieldNames.stakeHolder] = getStakeHolderOwnerIndices(localData)
138
+ .map((ownerIndex) => buildPersonPayload(localData, `${internationalWireVerificationFieldConstants_1.InternationalWireVerificationBooleanWithSubfieldsFieldNames.stakeHolder}_${ownerIndex}`))
139
+ .filter(hasPersonPayloadData);
140
+ }
141
+ else if (stakeHolderSelection === 'false') {
142
+ formDetails[internationalWireVerificationFieldConstants_1.InternationalWireVerificationBooleanWithSubfieldsFieldNames.stakeHolder] = [];
143
+ }
144
+ const controllingPersonSelection = localData[internationalWireVerificationFieldConstants_1.InternationalWireVerificationBooleanWithSubfieldsFieldNames
145
+ .controllingPerson];
146
+ if (controllingPersonSelection === 'false') {
147
+ const controllingPerson = buildPersonPayload(localData, internationalWireVerificationFieldConstants_1.InternationalWireVerificationBooleanWithSubfieldsFieldNames.controllingPerson);
148
+ if (hasPersonPayloadData(controllingPerson)) {
149
+ formDetails[internationalWireVerificationFieldConstants_1.InternationalWireVerificationBooleanWithSubfieldsFieldNames.controllingPerson] = controllingPerson;
150
+ }
151
+ }
152
+ return formDetails;
153
+ };
154
+ exports.toIntlWireVerificationFormDetails = toIntlWireVerificationFormDetails;
155
+ const toIntlWireVerificationSubmitPayload = (localData) => ({
156
+ is_applicant_declaration: true,
157
+ form_details: (0, exports.toIntlWireVerificationFormDetails)(localData),
158
+ });
159
+ exports.toIntlWireVerificationSubmitPayload = toIntlWireVerificationSubmitPayload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.0.90-betaAS2",
3
+ "version": "5.0.90-betaAS3",
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",