@tap-payments/auth-jsconnect 2.3.98-test → 2.3.99-test

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.
@@ -63,7 +63,7 @@ import { BusinessType, DocumentPurpose, FlowsTypes, LicenseType } from '../../..
63
63
  import { handleNextScreenStep, handlePrevScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
64
64
  import { ENTITY_STEP_NAMES } from '../../../constants';
65
65
  import moment from 'moment';
66
- import { convertNumbers2English, getRecentDocumentBasedOnPurpose, hasVerifiedValue, hasNoneEditableValue, sleep } from '../../../utils';
66
+ import { convertNumbers2English, getRecentDocumentBasedOnPurpose, hasVerifiedValue, hasNoneEditableValue, sleep, formatNumberAsCurrency } from '../../../utils';
67
67
  export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function (_a, thunkApi) {
68
68
  var token = _a.token, isInternally = _a.isInternally;
69
69
  return __awaiter(void 0, void 0, void 0, function () {
@@ -523,11 +523,11 @@ export var entitySlice = createSlice({
523
523
  if ((activities === null || activities === void 0 ? void 0 : activities.length) > 0)
524
524
  state.data.entityCapitalData.activities = activities;
525
525
  if (paid)
526
- state.data.entityCapitalData.capitalPaid = paid;
526
+ state.data.entityCapitalData.capitalPaid = formatNumberAsCurrency(paid);
527
527
  if (shares === null || shares === void 0 ? void 0 : shares.count)
528
528
  state.data.entityCapitalData.capitalShareCount = shares === null || shares === void 0 ? void 0 : shares.count;
529
529
  if (shares === null || shares === void 0 ? void 0 : shares.value)
530
- state.data.entityCapitalData.capitalShareValue = shares === null || shares === void 0 ? void 0 : shares.value;
530
+ state.data.entityCapitalData.capitalShareValue = formatNumberAsCurrency(shares === null || shares === void 0 ? void 0 : shares.value);
531
531
  state.data.entityNameData.responseBody = __assign(__assign({}, state.data.entityNameData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id });
532
532
  }
533
533
  })
@@ -604,11 +604,11 @@ export var entitySlice = createSlice({
604
604
  if ((activities === null || activities === void 0 ? void 0 : activities.length) > 0)
605
605
  state.data.entityCapitalData.activities = activities;
606
606
  if (paid)
607
- state.data.entityCapitalData.capitalPaid = paid;
607
+ state.data.entityCapitalData.capitalPaid = formatNumberAsCurrency(paid);
608
608
  if (shares === null || shares === void 0 ? void 0 : shares.count)
609
609
  state.data.entityCapitalData.capitalShareCount = shares === null || shares === void 0 ? void 0 : shares.count;
610
610
  if (shares === null || shares === void 0 ? void 0 : shares.value)
611
- state.data.entityCapitalData.capitalShareValue = shares === null || shares === void 0 ? void 0 : shares.value;
611
+ state.data.entityCapitalData.capitalShareValue = formatNumberAsCurrency(shares === null || shares === void 0 ? void 0 : shares.value);
612
612
  state.data.entityNameData = __assign(__assign({}, state.data.entityNameData), { responseBody: __assign(__assign({}, state.data.entityNameData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id }) });
613
613
  })
614
614
  .addCase(verifyEntityLeadOTP.rejected, function (state, action) {
@@ -71,7 +71,7 @@ import API from '../../../api';
71
71
  import { FlowsTypes, IndividualGender, IndividualType, DocumentPurpose } from '../../../@types';
72
72
  import { handleNextScreenStep, handlePrevScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
73
73
  import { defaultCountry, IDENTIFICATION_TYPE, INDIVIDUAl_STEP_NAMES } from '../../../constants';
74
- import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, hasNoneEditableValue, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose } from '../../../utils';
74
+ import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, hasNoneEditableValue, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose, formatNumberAsCurrency } from '../../../utils';
75
75
  export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a, thunkApi) {
76
76
  var token = _a.token, isInternally = _a.isInternally, isUpdatePhoneInfo = _a.isUpdatePhoneInfo;
77
77
  return __awaiter(void 0, void 0, void 0, function () {
@@ -1019,7 +1019,7 @@ export var individualSlice = createSlice({
1019
1019
  state.data.individualData.shareCount = shareCount;
1020
1020
  }
1021
1021
  if (shareValue) {
1022
- state.data.individualData.shareValue = shareValue;
1022
+ state.data.individualData.shareValue = formatNumberAsCurrency(shareValue);
1023
1023
  }
1024
1024
  var selectedSourceIncome = (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.find(function (source) { var _a; return (source === null || source === void 0 ? void 0 : source.id) === ((_a = source_income === null || source_income === void 0 ? void 0 : source_income[0]) === null || _a === void 0 ? void 0 : _a.id); })) || (sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList[0]);
1025
1025
  if (!!selectedSourceIncome)
@@ -16,7 +16,7 @@ import { useController, useFormContext } from 'react-hook-form';
16
16
  import Collapse from '@mui/material/Collapse';
17
17
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
18
18
  import { settingsSelector } from '../../../../app/settings';
19
- import { findCurrencyByIso2, removeAllCharsFromNumber } from '../../../../utils';
19
+ import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
20
20
  import { ScreenContainer } from '../../../shared/Containers';
21
21
  import Input from '../../../shared/Input';
22
22
  import { clearError, entitySelector } from '../../../app/entity/entityStore';
@@ -36,7 +36,7 @@ var CapitalPaid = function (_a) {
36
36
  var target = _a.target;
37
37
  if (error)
38
38
  dispatch(clearError());
39
- var value = removeAllCharsFromNumber(target.value);
39
+ var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
40
40
  capitalPaidControl.field.onChange(value);
41
41
  };
42
42
  var capitalPaidControl = useController({ control: control, name: 'capitalPaid' });
@@ -18,7 +18,7 @@ import { ScreenContainer } from '../../../shared/Containers';
18
18
  import Input from '../../../shared/Input';
19
19
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
20
20
  import { clearError, entitySelector } from '../../../app/entity/entityStore';
21
- import { findCurrencyByIso2, removeAllCharsFromNumber } from '../../../../utils';
21
+ import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
22
22
  import { settingsSelector } from '../../../../app/settings';
23
23
  var CapitalShareValue = function (_a) {
24
24
  var _b, _c, _d;
@@ -37,7 +37,7 @@ var CapitalShareValue = function (_a) {
37
37
  var target = _a.target;
38
38
  if (error)
39
39
  dispatch(clearError());
40
- var value = removeAllCharsFromNumber(target.value);
40
+ var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
41
41
  capitalShareValueControl.field.onChange(value);
42
42
  };
43
43
  var capitalShareValueControl = useController({ control: control, name: 'capitalShareValue' });
@@ -14,7 +14,7 @@ import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import Collapse from '@mui/material/Collapse';
17
- import { findCurrencyByIso2, removeAllCharsFromNumber } from '../../../../utils';
17
+ import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
18
18
  import { settingsSelector } from '../../../../app/settings';
19
19
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
20
20
  import { ScreenContainer } from '../../../shared/Containers';
@@ -33,7 +33,7 @@ var ShareValue = function (_a) {
33
33
  var target = _a.target;
34
34
  if (bckError)
35
35
  dispatch(clearError());
36
- var value = removeAllCharsFromNumber(target.value);
36
+ var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
37
37
  shareValueControl.field.onChange(value);
38
38
  };
39
39
  var shareValueControl = useController({ control: control, name: 'shareValue' });
@@ -71,3 +71,4 @@ export declare const getUserNameObject: (name: string) => {
71
71
  export declare const getFileType: (type: string) => "" | "image/jpeg" | "image/png" | "image/jpg" | "application/pdf";
72
72
  export declare const isStringHasOneAsterisk: (value: string) => boolean;
73
73
  export declare const isOtherLicense: (item?: License) => boolean;
74
+ export declare const formatNumberAsCurrency: (number: string) => string;
@@ -308,3 +308,8 @@ export var isOtherLicense = function (item) {
308
308
  var number = (_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.number;
309
309
  return number === 'other_fl' || number === 'other_cr' || number === 'other_entity';
310
310
  };
311
+ export var formatNumberAsCurrency = function (number) {
312
+ if (!number)
313
+ return '';
314
+ return parseInt(number).toLocaleString();
315
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.3.98-test",
3
+ "version": "2.3.99-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",