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annerDataWrapper.tsx","flows/CashLoan/pages/OurOffer/components/CreditTypeField.tsx","flows/CashLoan/pages/OurOffer/components/InsuranceSection.tsx","flows/CashLoan/pages/OurOffer/components/OurOfferForm.tsx","flows/CashLoan/pages/OurOffer/components/PaymentTypeSection.tsx","flows/CashLoan/pages/OurOffer/components/RefinancingCard.tsx","flows/CashLoan/pages/OurOffer/components/RefinancingCarousel.tsx","flows/CashLoan/pages/OurOffer/components/RefinancingCarouselLoader.tsx","flows/CashLoan/pages/OurOffer/services/calculateOfferService.ts","flows/CashLoan/pages/OurOffer/services/domain.ts","flows/CashLoan/pages/OurOffer/services/ourOfferServices.ts","flows/CashLoan/pages/OurOffer/styles/FooterPartsStyled.tsx","flows/CashLoan/pages/OurOffer/utils/compute.ts","flows/CashLoan/pages/OurOffer/utils/ourOfferFormUtils.ts","flows/CashLoan/pages/OurOffer/utils/utils.ts","flows/CashLoan/pages/PaymentConfiguration/PaymentConfiguration.tsx","flows/CashLoan/pages/PaymentConfiguration/components/PaymentConfigurationForm.tsx","flows/CashLoan/pages/PaymentConfiguration/services/saveConfigureLoanDetailsApi.ts","flows/CashLoan/pages/PrecontractualDocumentsSignature/Signature/Signature.tsx","flows/CashLoan/pages/PrecontractualDocumentsSignature/Signature/components/AnalyzingRequest.tsx","flows/CashLoan/pages/PrecontractualDocumentsSignature/Signature/services/signPrecontracts.ts","flows/CashLoan/pages/PrecontractualDocumentsSignature/SignaturePolling/SignaturePolling.tsx","flows/CashLoan/pages/PrecontractualDocumentsSignature/StatusPolling/StatusPolling.tsx","flows/CashLoan/pages/PrecontractualDocumentsSignature/StatusPolling/service/domain.ts","flows/CashLoan/pages/SelectedExternalCredits/SelectedExternalCredits.tsx","flows/CashLoan/pages/SelectedExternalCredits/components/CreditTypeField.tsx","flows/CashLoan/pages/SelectedExternalCredits/components/ExternalCreditsForm.tsx","flows/CashLoan/pages/SelectedExternalCredits/services/externalCreditsApi.ts","flows/CashLoan/pages/SelectedExternalCredits/services/mockExternalCredits.ts","flows/CashLoan/pages/SelectedExternalCredits/services/validateIbanApi.ts","flows/CashLoan/pages/SelectedExternalCredits/styles/styles.ts","flows/CashLoan/services/cashLoanContext.tsx","flows/CashLoan/services/consentApi.ts","flows/CashLoan/services/darRequest.ts","flows/CashLoan/services/domain.ts","flows/CashLoan/services/reducer.ts","flows/CashLoan/services/useCashLoanTranslation.tsx","flows/CashLoan/services/useCashLoanUtils.tsx"],"sourcesContent":["import { Category, CategoryItemsInternalNames } from \"flows/services/domain\";\n\nimport { Box } from \"omnichannel-design-system\";\nimport { FormValues } from \"./services/domain\";\nimport Loader from \"components/Loader\";\nimport { OTHER } from \"./utils/utils\";\nimport OurOfferForm from \"./components/OurOfferForm\";\nimport { Page } from \"flows/CashLoan/services/domain\";\nimport { getIdByInternalName } from \"helper/financialDataUtils\";\nimport { useCashLoanContext } from \"flows/CashLoan/services/cashLoanContext\";\nimport { useInitialLoadOurOffer } from \"./services/ourOfferServices\";\n\ninterface Props {\n onSubmit: () => unknown;\n onIncomeDocuments: () => void;\n}\n\nconst { InstallmentTypes, CreditTypes, Banks } = Category;\nconst { INSTALMENT_TYPE_EQUALS, UNICREDIT_CONSUMER_FINANCING, UNICREDIT_SA, REVOLVING_FACILITIES_1, REVOLVING_FACILITIES_2 } = CategoryItemsInternalNames;\n\nfunction OurOffer(props: Props) {\n const { onSubmit, onIncomeDocuments } = props;\n const { currentPage } = useCashLoanContext();\n const { loading, financialDropdownData, ourOffer = {} as FormValues, handleOnSubmit } = useInitialLoadOurOffer(currentPage === Page.PRELIMINARY_OFFER ? onIncomeDocuments : onSubmit);\n const otherInstitutionId = financialDropdownData.financialData\n .find(item => item.categoryId === Category.Banks)?.categoryItems\n .find(item => item.internalName === OTHER)?.id.toString();\n\n if (loading || !Object.keys(ourOffer).length) {\n return ;\n }\n\n return (\n \n \n \n );\n}\n\nexport default OurOffer;\n","import { Box, Space, TextChildren } from \"omnichannel-design-system\";\n\nimport Banner from \"components/Banner\";\nimport React from \"react\";\nimport { palette } from \"omnichannel-design-system/lib/styleConstants\";\nimport { useFormatMessage } from \"services/formatMessageHook\";\nimport { useFormatNumber } from \"services/formatNumberHook\";\n\ntype BannerDataWrapperProps = {\n refinancingWarning: Array;\n refinancingError: boolean;\n creditCount: number;\n amountRefinanced: number;\n maxAmount: number;\n}\n\ntype BannerContent = TextChildren | React.JSX.Element | undefined;\n\nexport function BannerDataWrapper({ refinancingWarning, refinancingError, creditCount, amountRefinanced, maxAmount }: BannerDataWrapperProps) {\n const { formatMessage, formatRichTextMessage } = useFormatMessage();\n const { formatNumber } = useFormatNumber();\n\n let bannerType: \"success\" | \"error\" | \"warning\" = \"success\";\n let bannerContent;\n\n if (amountRefinanced) {\n bannerContent = formatRichTextMessage(\n refinancingError ?\n \"dbn.cashLoan.ourOffer.refinancing.sumOfSelected.error\" :\n \"dbn.cashLoan.ourOffer.refinancing.sumOfSelected\",\n {\n creditCount,\n amountRefinanced: formatNumber(parseFloat(parseFloat(amountRefinanced + \"\").toFixed(2))),\n maxAmount: formatNumber(maxAmount)\n }\n )\n if (refinancingError) {\n bannerType = \"error\";\n }\n }\n\n if (refinancingWarning.some(item => item)) {\n bannerType = \"warning\";\n\n const createWarning = (previousContent: BannerContent, list: Array): BannerContent => {\n const row = list.shift();\n let content: BannerContent;\n\n if (row) {\n content = previousContent ? (\n \n {previousContent as React.JSX.Element}\n\n \n\n {formatMessage(row, { maxAmount: formatNumber(maxAmount) })}\n \n ) : formatMessage(row, { maxAmount: formatNumber(maxAmount) });\n }\n\n if (list.length) {\n return createWarning(content, list);\n }\n return content;\n }\n bannerContent = createWarning(bannerContent, refinancingWarning.filter(item => item) as Array)\n }\n\n if (bannerContent) {\n return ;\n }\n\n return <>;\n}","import ReadOnlyField from \"components/ReadOnlyField\"\nimport { SelectOption } from \"components/form/DropdownField\";\nimport { useFormatMessage } from \"services/formatMessageHook\";\nimport { useFormatNumber } from \"services/formatNumberHook\";\n\ntype CreditTypeFieldProps = {\n type: string;\n totalAmount: number;\n typeList: Array;\n}\n\nexport default function CreditTypeField({totalAmount, type, typeList}: CreditTypeFieldProps){\n const { formatMessage } = useFormatMessage();\n const { formatAmount } = useFormatNumber();\n\n const labelItem = typeList.find(item => item.value === type);\n\n return(\n \n )\n}","import { Body, Box, Heading, Space, buttonLink } from \"omnichannel-design-system\";\n\nimport Banner from \"components/Banner\";\nimport NavigationSwitch from \"components/NavigationSwitch\";\nimport { OUR_OFFER_FIELD_NAMES } from \"../services/domain\";\nimport RadioField from \"components/form/RadioField\";\nimport { palette } from \"omnichannel-design-system/lib/styleConstants\";\nimport { useFormatMessage } from \"services/formatMessageHook\";\n\ntype InsuranceFieldProps = {\n gdprAcord: boolean;\n handleToggleActionGdpr: (checked: boolean) => unknown;\n setDisplayGdprAcord: Function;\n disabled?: boolean;\n updateConsentGdpr: (checked: boolean) => unknown;\n refinancing: () => boolean;\n cpiDiscountPercentage: number\n};\n\n\n\nexport default function InsuranceSection({ handleToggleActionGdpr,updateConsentGdpr, gdprAcord, setDisplayGdprAcord, disabled, refinancing, cpiDiscountPercentage }: InsuranceFieldProps) {\n const { formatRichTextMessage, formatMessage } = useFormatMessage();\n\n return (\n \n \n\n\t\t\t{refinancing && refinancing() && (\n\t\t\t\t<>\n\t\t \n\t\t {formatMessage(\"dbn.cashLoan.ourOffer.insurance.title\")}\n\t\t \n\t \t\n\t\t \n\t\t\t)}\n\n !value && updateConsentGdpr(false)}\n options={[\n {\n value: true,\n label: \"dbn.cl.ourOffer.insurance.true.label\",\n description: \"dbn.ourOffer.insurance.true.description\",\n jsx: (\n \n\n \n\n \n\n \n \n {[\n formatMessage(\"dbn.ourOffer.gdprAcord.switch.unchecked.description.before\"),\n buttonLink(() => setDisplayGdprAcord(true), formatMessage(\"dbn.ourOffer.gdprAcord.switch.unchecked.description.link\")),\n formatMessage(\"dbn.ourOffer.gdprAcord.switch.unchecked.description.after\")\n ]}\n }\n switchOn={gdprAcord}\n toggleAction={handleToggleActionGdpr}\n />\n \n )\n }, {\n value: false,\n label: \"dbn.cl.ourOffer.insurance.false.label\",\n jsx: ,\n description: \"dbn.ourOffer.insurance.false.description\"\n }\n ]}\n />\n \n )\n}","import { Box, Heading as HeadingDS, InlineMessage, LocalizedString, Space, Stack, TextChildren, unsafeLocalizedString } from \"omnichannel-design-system\";\nimport { COMPONENTS_NAME, COMPONENTS_PER_FLOW_TYPE, ExistingCredit, FINANCIAL_INSTITUTION, FormValues, OUR_OFFER_FIELD_NAMES, OfferType, OfferTypeRequest, OurOfferData, RefinancingTabs } from \"../services/domain\";\nimport { DocumentDetailsType, ReportCodes } from \"pages/DocumentDetails/services/domain\";\nimport { FooterLabelStyled, FooterValueStyled } from \"../styles/FooterPartsStyled\";\nimport { mapPropsToValues, synchronizeFormWithCalculatedOffer, validate } from \"../utils/ourOfferFormUtils\";\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport { useDocConsentTimestampApi, useParamConsentTimestampApi } from \"flows/CashLoan/services/consentApi\";\nimport { useFormikContext, withFormik } from \"formik\";\n\nimport { Button } from \"components/Button\";\nimport { DocumentDetails } from \"pages/DocumentDetails/DocumentDetails\";\nimport { EMPTY_STRING } from \"components/form/utils\";\nimport { FinancialDataResponse } from \"../../FinancialInformation/services/domain\";\nimport { FloatingFooter } from \"components/FloatingFooter\";\nimport { Heading } from \"components/Heading\";\nimport InsuranceSection from \"./InsuranceSection\";\nimport { LooseObject } from \"services/types\";\nimport { Method } from \"axios\";\nimport NumberFieldStepper from \"components/form/NumberFieldStepper\";\nimport PaymentTypeSection from \"./PaymentTypeSection\";\nimport ReadOnlyField from \"components/ReadOnlyField\";\nimport RefinancingCarousel from \"./RefinancingCarousel\";\nimport Tabs from \"components/Tabs\";\nimport _ from \"lodash\";\nimport { executeAxios } from \"services/axiosHook\";\nimport { palette } from \"omnichannel-design-system/lib/styleConstants\";\nimport { useCalculateOfferService } from \"../services/calculateOfferService\";\nimport { useCashLoanContext } from \"flows/CashLoan/services/cashLoanContext\";\nimport { useComputeOffer } from \"../utils/compute\";\nimport { useCustomFormatMessage } from \"../utils/utils\";\nimport { useFormatMessage } from \"services/formatMessageHook\";\nimport { useFormatNumber } from \"services/formatNumberHook\";\n\nexport const gdprReportApiConfig = {\n\tmethod: \"post\" as Method,\n\turl: \"/packages/loans-ro/reports/create\",\n\tdata: { reportCode: ReportCodes[DocumentDetailsType.CL_OFFER_FORM_GDPR] }\n};\nexport interface OurOfferProps {\n\tfinancialDropdownData: FinancialDataResponse,\n\tfinancialIds: FinancialIds,\n\totherInstitutionId?: string,\n}\n\nexport const OFFER_FORM_GDPR_CONSENT = \"CL_OFFER_FORM_GDPR\";\nexport const LIFE_INSURANCE_PARAM_CONSENT = \"lifeInsurance\";\n\nconst {\n\tGDPR_ACCORD,\n\tAMOUNT,\n\tTENOR,\n\tINSURANCE\n} = OUR_OFFER_FIELD_NAMES;\n\nfunction removePreviousValue(previous: any) {\n\treturn previous ? undefined : previous;\n}\n\nexport function OurOfferFormInner(props: OurOfferProps) {\n\tconst { financialDropdownData, financialIds, otherInstitutionId } = props;\n\tconst { errors, handleSubmit, touched, values, setFieldValue, isValid, setValues } = useFormikContext();\n\tconst { PAYMENT_EQUAL_TYPE_ID } = financialIds;\n\tconst { insurance, paymentType, gdprAcord, refinancedCredits, ourOfferPageData, offerType } = values;\n\tconst isRefinancing = offerType === OfferType.WITH_REFINANCING;\n\n\tconst { initialOffersResponse } = useCashLoanContext();\n\tconst { formatMessage, formatFirstAvailableMessage } = useFormatMessage();\n\tconst { formatAmount, formatPercentage } = useFormatNumber();\n\tconst { error, calculateOffer, loading: newOfferLoading } = useCalculateOfferService();\n\tconst { updateConsentTimestamp } = useDocConsentTimestampApi();\n\tconst { updateParamConsentTimestamp } = useParamConsentTimestampApi();\n\tconst { calculateOfferRequest, shouldCalculateNewOffer } = useComputeOffer();\n\tconst { customFormatMessage, getKeysToFormat } = useCustomFormatMessage(isRefinancing);\n\n\tconst [loading, setLoading] = useState(false);\n\tconst [displayGdprAccord, setDisplayGdprAccord] = useState(false);\n\tconst [reportCreated, setReportCreated] = useState(false);\n\tconst [showRefinancingDetails, setShowRefinancingDetails] = useState(false);\n\tconst [refinancingWarning, setRefinancingWarning] = useState();\n\tconst [showFloatingBar, setShowFloatingBar] = useState(true);\n\tconst [gdprAccordHistory, setGdprAccordHistory] = useState({ [offerType]: gdprAcord });\n\n\tconst topRef = useRef(null);\n\tconst hideAfterRef = useRef(null);\n\tconst dontUpdateCalculate = useRef(true);\n\n\tconst { outputParameters, productParameters, inputParameters, insurance: insuranceParameters } = ourOfferPageData[offerType];\n\n\tconst { maximumMonthlyPaymentExceeded } = outputParameters;\n\tconst productAllowsInsurance = insuranceParameters?.insuranceTypeId !== 42;\n\n\tconst footerContent = [\n\t\t{\n\t\t\tshow: inputParameters.topUpAmount !== null,\n\t\t\tlabelId: \"dbn.cashLoan.ourOffer.additionalAmountOfNewCredit.label\",\n\t\t\tlabel: \"dbn.cashLoan.ourOffer.additionalAmountOfNewCredit.label\",\n\t\t\thaveError: inputParameters.topUpAmount !== null ? inputParameters.topUpAmount < 0 : true,\n\t\t\tvalue: inputParameters.topUpAmount !== null ? formatAmount(inputParameters.topUpAmount) : \"\",\n\t\t},\n\t\t{\n\t\t\tshow: true,\n\t\t\tlabelId: \"dbn.ourOffer.monthlyRate.label\",\n\t\t\tlabel: paymentType === PAYMENT_EQUAL_TYPE_ID ? \"dbn.ourOffer.monthlyRate.equal.label\" : \"dbn.ourOffer.monthlyRate.decreasing.label\",\n\t\t\thaveError: maximumMonthlyPaymentExceeded,\n\t\t\tvalue: formatAmount(outputParameters.monthlyPayment),\n\t\t},\n\t\t{\n\t\t\tshow: isRefinancing && outputParameters.previousMonthlyPayment,\n\t\t\tlabelId: \"dbn.cashLoan.ourOffer.installmentsThatYouPayNow.label\",\n\t\t\tlabel: \"dbn.cashLoan.ourOffer.installmentsThatYouPayNow.label\",\n\t\t\thaveError: false,\n\t\t\tvalue: formatAmount(outputParameters.previousMonthlyPayment),\n\t\t},\n\t\t{\n\t\t\tshow: true,\n\t\t\tlabelId: \"dbn.ourOffer.fixedInterest.label\",\n\t\t\tlabel: \"dbn.ourOffer.fixedInterest.label\",\n\t\t\thaveError: false,\n\t\t\tvalue: formatPercentage(productParameters.interestRate),\n\t\t},\n\t];\n\n\tconst handleConfirmGdprAcord = () => {\n\t\tconst handleSetFieldValue = (consent: boolean) => {\n\t\t\tsetFieldValue(GDPR_ACCORD, consent);\n\t\t\tsetGdprAccordHistory(historyItems => ({ ...historyItems, [offerType]: consent }));\n\t\t}\n\t\tupdateConsentTimestamp(\n\t\t\t{ data: { consentType: OFFER_FORM_GDPR_CONSENT, accepted: true } },\n\t\t\t{\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\tsetDisplayGdprAccord(false);\n\t\t\t\t\thandleSetFieldValue(true);\n\t\t\t\t},\n\t\t\t\tonFail: () => handleSetFieldValue(false)\n\t\t\t}\n\t\t);\n\t};\n\n\tconst updateConsentGdpr = useCallback((accepted: boolean) => {\n\t\tconst handleSetFieldValue = (consent: boolean) => {\n\t\t\tsetFieldValue(GDPR_ACCORD, consent);\n\t\t\tsetGdprAccordHistory(historyItems => ({ ...historyItems, [offerType]: consent }));\n\t\t}\n\t\thandleSetFieldValue(accepted);\n\t\tupdateConsentTimestamp({\n\t\t\tdata: { consentType: OFFER_FORM_GDPR_CONSENT, accepted }\n\t\t},\n\t\t\t{\n\t\t\t\tonSuccess: () => handleSetFieldValue(accepted),\n\t\t\t\tonFail: () => handleSetFieldValue(false)\n\t\t\t});\n\t}, [updateConsentTimestamp, setFieldValue, offerType]);\n\n\tconst updateConsentInsurance = useCallback((accepted: boolean) => {\n\t\tupdateParamConsentTimestamp({\n\t\t\tdata: { paramConsentType: LIFE_INSURANCE_PARAM_CONSENT, accepted: accepted }\n\t\t},\n\t\t\t{\n\t\t\t\tonFail: () => setFieldValue(INSURANCE, false)\n\t\t\t});\n\t}, [updateParamConsentTimestamp, setFieldValue]);\n\n\tuseEffect(() => {\n\t\tsetShowFloatingBar((errors && (Object.keys(errors).length === 0)) && !maximumMonthlyPaymentExceeded);\n\t}, [errors, maximumMonthlyPaymentExceeded]);\n\n\tuseEffect(() => {\n\t\tif (insurance && !reportCreated) {\n\t\t\texecuteAxios({\n\t\t\t\tparams: { ...gdprReportApiConfig },\n\t\t\t\tonSuccess: () => setReportCreated(true),\n\t\t\t\tonLoading: setLoading\n\t\t\t});\n\t\t}\n\t}, [insurance, reportCreated]);\n\n\tconst isInitialMount = useRef(true);\n\tuseEffect(() => {\n\t\tif (isInitialMount.current) {\n\t\t\tisInitialMount.current = false;\n\t\t} else {\n\t\t\tupdateConsentInsurance(!!insurance);\n\t\t}\n\t}, [insurance, updateConsentInsurance]);\n\n\tconst waitingAndCalculatingIfNeeded = useMemo(() =>\n\t\t_.debounce((formValues: FormValues, { calculateOfferRequest: computeOfferRequest, shouldCalculateNewOffer: shouldCalculate }: LooseObject) => {\n\t\t\tif (!shouldCalculate(formValues, () => {\n\t\t\t\tsetValues(previous => ({ ...previous, previousRefinancedCredits: [] }))\n\t\t\t})) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst data = computeOfferRequest(formValues);\n\n\t\t\tif (data) {\n\t\t\t\tcalculateOffer(data, {\n\t\t\t\t\tonSuccess: (response: OurOfferData) => {\n\t\t\t\t\t\tif (response.invalidOffer) {\n\t\t\t\t\t\t\tsetValues(previousValues => {\n\t\t\t\t\t\t\t\tif (previousValues.previousRefinancedCredits) {\n\t\t\t\t\t\t\t\t\treturn { ...previousValues, refinancedCredits: previousValues.previousRefinancedCredits }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn previousValues;\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tsetRefinancingWarning(\"dbn.cashLoan.ourOffer.refinancing.combinationSelectedInvalid.warning\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetRefinancingWarning(removePreviousValue);\n\t\t\t\t\t\tsynchronizeFormWithCalculatedOffer({ offerType: data.offerType, response, setValues });\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t}, 1000),\n\t\t[calculateOffer, setValues]\n\t);\n\n\tuseLayoutEffect(() => {\n\t\tif (dontUpdateCalculate.current) {\n\t\t\tdontUpdateCalculate.current = false;\n\t\t\treturn;\n\t\t}\n\t\twaitingAndCalculatingIfNeeded(values, { calculateOfferRequest, shouldCalculateNewOffer });\n\t}, [values, waitingAndCalculatingIfNeeded, calculateOfferRequest, shouldCalculateNewOffer]);\n\n\tconst handleToggleActionGdpr = () => {\n\t\tif (!reportCreated) {\n\t\t\texecuteAxios({\n\t\t\t\tparams: { ...gdprReportApiConfig },\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\tsetReportCreated(true);\n\t\t\t\t\tupdateConsentGdpr(!gdprAcord);\n\t\t\t\t},\n\t\t\t\tonFail: () => setFieldValue(GDPR_ACCORD, gdprAcord),\n\t\t\t\tonLoading: setLoading\n\t\t\t});\n\t\t} else {\n\t\t\tsetTimeout(() => updateConsentGdpr(!gdprAcord), 500);\n\t\t}\n\t};\n\n\tconst onSubmit = () => {\n\t\tif (insurance) {\n\t\t\tif (gdprAcord) {\n\t\t\t\thandleSubmit();\n\t\t\t}\n\t\t} else {\n\t\t\thandleSubmit();\n\t\t}\n\t};\n\n\tconst handleErrors = (defaultError: string | undefined, errorMessage: string, hasErrorMessage: boolean): string | undefined => {\n\t\tif (defaultError) {\n\t\t\treturn defaultError;\n\t\t}\n\t\tif (hasErrorMessage) {\n\t\t\treturn errorMessage;\n\t\t}\n\t};\n\tconst handleTouched = (defaultError: string | undefined, hasErrorMessage: boolean): boolean => {\n\t\treturn !!defaultError ? !!defaultError : hasErrorMessage\n\t};\n\n\tconst handleTab = useCallback((tabName: OfferType) => {\n\t\tsetValues((previous) => {\n\t\t\tif (previous.gdprAcord !== gdprAccordHistory[tabName]) {\n\t\t\t\tupdateConsentTimestamp({\n\t\t\t\t\tdata: { consentType: OFFER_FORM_GDPR_CONSENT, accepted: !!gdprAccordHistory[tabName] }\n\t\t\t\t}, {\n\t\t\t\t\tonSuccess: () => setFieldValue(GDPR_ACCORD, gdprAccordHistory[tabName]),\n\t\t\t\t\tonFail: () => setFieldValue(GDPR_ACCORD, false)\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn { ...previous, offerType: tabName, gdprAcord: gdprAccordHistory[tabName] };\n\t\t})\n\t}, [setValues, gdprAccordHistory, setFieldValue, updateConsentTimestamp])\n\n\tuseEffect(() => {\n\t\tsynchronizeFormWithCalculatedOffer({\n\t\t\tofferType: OfferTypeRequest[offerType],\n\t\t\tresponse: values.ourOfferPageData[offerType],\n\t\t\tsetValues,\n\t\t\tnotReplaceOffer: true\n\t\t});\n\t}, [offerType, setValues, values.ourOfferPageData])\n\n\tif (displayGdprAccord) {\n\t\treturn (\n\t\t\t setDisplayGdprAccord(false)}\n\t\t\t\tonConfirm={handleConfirmGdprAcord}\n\t\t\t\tisReadOptional={true}\n\t\t\t\ttranslationsKeys={{\n\t\t\t\t\ttitle: `dbn.${DocumentDetailsType.CL_OFFER_FORM_GDPR}.title`,\n\t\t\t\t\tdescription: `dbn.${DocumentDetailsType.CL_OFFER_FORM_GDPR}.mainDescription`,\n\t\t\t\t\tconfirmationButtonText: `dbn.${DocumentDetailsType.CL_OFFER_FORM_GDPR}.confirm`,\n\t\t\t\t\tdownloadButtonText: `dbn.${DocumentDetailsType.CL_OFFER_FORM_GDPR}.download`\n\t\t\t\t}}\n\t\t\t/>\n\t\t)\n\t}\n\n\tif (showRefinancingDetails) {\n\t\treturn (\n\t\t\t setShowRefinancingDetails(false)}\n\t\t\t\tonConfirm={() => setShowRefinancingDetails(false)}\n\t\t\t\tisReadOptional={true}\n\t\t\t\ttranslationsKeys={{\n\t\t\t\t\ttitle: `dbn.agreements.moreDetails.agreement.title`,\n\t\t\t\t\tdescription: `dbn.agreements.moreDetails.agreement.description`,\n\t\t\t\t\tconfirmationButtonText: `dbn.agreements.moreDetails.agreement.confirm.document`,\n\t\t\t\t\tdownloadButtonText: `dbn.agreements.moreDetails.agreement.download.document`\n\t\t\t\t}}\n\t\t\t/>\n\t\t)\n\t}\n\n\tconst disabledFields = isRefinancing && refinancedCredits && !refinancedCredits.length;\n\n\tconst maxAmount = isRefinancing ? outputParameters.maxTopUpAmount : productParameters.maxLoanAmount;\n\n\tconst components = {\n\t\t[COMPONENTS_NAME.INSURANCE]: {\n\t\t\tshow: inputParameters.accordInsuranceProcessData && productAllowsInsurance,\n\t\t\tcomponent: (\n\t\t\t\t values.offerType === OfferType.WITH_REFINANCING}\n\t\t\t\t\tcpiDiscountPercentage={productParameters.cpiDiscountPercentage}\n\t\t\t\t/>\n\t\t\t)\n\t\t},\n\t\t[COMPONENTS_NAME.PAYMENT_TYPE]: {\n\t\t\tshow: true,\n\t\t\tcomponent: (\n\t\t\t\t\n\t\t\t)\n\t\t},\n\t\t[COMPONENTS_NAME.CREDIT_INFORMATION]: {\n\t\t\tshow: true,\n\t\t\tcomponent: (\n\t\t\t\t\n\t\t\t\t\t{customFormatMessage(\"dbn.cashLoan.ourOffer.creditInformation.title\") as TextChildren}\n\t\t\t\t\n\t\t\t)\n\t\t},\n\t\t[COMPONENTS_NAME.AMOUNT]: {\n\t\t\tshow: true,\n\t\t\tcomponent: (\n\t\t\t\t\n\t\t\t)\n\t\t},\n\t\t[COMPONENTS_NAME.TENOR]: {\n\t\t\tshow: true,\n\t\t\tcomponent: (\n\t\t\t\t\n\t\t\t)\n\t\t},\n\t\t[COMPONENTS_NAME.MAX_AMOUNT]: {\n\t\t\tshow: true,\n\t\t\tcomponent: (\n\t\t\t\t\n\t\t\t)\n\t\t},\n\t\t[COMPONENTS_NAME.HIDE_FLOATING_FOOTER_AFTER_REF]: {\n\t\t\tshow: true,\n\t\t\tcomponent: \n\t\t},\n\t\t[COMPONENTS_NAME.MAX_LOAN_AMOUNT]: {\n\t\t\tshow: true,\n\t\t\tcomponent: (\n\t\t\t\t\n\t\t\t)\n\t\t},\n\t\t[COMPONENTS_NAME.ADDITIONAL_AMOUNT]: {\n\t\t\tshow: true,\n\t\t\tcomponent: (\n\t\t\t\t\n\t\t\t)\n\t\t},\n\t\t[COMPONENTS_NAME.REFINANCED_AMOUNT]: {\n\t\t\tshow: true,\n\t\t\tcomponent: (\n\t\t\t\t\n\t\t\t)\n\t\t},\n\t\t[COMPONENTS_NAME.MONTHLY_RATE]: {\n\t\t\tshow: true,\n\t\t\tcomponent: (\n\t\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t{maximumMonthlyPaymentExceeded && ()}\n\t\t\t\t\n\t\t\t)\n\t\t},\n\t\t[COMPONENTS_NAME.INSTALLMENTS_THAT_YOU_PAY_NOW]: {\n\t\t\tshow: outputParameters.previousMonthlyPayment,\n\t\t\tcomponent: (\n\t\t\t\t\n\t\t\t)\n\t\t},\n\t\t[COMPONENTS_NAME.INTEREST_RATE]: {\n\t\t\tshow: true,\n\t\t\tcomponent: (\n\t\t\t\t\n\t\t\t)\n\t\t},\n\t\t[COMPONENTS_NAME.DAE]: {\n\t\t\tshow: true,\n\t\t\tcomponent: (\n\t\t\t\t\n\t\t\t)\n\t\t},\n\t\t[COMPONENTS_NAME.TOTAL_AMOUNT]: {\n\t\t\tshow: true,\n\t\t\tcomponent: (\n\t\t\t\t\n\t\t\t)\n\t\t},\n\t\t[COMPONENTS_NAME.SPACE_8]: {\n\t\t\tshow: true,\n\t\t\tcomponent: (index: number) => \n\t\t},\n\t\t[COMPONENTS_NAME.SPACE_4]: {\n\t\t\tshow: true,\n\t\t\tcomponent: (index: number) => \n\t\t},\n\t};\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t{customFormatMessage(\"dbn.ourOffer.description\", false, true) as any}\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\n\t\t\t{ourOfferPageData.offerWithRefinancing && ourOfferPageData.offerWithoutRefinancing && (\n\t\t\t\t\n\t\t\t)}\n\n\t\t\t\n\t\t\t\t{\n\t\t\t\t\tvalues.offerType === OfferType.WITH_REFINANCING &&\n\t\t\t\t\tinitialOffersResponse &&\n\t\t\t\t\tinitialOffersResponse.offerWithRefinancing &&\n\t\t\t\t\tinitialOffersResponse.offerWithRefinancing.existingCredits &&\n\t\t\t\t\tinitialOffersResponse.offerWithRefinancing.existingCredits.length !== 0 && (\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\tlet amountRefinanced = 0;\n\t\t\t\t\t\t\t\tconst selectedItems = refinancedCredits ? refinancedCredits : [];\n\t\t\t\t\t\t\t\tinitialOffersResponse.offerWithRefinancing.existingCredits.forEach(credit => {\n\t\t\t\t\t\t\t\t\tif (selectedItems.map(item => item.creditId).includes(credit.creditId)) {\n\t\t\t\t\t\t\t\t\t\tamountRefinanced += credit.remainingValue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn productParameters.maxLoanAmount < amountRefinanced;\n\t\t\t\t\t\t\t})()}\n\t\t\t\t\t\t\trefinancingWarning={[errors.refinancedCredits, refinancingWarning]}\n\t\t\t\t\t\t\tonShowRefinancingDetails={() => setShowRefinancingDetails(true)}\n\t\t\t\t\t\t\tloading={newOfferLoading}\n\t\t\t\t\t\t\titemList={initialOffersResponse.offerWithRefinancing.existingCredits}\n\t\t\t\t\t\t\tfinancialDropdownData={financialDropdownData}\n\t\t\t\t\t\t\tselectedItems={refinancedCredits ? refinancedCredits : []}\n\t\t\t\t\t\t\tsetSelectedItems={(newSelectedValues: Array) => {\n\t\t\t\t\t\t\t\tlet amountRefinanced = 0;\n\t\t\t\t\t\t\t\tnewSelectedValues.forEach(item => amountRefinanced += item.remainingValue);\n\n\t\t\t\t\t\t\t\tif (amountRefinanced > productParameters.maxLoanAmount) {\n\t\t\t\t\t\t\t\t\tsetRefinancingWarning(\"dbn.cashLoan.ourOffer.refinancing.sumOfSelected.warning\");\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (refinancingWarning) {\n\t\t\t\t\t\t\t\t\tsetRefinancingWarning(undefined);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetFieldValue(\"refinancedCredits\", newSelectedValues);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tmaxAmount={productParameters.maxLoanAmount}\n\t\t\t\t\t\t\terrors={errors}\n\t\t\t\t\t\t\ttouched={touched}\n\t\t\t\t\t\t\tvalues={values}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\n\t\t\t\t{COMPONENTS_PER_FLOW_TYPE[isRefinancing ? RefinancingTabs.REFINANCING : RefinancingTabs.STANDARD]\n\t\t\t\t\t.filter(item => components[item].show)\n\t\t\t\t\t.map((componentName, index) => {\n\t\t\t\t\t\tconst { component } = components[componentName];\n\t\t\t\t\t\treturn typeof component === \"function\" ? component(index) : component;\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t{Object.keys(errors).some(errorName => errorName.includes(FINANCIAL_INSTITUTION)) && (\n\t\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t)}\n\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t{\n\t\t\t\tshowFloatingBar &&\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{footerContent.filter(item => item.show)\n\t\t\t\t\t\t\t.map(({ labelId, label, haveError, value }) => (\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t{customFormatMessage(label, true) as TextChildren}\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t{unsafeLocalizedString(value)}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\n\t);\n}\n\nexport type FinancialIds = {\n\tPAYMENT_EQUAL_TYPE_ID: string;\n\tREADONLY_FINANCIAL_INSTITUTIONS: string[];\n\tREVOLVING_FACILITIES: string[];\n}\n\nexport type MyFormProps = {\n\tonSubmit: (values: any) => unknown;\n\tfinancialDropdownData: FinancialDataResponse;\n\tinitialValues: LooseObject;\n\tfinancialIds: FinancialIds;\n\totherInstitutionId?: string;\n}\n\nconst OurOfferForm = withFormik({\n\tmapPropsToValues,\n\tvalidate,\n\thandleSubmit: (values, bag) => {\n\t\tbag.props.onSubmit(values);\n\t},\n})(OurOfferFormInner);\n\nexport default OurOfferForm;\n","import { Box, Heading, Space } from \"omnichannel-design-system\";\n\nimport { Category } from \"../../../../services/domain\";\nimport DropdownField from \"components/form/DropdownField\";\nimport { FinancialDataResponse } from \"../../FinancialInformation/services/domain\";\nimport { FinancialIds } from \"./OurOfferForm\";\nimport { OUR_OFFER_FIELD_NAMES } from \"../services/domain\";\nimport { computeFinancialInformationOptionByCategory } from \"../utils/utils\";\nimport { useFormatMessage } from \"services/formatMessageHook\";\n\ntype PaymentTypeSectionProps = {\n financialDropdownData: FinancialDataResponse;\n paymentType: string;\n financialIds: FinancialIds;\n showHeader: boolean;\n disabled?: boolean;\n}\n\nconst { PAYMENT_TYPE, PAYMENT_DAY } = OUR_OFFER_FIELD_NAMES;\n\nexport default function PaymentTypeSection(props: PaymentTypeSectionProps) {\n const { financialDropdownData, paymentType, financialIds: { PAYMENT_EQUAL_TYPE_ID }, showHeader, disabled } = props;\n const { formatMessage } = useFormatMessage();\n return (\n \n {showHeader && (\n <>\n \n {formatMessage(\"dbn.cashLoan.ourOffer.paymentType.title\")}\n \n\n \n \n )}\n\n\n \n\n \n\n \n\n \n \n )\n}","import { Box, Divider, Space } from \"omnichannel-design-system\";\nimport { ExistingCredit, FINANCIAL_INSTITUTION } from \"../services/domain\";\nimport { FORMATTER_TYPES, useFormatNumber } from \"services/formatNumberHook\";\nimport { computeFinancialInformationOptionByCategory, computeStyleRefinancingSlide } from \"../utils/utils\";\n\nimport { Category } from \"../../../../services/domain\";\nimport Checkbox from \"components/Checkbox\";\nimport CreditTypeField from \"./CreditTypeField\";\nimport DropdownField from \"components/form/DropdownField\";\nimport { FinancialDataResponse } from \"../../FinancialInformation/services/domain\";\nimport { FinancialIds } from \"./OurOfferForm\";\nimport { LooseObject } from \"services/types\";\nimport ReadOnlyField from \"components/ReadOnlyField\";\nimport _ from \"lodash\";\nimport moment from \"moment\";\nimport { useCashLoanContext } from \"flows/CashLoan/services/cashLoanContext\";\nimport { useFormatMessage } from \"services/formatMessageHook\";\n\ntype SlideItemProps =\n ExistingCredit & {\n isSelectable: boolean;\n financialDropdownData: FinancialDataResponse;\n credit: ExistingCredit;\n checkedItems: Array;\n handleChange: Function;\n indexList: Array;\n errors: LooseObject;\n touched: LooseObject;\n financialIds: FinancialIds;\n otherInstitutionId?: string;\n }\n\nconst MONTHS = \"LUNI\";\n\nexport default function RefinancingCard({\n creditId, creditValue, monthlyPayment, remainingValue: amountRefinanced, openingDate, remainingTenor, loanType: creditType, financialIds: { READONLY_FINANCIAL_INSTITUTIONS, REVOLVING_FACILITIES }, credit, checkedItems, indexList, handleChange, errors, touched, financialDropdownData, isSelectable, otherInstitutionId\n}: SlideItemProps) {\n const { formatMessage } = useFormatMessage();\n const { formatAmount } = useFormatNumber();\n const { formatter } = useFormatNumber(formatMessage);\n const { initialOffersResponse } = useCashLoanContext();\n const defaultOffer = initialOffersResponse?.offerWithRefinancing.existingCredits?.find(item => item.creditId === creditId);\n\n const currentPosition = indexList.indexOf(credit.creditId);\n const itemPosition = indexList.indexOf(creditId);\n const keyDropDownItem = FINANCIAL_INSTITUTION + creditId;\n\n const handleCheck = () => {\n handleChange(\n checkedItems.map(item => item.creditId).includes(creditId) ?\n checkedItems.filter(item => item.creditId !== creditId) :\n [...checkedItems, initialOffersResponse?.offerWithRefinancing.existingCredits?.find(item => item.creditId === creditId)]\n )\n };\n\n const isNonRevolvingFacility = !REVOLVING_FACILITIES.includes(creditType);\n const financialInstitutionDisabled = defaultOffer ? (\n !_.isEmpty(defaultOffer.financialInstitution) &&\n READONLY_FINANCIAL_INSTITUTIONS.includes(defaultOffer.financialInstitution)\n ) : false;\n\n let financialInstitutionOptions = computeFinancialInformationOptionByCategory({ category: Category.Banks, financialDropdownData })\n .sort((a, b) => a.label.localeCompare(b.label));\n\n if(!financialInstitutionDisabled){\n financialInstitutionOptions = financialInstitutionOptions.filter(institution => !READONLY_FINANCIAL_INSTITUTIONS.includes(institution.value))\n }\n\n return (\n \n \n \n item.creditId).includes(creditId)}\n onChange={handleCheck} />\n \n\n \n \n\n \n\n {\n isNonRevolvingFacility && monthlyPayment ?\n : <>\n }\n \n \n\n \n\n \n\n \n {\n if (value === otherInstitutionId && checkedItems.map(item => item.creditId).includes(creditId)) {\n handleCheck();\n }\n return true;\n }\n }]}\n\n />\n \n\n \n\n \n\n \n\n \n \n\n \n\n {\n isNonRevolvingFacility && remainingTenor ?\n : <>\n }\n \n\n \n \n\n \n \n\n \n )\n}","import {Body, bold, Box, buttonLink, Carousel, Space} from \"omnichannel-design-system\";\nimport {CSSProperties, useRef, useState} from \"react\";\nimport {ExistingCredit, FINANCIAL_INSTITUTION} from \"../services/domain\";\n\nimport {BannerDataWrapper} from \"./BannerDataWrapper\";\nimport {FinancialDataResponse} from \"../../FinancialInformation/services/domain\";\nimport {FinancialIds} from \"./OurOfferForm\";\nimport RefinancingCard from \"./RefinancingCard\";\nimport RefinancingCarouselLoader from \"./RefinancingCarouselLoader\";\nimport {carouselStepValidation} from \"flows/CreditCard/pages/CardPresentation/utils/validation\";\nimport styled from \"styled-components\";\nimport {useFormatMessage} from \"services/formatMessageHook\";\n\nexport type RefinancingPresentationProps = {\n financialIds: FinancialIds;\n financialDropdownData: FinancialDataResponse;\n selectedItems: Array;\n setSelectedItems: Function;\n maxAmount: number;\n errors: any;\n touched: any;\n values: any;\n itemList: Array;\n loading: boolean;\n onShowRefinancingDetails: () => unknown;\n refinancingWarning: Array;\n refinancingError: boolean;\n otherInstitutionId?: string;\n};\n\nconst CarouselContainerStyled = styled(Box)`\n width: 100vw;\n margin-top: 20px;\n margin-left: -20px;\n margin-right: -20px;\n transition: all 0.5s;\n padding-bottom: 20px;\n position: relative;\n`;\n\nexport default function RefinancingCarousel({\n refinancingWarning,\n onShowRefinancingDetails, selectedItems, setSelectedItems,\n maxAmount, loading, itemList, refinancingError, financialIds,\n otherInstitutionId, ...other\n}: RefinancingPresentationProps) {\n const { formatMessage } = useFormatMessage();\n\n const [selectedCard, setSelectedCard] = useState(0);\n const carouselContainerRef = useRef(null);\n const { READONLY_FINANCIAL_INSTITUTIONS } = financialIds;\n\n const indexList = itemList.map(item => item.creditId);\n\n let amountRefinanced = 0;\n selectedItems.forEach(item => {\n if (selectedItems.map(selectedItem => selectedItem.creditId).includes(item.creditId)) {\n amountRefinanced += item.remainingValue;\n }\n });\n\n let hasExternalCredit = selectedItems.some(existingCredit => !READONLY_FINANCIAL_INSTITUTIONS.some(item => item === existingCredit.financialInstitution));\n\n const loaderContainerStyles: CSSProperties = {\n position: \"absolute\",\n width: \"100vw\",\n height: \"100%\"\n }\n\n const externalCreditsMessage = [];\n if (hasExternalCredit) {\n externalCreditsMessage.push(formatMessage(\"dbn.cashLoan.ourOffer.refinancing.description4\"));\n externalCreditsMessage.push(bold(formatMessage(\"dbn.cashLoan.ourOffer.refinancing.description5\")));\n externalCreditsMessage.push(buttonLink(onShowRefinancingDetails, formatMessage(\"dbn.cashLoan.ourOffer.refinancing.link\")));\n }\n\n return (\n \n \n\n \n \n {[\n formatMessage(\"dbn.cashLoan.ourOffer.refinancing.description1\"),\n bold(formatMessage(\"dbn.cashLoan.ourOffer.refinancing.description2\", { creditCount: itemList.length })),\n formatMessage(\"dbn.cashLoan.ourOffer.refinancing.description3\"),\n ...externalCreditsMessage,\n ]}\n \n \n\n \n {loading && }\n\n {\n const keyDropDownItem = FINANCIAL_INSTITUTION + item.creditId;\n const isSelectable = !(\n other.errors[keyDropDownItem] === \"dbn.cashLoan.ourOffer.error.financialInstitution.incompatible\" ||\n other.values[keyDropDownItem] === otherInstitutionId\n );\n\n return (\n \n )\n })}\n itemWidth={window.screen.width}\n value={selectedCard}\n onChange={carouselStepValidation({ setValue: setSelectedCard, maxSteps: itemList.length - 1 })} />\n \n\n \n\n \n );\n}","import { Box, SpinnerIcon } from \"omnichannel-design-system\";\n\nimport { CSSProperties } from \"react\";\nimport { palette } from \"omnichannel-design-system/lib/styleConstants\";\n\ntype Props = {\n loaderContainerStyles: CSSProperties\n}\n\nexport default function RefinancingCarouselLoader({loaderContainerStyles}:Props) {\n return (\n \n \n \n\n \n \n )\n}","import { ExecuteAxiosFunctions, executeAxios } from \"services/axiosHook\";\nimport { useCallback, useState } from \"react\";\n\nimport { LooseObject } from \"services/types\";\nimport { Method } from \"axios\";\nimport { OurOfferData } from \"./domain\";\n\nexport const calculateOfferConfig = {\n url: \"/packages/loans-ro/offer/calculate\",\n method: \"post\" as Method,\n};\n\nexport const useCalculateOfferService = () => {\n const [error, setError] = useState();\n const [loading, setLoading] = useState(false);\n\n const calculateOffer = useCallback((data: any, { onSuccess, onFail }: ExecuteAxiosFunctions) => {\n !loading && executeAxios({\n params: { ...calculateOfferConfig, data },\n onSuccess: (response: OurOfferData) => {\n onSuccess && onSuccess(response);\n setError(undefined);\n },\n onFail: (err: LooseObject) => {\n onFail && onFail(err);\n setError(err);\n },\n onLoading: setLoading\n })\n }, [loading]);\n\n return {\n loading,\n error,\n calculateOffer,\n };\n\n};","\ninterface Commissions {\n commissionPercentOnInitialAmount: number;\n commissionPercentOnOutstandingValue: number;\n commissionDistributedValue: number;\n commissionMonthlyFixedValue: number;\n feeOffScheduleMonthly: number;\n}\n\ninterface Insurance {\n insuranceTypeId: number;\n insuranceAmountTypeId: number;\n insuranceType: string;\n insurancePercent: number;\n insurancePercentApplicabilityId: number;\n insurancePercentApplicability: string;\n insuranceMonthlyFixedValue: number;\n insuranceMonthlySummaryValue: number;\n}\n\ninterface ProductParameters {\n maxMonthlyPayment: number;\n minLoanAmount: number;\n maxLoanAmount: number;\n minTenor: number;\n maxTenor: number;\n interestRate: number;\n tranchesString: string | null;\n recalculatedMaxMonthlyPayment: number;\n recalculatedMaxLoanAmount: number;\n cpiDiscountPercentage: number;\n}\n\nexport interface ExistingCredit {\n creditId: string;\n selected: boolean;\n loanType: string;\n creditValue: number;\n monthlyPayment: number | null;\n remainingValue: number,\n remainingTenor?: number;\n currency: string | null;\n originalCurrencyAmount: number | null;\n originalCurrencyRemainingValue: number | null;\n openingDate: string;\n financialInstitution: string;\n iban: string | null;\n contractNumber?: string | null;\n}\nexport interface OutputParameters {\n monthlyPayment: number;\n dae: number;\n totalAmount: number;\n totalCommissionsAmount: number | null;\n totalCommissionsAnalysisAmount: number;\n totalCommissionsAdministrationAmount: number;\n totalInsuranceAmount: number;\n maximumMonthlyPaymentExceeded: boolean;\n maxTopUpAmount: number;\n refinancedAmount: number;\n previousMonthlyPayment: number;\n}\n\ninterface InputParameters {\n loanAmount: number;\n tenor: number;\n insuranceIncluded: boolean;\n installmentTypeId: number;\n dueDayId: number;\n dueDayDisplayValue: string;\n accordInsuranceProcessData: boolean;\n includesExternalCredits: boolean;\n topUpAmount: number | null;\n initialTenor: number | null;\n initialInsuranceIncluded: boolean;\n initialInstallmentTypeId: string | null;\n initialDueDayId: string | null;\n}\n\nexport interface OurOfferData {\n inputParameters: InputParameters,\n outputParameters: OutputParameters,\n productParameters: ProductParameters,\n insurance: Insurance,\n commissions: Commissions,\n existingCredits?: Array,\n openDay: string;\n invalidOffer: boolean;\n}\n\nexport interface OfferDataResponse {\n offerWithoutRefinancing: OurOfferData;\n offerWithRefinancing: OurOfferData;\n}\n\nexport enum OfferType {\n WITHOUT_REFINANCING = \"offerWithoutRefinancing\",\n WITH_REFINANCING = \"offerWithRefinancing\",\n}\n\nexport enum RefinancingTabs {\n REFINANCING = \"refinancing\",\n STANDARD = \"standard\"\n}\n\nexport interface FormValues {\n amount: number,\n period: number,\n paymentType: string,\n paymentDay: string,\n insurance: boolean,\n gdprAcord: boolean,\n refinancedCredits?: Array,\n previousRefinancedCredits?: Array,\n ourOfferPageData: OfferDataResponse,\n offerType: OfferType,\n}\n\nexport enum OfferTypeRequest {\n offerWithoutRefinancing = \"WITHOUT_REFINANCING\",\n offerWithRefinancing = \"WITH_REFINANCING\",\n}\n\nexport const FINANCIAL_INSTITUTION = \"financialInstitution_\";\n\nexport const OUR_OFFER_FIELD_NAMES = {\n AMOUNT: \"amount\",\n GDPR_ACCORD: \"gdprAcord\",\n TENOR: \"period\",\n INSURANCE: \"insurance\",\n PAYMENT_TYPE: \"paymentType\",\n PAYMENT_DAY: \"paymentDay\",\n OUR_OFFER_PAGE_DATA: \"ourOfferPageData\",\n}\n\nexport const COMPONENTS_NAME = {\n INSURANCE: \"insurance\",\n PAYMENT_TYPE: \"paymentType\",\n CREDIT_INFORMATION: \"creditInformation\",\n MAX_AMOUNT: \"maxAmount\",\n SPACE_8: \"space8\",\n SPACE_4: \"space4\",\n AMOUNT: \"amount\",\n TENOR: \"period\",\n ADDITIONAL_AMOUNT: \"additionalAmountOfNewCredit\",\n REFINANCED_AMOUNT: \"refinancedAmount\",\n MONTHLY_RATE: \"monthlyRate\",\n INSTALLMENTS_THAT_YOU_PAY_NOW: \"installmentsThatYouPayNow\",\n INTEREST_RATE: \"interestRate\",\n DAE: \"dae\",\n TOTAL_AMOUNT: \"totalAmount\",\n MAX_LOAN_AMOUNT: \"maxLoanAmount\",\n HIDE_FLOATING_FOOTER_AFTER_REF: \"hideAfterRef\",\n}\n\nconst { INSURANCE, PAYMENT_TYPE, CREDIT_INFORMATION, SPACE_8, SPACE_4, AMOUNT, TENOR, MAX_AMOUNT, ADDITIONAL_AMOUNT, REFINANCED_AMOUNT, MONTHLY_RATE, INSTALLMENTS_THAT_YOU_PAY_NOW, INTEREST_RATE, DAE, TOTAL_AMOUNT, MAX_LOAN_AMOUNT, HIDE_FLOATING_FOOTER_AFTER_REF } = COMPONENTS_NAME;\n\nexport const COMPONENTS_PER_FLOW_TYPE = {\n [RefinancingTabs.REFINANCING]: [\n INSURANCE,\n SPACE_4,\n PAYMENT_TYPE,\n CREDIT_INFORMATION,\n SPACE_8,\n AMOUNT,\n SPACE_4,\n TENOR,\n SPACE_4,\n MAX_AMOUNT,\n HIDE_FLOATING_FOOTER_AFTER_REF,\n SPACE_4,\n ADDITIONAL_AMOUNT,\n SPACE_4,\n REFINANCED_AMOUNT,\n SPACE_4,\n MONTHLY_RATE,\n SPACE_4,\n INSTALLMENTS_THAT_YOU_PAY_NOW,\n SPACE_4,\n INTEREST_RATE,\n SPACE_4,\n DAE,\n SPACE_4,\n TOTAL_AMOUNT\n ],\n [RefinancingTabs.STANDARD]: [\n SPACE_4,\n MAX_LOAN_AMOUNT,\n SPACE_4,\n MONTHLY_RATE,\n SPACE_4,\n AMOUNT,\n SPACE_4,\n TENOR,\n SPACE_4,\n INSURANCE,\n SPACE_4,\n INTEREST_RATE,\n SPACE_4,\n DAE,\n SPACE_4,\n TOTAL_AMOUNT,\n SPACE_4,\n PAYMENT_TYPE,\n HIDE_FLOATING_FOOTER_AFTER_REF,\n ]\n}\n","import { Dispatch, SetStateAction, useCallback, useEffect, useRef, useState } from \"react\";\nimport { FormValues, OfferDataResponse, OfferType, OfferTypeRequest, OurOfferData } from \"./domain\";\n\nimport { Category } from \"../../../../services/domain\";\nimport { FinancialDataResponse } from \"../../FinancialInformation/services/domain\";\nimport { LooseObject } from \"services/types\";\nimport { Method } from \"axios\";\nimport { OurOffer } from \"flows/CashLoan/services/domain\";\nimport _ from \"lodash\";\nimport { calculateOfferConfig } from \"./calculateOfferService\";\nimport { executeAxios } from \"services/axiosHook\";\nimport { financialDataDropdownCallConfig } from \"../../../../services/financialApi\";\nimport { getSelectedCredits } from \"../utils/compute\";\nimport { useCashLoanContext } from \"flows/CashLoan/services/cashLoanContext\";\nimport { useLoadingPipeline } from \"helper/loadingPipeline\";\n\nconst ourInitialOfferCallConfig = {\n url: \"/packages/loans-ro/offer/get\",\n method: \"post\" as Method,\n};\n\nconst saveOfferConfig = {\n url: \"/packages/loans-ro/offer/save\",\n method: \"post\" as Method,\n};\n\nexport function getOfferType(offerWithRefinancing: OurOfferData) {\n if (\n offerWithRefinancing &&\n offerWithRefinancing.existingCredits &&\n offerWithRefinancing.existingCredits.length &&\n offerWithRefinancing.existingCredits.some(item => item.selected)\n ) {\n return OfferType.WITH_REFINANCING;\n }\n return OfferType.WITHOUT_REFINANCING;\n}\n\nfunction computeRefinancedCredits(values: FormValues, data: LooseObject) {\n if (values.offerType === OfferType.WITH_REFINANCING) {\n const selectedRefinancedCredits = getSelectedCredits(values);\n if (selectedRefinancedCredits) {\n data.refinancedCredits = selectedRefinancedCredits;\n values.refinancedCredits = selectedRefinancedCredits;\n selectedRefinancedCredits.forEach(selectedCredit => {\n const creditInContext = values.ourOfferPageData.offerWithRefinancing.existingCredits?.find(credit => credit.creditId === selectedCredit.creditId);\n if (creditInContext) {\n creditInContext.financialInstitution = selectedCredit.financialInstitution;\n }\n })\n }\n }\n}\n\nfunction onSuccessCalculateOffer(initialOffersResponse: OfferDataResponse, offerType: OfferType, setOurOfferPageData: Dispatch>) {\n return (response: OurOfferData) => {\n const computedOffer = {\n ...initialOffersResponse,\n [offerType === OfferType.WITH_REFINANCING ? OfferType.WITH_REFINANCING : OfferType.WITHOUT_REFINANCING]: response\n }\n if (initialOffersResponse.offerWithRefinancing &&\n initialOffersResponse.offerWithRefinancing.existingCredits &&\n initialOffersResponse.offerWithRefinancing.existingCredits.length &&\n response.existingCredits\n ) {\n initialOffersResponse.offerWithRefinancing.existingCredits\n .filter(credit => credit.financialInstitution)\n .forEach(credit => {\n const creditResponse = response.existingCredits?.find(creditRes => creditRes.creditId === credit.creditId);\n if (creditResponse) {\n creditResponse.financialInstitution = credit.financialInstitution;\n }\n })\n }\n setOurOfferPageData(computedOffer);\n }\n}\n\nexport function useInitialLoadOurOffer(onSubmit: Function) {\n const { loading, handleLoading } = useLoadingPipeline();\n const [error, setError] = useState();\n const [financialDropdownData, setFinancialDropdownData] = useState({ financialData: [] });\n const { ourOffer, updateOurOffer, initialOffersResponse, setInitialOffers } = useCashLoanContext();\n const [ourOfferData, setOurOfferData] = useState();\n const [ourOfferPageData, setOurOfferPageData] = useState();\n const { paymentType, paymentDay, amount, period, insurance, gdprAcord, refinancedCredits, offerType } = ourOffer ? ourOffer : {} as OurOffer;\n const getOfferRequestDoneRef = useRef();\n\n useEffect(() => {\n if (!ourOfferPageData || !initialOffersResponse) {\n return;\n }\n\n let flowType: OfferType.WITHOUT_REFINANCING | OfferType.WITH_REFINANCING = getOfferType(ourOfferPageData.offerWithRefinancing);\n\n if (!ourOfferPageData || !ourOfferPageData[flowType] || !ourOfferPageData[flowType].inputParameters) {\n return;\n }\n\n const { loanAmount, tenor, dueDayId, installmentTypeId, insuranceIncluded, topUpAmount } = ourOfferPageData[flowType].inputParameters;\n\n const computedData: OurOffer = {\n amount: topUpAmount !== null ? topUpAmount : loanAmount,\n period: tenor,\n paymentDay: String(dueDayId),\n paymentType: String(installmentTypeId),\n insurance: insuranceIncluded,\n gdprAcord,\n ourOfferPageData,\n offerType,\n }\n\n if (OfferType.WITH_REFINANCING === flowType) {\n computedData.refinancedCredits = initialOffersResponse.offerWithRefinancing.existingCredits?.filter(item => item.selected);\n }\n setOurOfferData(computedData);\n\n }, [ourOfferPageData, refinancedCredits, gdprAcord, offerType, initialOffersResponse]);\n\n const onExistingOfferFromContext = useCallback(() => {\n if (!initialOffersResponse) {\n return\n }\n\n const data: LooseObject = {\n loanAmount: amount,\n tenor: period,\n installmentType: paymentType,\n dueDay: paymentDay,\n insurance,\n offerType: OfferTypeRequest[offerType],\n };\n\n if (_.isEmpty(data.dueDay) || _.isEmpty(data.installmentType)) {\n return;\n }\n\n if (offerType === OfferType.WITH_REFINANCING) {\n data.refinancedCredits = refinancedCredits;\n }\n\n executeAxios({\n params: { ...calculateOfferConfig, data },\n onLoading: handleLoading(\"ourOfferInitial\"),\n onSuccess: onSuccessCalculateOffer(initialOffersResponse, offerType, setOurOfferPageData),\n onFail: setError\n });\n }, [handleLoading, amount, insurance, paymentDay, paymentType, period, refinancedCredits, initialOffersResponse, offerType])\n\n useEffect(() => {\n if(getOfferRequestDoneRef.current){\n return\n }\n getOfferRequestDoneRef.current = true;\n executeAxios({\n params: ourInitialOfferCallConfig,\n onLoading: handleLoading(\"initialOffersResponse\"),\n onSuccess: (response?: OfferDataResponse) => {\n if (!response) {\n onExistingOfferFromContext();\n return;\n }\n setInitialOffers(response);\n setOurOfferPageData(response);\n },\n onFail: setError\n });\n }, [handleLoading, setInitialOffers, setOurOfferPageData, onExistingOfferFromContext])\n\n useEffect(() => {\n const categories = [Category.DueDays, Category.InstallmentTypes, Category.Banks, Category.CreditTypes];\n executeAxios({\n params: { ...financialDataDropdownCallConfig, data: categories },\n onLoading: handleLoading(\"financialData\"),\n onFail: setError,\n onSuccess: setFinancialDropdownData\n });\n }, [handleLoading]);\n\n const handleOnSubmit = useCallback((values: FormValues) => {\n const data: LooseObject = {\n loanAmount: values.amount,\n tenor: values.period,\n installmentType: values.paymentType,\n dueDay: values.paymentDay,\n insurance: values.insurance,\n offerType: OfferTypeRequest[values.offerType],\n };\n computeRefinancedCredits(values, data);\n updateOurOffer(values);\n setInitialOffers(values.ourOfferPageData);\n executeAxios({\n params: { ...saveOfferConfig, data },\n onSuccess: onSubmit,\n onFail: setError,\n onLoading: handleLoading(\"onSubmit\")\n })\n\n }, [handleLoading, onSubmit, setInitialOffers, updateOurOffer])\n\n\n return {\n loading,\n error,\n financialDropdownData,\n ourOffer: ourOfferData,\n handleOnSubmit\n }\n}","import { Body } from \"omnichannel-design-system\";\nimport styled from \"styled-components\";\n\nexport const FooterLabelStyled = styled(Body)`\n text-transform: none;\n`;\n\nexport const FooterValueStyled = styled(Body)`\n word-break: unset !important;\n`;","import { ExistingCredit, FINANCIAL_INSTITUTION, FormValues, OfferType, OfferTypeRequest } from \"../services/domain\";\n\nimport { LooseObject } from \"services/types\";\nimport _ from \"lodash\";\nimport { useCallback } from \"react\";\n\n/**\n * \n * @param values parameters of form, check FormValues for details\n * @returns list of selected credits with financial institution,\n * or if are not any credits selected will return nothing\n */\n\nexport function getSelectedCredits(values: FormValues): Array | undefined {\n if (values.refinancedCredits && values.refinancedCredits.length) {\n const refinancedCredits: Array = [];\n\n values.refinancedCredits.forEach(credit => {\n refinancedCredits.push({ ...credit, financialInstitution: (values as any)[FINANCIAL_INSTITUTION + credit.creditId], selected: true });\n })\n return refinancedCredits;\n }\n}\n\nexport function useComputeOffer() {\n const calculateOfferRequest = useCallback((values: FormValues): LooseObject | undefined => {\n let data: LooseObject = {\n loanAmount: values.amount,\n tenor: values.period,\n installmentType: values.paymentType,\n dueDay: values.paymentDay,\n insurance: values.insurance,\n offerType: OfferTypeRequest.offerWithoutRefinancing,\n };\n\n if (values.offerType === OfferType.WITH_REFINANCING) {\n const refinancedCredits = getSelectedCredits(values);\n const previousRefinancedCredits = values.previousRefinancedCredits?.map(item => item.creditId);\n data.refinancedCredits = refinancedCredits;\n data.offerType = OfferTypeRequest.offerWithRefinancing;\n\n const newSelectedCreditIds = refinancedCredits?.map((item: ExistingCredit) => item.creditId);\n\n if (newSelectedCreditIds?.length &&\n (\n !_.isEqual(_.sortBy(previousRefinancedCredits), _.sortBy(newSelectedCreditIds)) ||\n !previousRefinancedCredits\n )\n ) {\n data.refinancingChanged = true;\n }\n }\n\n return data;\n }, []);\n\n const shouldCalculateNewOffer = useCallback((values: FormValues, onNoCreditsSelected?: () => unknown) => {\n const { period, amount, refinancedCredits, insurance, paymentType, paymentDay, ourOfferPageData, offerType } = values;\n\n const { productParameters, inputParameters, outputParameters } = ourOfferPageData[offerType];\n const { minLoanAmount, maxLoanAmount, minTenor, maxTenor } = productParameters;\n const { topUpAmount, tenor, insuranceIncluded, installmentTypeId, dueDayId, loanAmount } = inputParameters;\n const { maxTopUpAmount } = outputParameters;\n\n const isValidPeriod = period >= minTenor && period <= maxTenor;\n const parametersAreNotValid = _.isEmpty(paymentDay) || _.isEmpty(paymentType);\n\n if (!isValidPeriod || amount < minLoanAmount || parametersAreNotValid) {\n return false\n }\n\n const isOtherParametersChanged = tenor !== period ||\n insuranceIncluded !== insurance ||\n paymentType !== String(installmentTypeId) ||\n paymentDay !== String(dueDayId);\n\n if (offerType === OfferType.WITHOUT_REFINANCING) {\n return amount <= maxLoanAmount && (loanAmount !== amount || isOtherParametersChanged);\n }\n\n if ((!refinancedCredits || !refinancedCredits.length) && onNoCreditsSelected) {\n onNoCreditsSelected();\n return false;\n }\n\n const actualSelection = refinancedCredits?.map((item: ExistingCredit) => item.creditId);\n const previousRefinancedCredits = values.previousRefinancedCredits?.map(item => item.creditId);\n const computedMaxAmount = maxTopUpAmount >= minLoanAmount ? maxTopUpAmount : minLoanAmount;\n return amount <= computedMaxAmount && (\n topUpAmount !== amount ||\n !_.isEqual(_.sortBy(previousRefinancedCredits), _.sortBy(actualSelection)) ||\n isOtherParametersChanged\n );\n\n }, [])\n\n return {\n calculateOfferRequest,\n shouldCalculateNewOffer\n }\n}","import { FINANCIAL_INSTITUTION, FormValues, OfferDataResponse, OfferType, OfferTypeRequest, OurOfferData } from \"../services/domain\";\n\nimport { LooseObject } from \"services/types\";\nimport { MyFormProps } from \"../components/OurOfferForm\";\nimport _ from \"lodash\";\n\nfunction validateOfferWithRefinancing(values: FormValues, errors: any, ourOfferPageData: OfferDataResponse, otherInstitutionId?: string) {\n const { outputParameters } = ourOfferPageData[values.offerType];\n const { maxTopUpAmount } = outputParameters;\n\n if (!values.refinancedCredits || (values.refinancedCredits && !values.refinancedCredits.length)) {\n errors.refinancedCredits = ourOfferPageData.offerWithRefinancing && ourOfferPageData.offerWithoutRefinancing ? \"dbn.ourOffer.refinancing.pleaseSelectElementsWithAlternative.warning\" : \"dbn.ourOffer.refinancing.pleaseSelectElements.warning\";\n }\n\n if ((maxTopUpAmount && values.amount > maxTopUpAmount)) {\n errors.amount = \"dbn.ourOffer.amount.max\";\n }\n\n const valuesLoosesObject: LooseObject = values;\n \n if (!values.refinancedCredits) {\n return;\n }\n\n for (const credit of values.refinancedCredits) {\n const keyParameter = FINANCIAL_INSTITUTION + credit.creditId;\n const valueFinancialInstitution = valuesLoosesObject[keyParameter];\n\n if (_.isEmpty(valueFinancialInstitution)) {\n errors[keyParameter] = \"dbn.cashLoan.ourOffer.error.financialInstitution.required\";\n }\n\n if (valueFinancialInstitution === otherInstitutionId) {\n errors[keyParameter] = \"dbn.cashLoan.ourOffer.error.financialInstitution.incompatible\";\n }\n }\n}\n\nexport function validate(values: FormValues, { otherInstitutionId }: MyFormProps) {\n const { ourOfferPageData } = values;\n const { productParameters } = ourOfferPageData[values.offerType];\n const { minLoanAmount, maxLoanAmount, minTenor, maxTenor } = productParameters;\n\n let errors: any = {};\n\n if (!values.period) {\n errors.period = \"dbn.ourOffer.period.required\";\n } else if (values.period < minTenor) {\n errors.period = \"dbn.ourOffer.period.min\";\n } else if (values.period > maxTenor) {\n errors.period = \"dbn.ourOffer.period.max\";\n }\n\n if (values.amount !== 0 && !values.amount) {\n errors.amount = \"dbn.ourOffer.amount.required\";\n } else if (values.amount < minLoanAmount) {\n errors.amount = \"dbn.ourOffer.amount.min\";\n }\n\n if (!values.paymentType) {\n errors.paymentType = \"dbn.ourOffer.paymentType.required\";\n }\n if (!values.paymentDay) {\n errors.paymentDay = \"dbn.ourOffer.paymentDay.required\";\n }\n\n if (values.offerType === OfferType.WITH_REFINANCING) {\n validateOfferWithRefinancing(values, errors, ourOfferPageData, otherInstitutionId);\n } else {\n if (values.amount > maxLoanAmount) {\n errors.amount = \"dbn.ourOffer.amount.max\";\n }\n }\n\n return errors;\n}\n\nexport function mapPropsToValues(props: MyFormProps) {\n const { initialValues: { amount, period, paymentDay, paymentType, insurance, gdprAcord, refinancedCredits,\n offerType, ourOfferPageData: { offerWithRefinancing, offerWithoutRefinancing } } } = props;\n const computedValues: FormValues & LooseObject = { amount, period, paymentDay, paymentType, insurance, refinancedCredits, gdprAcord, ourOfferPageData: props.initialValues.ourOfferPageData, offerType };\n\n if (!offerType && offerWithoutRefinancing) {\n computedValues.offerType = OfferType.WITHOUT_REFINANCING;\n }\n\n if (!offerWithRefinancing || !offerWithRefinancing.existingCredits || !offerWithRefinancing.existingCredits.length) {\n return computedValues;\n }\n\n if (!offerType) {\n computedValues.offerType = OfferType.WITH_REFINANCING;\n }\n\n // Add optional parameters\n offerWithRefinancing.existingCredits.forEach((item: { creditId: string; financialInstitution: any; }) => {\n computedValues[FINANCIAL_INSTITUTION + item.creditId] = item.financialInstitution;\n });\n\n computedValues.previousRefinancedCredits = refinancedCredits;\n\n return computedValues;\n}\n\ntype ComputeAmountProps = {\n offerType: OfferTypeRequest;\n topUpAmount: number | null;\n minLoanAmount: number;\n loanAmount: number;\n}\n\nfunction computeAmount({ offerType, topUpAmount, minLoanAmount, loanAmount }: ComputeAmountProps): number {\n if (offerType === OfferTypeRequest.offerWithRefinancing && topUpAmount !== null) {\n return topUpAmount >= minLoanAmount ? topUpAmount : minLoanAmount;\n }\n return loanAmount;\n}\n\ntype SynchronizeFormWithCalculatedOffer = {\n response: OurOfferData;\n offerType: OfferTypeRequest;\n setValues: (values: React.SetStateAction, shouldValidate?: boolean | undefined) => void;\n notReplaceOffer?: boolean;\n}\n\nexport function synchronizeFormWithCalculatedOffer({ offerType, response, setValues, notReplaceOffer }: SynchronizeFormWithCalculatedOffer) {\n const { inputParameters, productParameters } = response;\n\n if (inputParameters && productParameters) {\n const { topUpAmount, loanAmount, tenor, insuranceIncluded, installmentTypeId, dueDayId } = inputParameters;\n const { minLoanAmount } = productParameters;\n\n setValues(previousValues => ({\n ...previousValues,\n ourOfferPageData: notReplaceOffer ? previousValues.ourOfferPageData : { ...previousValues.ourOfferPageData, [OfferType[offerType]]: response },\n amount: computeAmount({ offerType, topUpAmount, minLoanAmount, loanAmount }),\n period: tenor,\n insurance: insuranceIncluded,\n paymentType: String(installmentTypeId),\n paymentDay: String(dueDayId),\n previousRefinancedCredits: previousValues.refinancedCredits && previousValues.refinancedCredits.length ? previousValues.refinancedCredits : undefined\n }));\n }\n\n}","import { CSSProperties, useCallback } from \"react\";\nimport { ExistingCredit, RefinancingTabs } from \"../services/domain\";\n\nimport { Category } from \"../../../../services/domain\";\nimport { FinancialDataResponse } from \"../../FinancialInformation/services/domain\";\nimport { Page } from \"flows/CashLoan/services/domain\";\nimport { SelectOption } from \"components/form/DropdownField\";\nimport { palette } from \"omnichannel-design-system/lib/styleConstants\";\nimport { useCashLoanContext } from \"flows/CashLoan/services/cashLoanContext\";\nimport { useFormatMessage } from \"services/formatMessageHook\";\n\ntype ComputeStyleRefinancingSlide = {\n creditId: string;\n checkedItems: Array;\n isCompatible: boolean;\n currentPosition: number;\n itemPosition: number;\n height?: number;\n}\n\nexport const OTHER = \"OTHER\";\n\nexport function computeStyleRefinancingSlide({ creditId, checkedItems, isCompatible, currentPosition, itemPosition, height }: ComputeStyleRefinancingSlide) {\n const style: CSSProperties = {\n border: \"solid\",\n borderWidth: 2,\n borderColor: isCompatible ? palette.blue600 : palette.red700,\n borderRadius: 8,\n padding: 20,\n width: \"calc(100% + 24px)\",\n height\n };\n\n if (currentPosition === itemPosition) {\n style.marginLeft = -12;\n style.marginRight = -12;\n }\n else {\n style.opacity = checkedItems.map(item => item.creditId).includes(creditId) ? 0.8 : 0.5;\n if (currentPosition > itemPosition) {\n style.marginLeft = -24;\n }\n }\n\n return style;\n}\n\ntype ComputeDropDownOptions = {\n category: Category;\n financialDropdownData: FinancialDataResponse;\n}\n\nexport function computeFinancialInformationOptionByCategory({ category, financialDropdownData }: ComputeDropDownOptions): Array {\n let options: SelectOption[] = [];\n const items = financialDropdownData.financialData.find(item => item.categoryId === category);\n\n if (!items) {\n return options;\n }\n\n for (const categoryItem of items.categoryItems) {\n options.push({ value: categoryItem.id.toString(), label: categoryItem.value });\n }\n\n return options;\n}\n\nexport function useCustomFormatMessage(isRefinancing: boolean,) {\n const { formatFirstAvailableRichTextMessage, formatFirstAvailableMessage } = useFormatMessage();\n const { currentPage } = useCashLoanContext();\n \n const getKeysToFormat = useCallback((key: string, isFooter?: boolean) => {\n const result = [key];\n let intermediateKey = key;\n\n if (isFooter) {\n intermediateKey += \".footer\";\n result.unshift(intermediateKey);\n }\n\n if (isRefinancing) {\n intermediateKey = key;\n intermediateKey += (\".\" + RefinancingTabs.REFINANCING);\n result.unshift(intermediateKey);\n\n if (isFooter) {\n intermediateKey += \".footer\";\n result.unshift(intermediateKey);\n }\n }\n\n if (currentPage === Page.PRELIMINARY_OFFER) {\n intermediateKey += \".preliminaryOffer\";\n result.unshift(intermediateKey);\n }\n\n return result\n }, [currentPage, isRefinancing])\n\n const customFormatMessage = useCallback((key: string, isFooter?: boolean, isHTML?: boolean) => isHTML ?\n formatFirstAvailableRichTextMessage(getKeysToFormat(key, isFooter)) :\n formatFirstAvailableMessage(getKeysToFormat(key, isFooter))\n , [formatFirstAvailableRichTextMessage, formatFirstAvailableMessage, getKeysToFormat]);\n\n return {\n getKeysToFormat,\n customFormatMessage\n }\n}","import { AccountOption, usePaymentConfigurationApi } from \"../../../services/paymentConfigurationApi\";\nimport { CashLoanPaymentConfigurationCategories, Category, CategoryItemsInternalNames } from \"../../../services/domain\";\nimport PaymentConfigurationForm, { FormValues } from \"./components/PaymentConfigurationForm\";\nimport { useEffect, useState } from \"react\";\n\nimport { Box } from \"omnichannel-design-system\";\nimport { FinancialDataResponse } from \"../FinancialInformation/services/domain\";\nimport Loader from \"components/Loader\";\nimport { SelectOption } from \"../../../../components/form/DropdownField\";\nimport { getIdByInternalName } from \"helper/financialDataUtils\";\nimport { useCashLoanContext } from \"../../services/cashLoanContext\";\nimport { useFinancialApi } from \"../../../services/financialApi\";\nimport { useSaveConfigureLoanDetailsApi } from \"./services/saveConfigureLoanDetailsApi\";\nimport {EMPTY_STRING} from \"../../../../components/form/utils\";\n\ninterface Props {\n onSubmit: () => unknown;\n onBack: () => unknown;\n}\n\ninterface RepaymentMethodOption {\n value: string,\n label: string\n}\n\nexport interface PaymentConfigurationContext {\n disbursementAccounts: Array,\n repaymentMethods: Array,\n currentAccounts: Array\n}\n\nconst { RepaymentMethod } = Category;\nconst { DIRECT_DEBIT_SINGLE_ACCOUNT, DIRECT_DEBIT_ALL_ACCOUNTS, CASH } = CategoryItemsInternalNames;\nconst acceptedRepaymentOptions: string[] = [DIRECT_DEBIT_SINGLE_ACCOUNT, DIRECT_DEBIT_ALL_ACCOUNTS, CASH];\n\nfunction PaymentConfiguration(props: Props) {\n const { financialData } = useFinancialApi(CashLoanPaymentConfigurationCategories);\n const [financialDropdownData, setFinancialDropdownData] = useState({ financialData: [] });\n const { fetchData, accounts } = usePaymentConfigurationApi();\n const { paymentConfiguration, updatePaymentConfiguration } = useCashLoanContext();\n const [initialValues, setInitialValues] = useState();\n const [formData, setFormData] = useState();\n const { saveConfigureLoanDetails, loading } = useSaveConfigureLoanDetailsApi(props.onSubmit);\n const [repaymentOptions, setRepaymentOptions] = useState>([]);\n\n const handleSubmit = (values: FormValues) => {\n updatePaymentConfiguration(values);\n const directDebitSingleAccountId = getIdByInternalName(RepaymentMethod, DIRECT_DEBIT_SINGLE_ACCOUNT, financialDropdownData);\n const valuesToSubmit = { ...values };\n if (values.repaymentMethod !== directDebitSingleAccountId) {\n valuesToSubmit.currentAccount = EMPTY_STRING;\n }\n saveConfigureLoanDetails({ data: valuesToSubmit });\n };\n\n useEffect(() => {\n setFinancialDropdownData(financialData || { financialData: [] });\n }, [financialData]);\n\n useEffect(() => {\n const getOptions = (category: Category): Array => {\n let options: RepaymentMethodOption[] = [];\n const items = financialDropdownData.financialData.filter(item => item.categoryId === category);\n if (items.length > 0) {\n const { categoryItems } = items[0];\n for (let categoryItem of categoryItems) {\n if (acceptedRepaymentOptions.includes(categoryItem.internalName)) {\n options.push({ value: categoryItem.id.toString(), label: categoryItem.value });\n }\n }\n }\n return options;\n };\n setRepaymentOptions(getOptions(RepaymentMethod));\n }, [financialDropdownData]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n useEffect(() => {\n if (accounts.length > 0 && financialDropdownData.financialData.length > 0) {\n const disbursementAccounts = accounts;\n const currentAccounts = accounts;\n\n if (paymentConfiguration.disbursementAccount) {\n const { disbursementAccount, repaymentMethod, currentAccount, personalAmount, salaryAmount } = paymentConfiguration;\n setInitialValues({\n disbursementAccount,\n repaymentMethod: String(repaymentMethod),\n currentAccount: currentAccount || currentAccounts[0].value,\n personalAmount,\n salaryAmount,\n })\n } else {\n setInitialValues({\n disbursementAccount: disbursementAccounts[0].value,\n repaymentMethod: getIdByInternalName(\n RepaymentMethod,\n currentAccounts.length === 1 ? DIRECT_DEBIT_SINGLE_ACCOUNT : DIRECT_DEBIT_ALL_ACCOUNTS,\n financialDropdownData\n ),\n currentAccount: currentAccounts[0].value\n });\n }\n setFormData({\n disbursementAccounts: disbursementAccounts,\n repaymentMethods: repaymentOptions,\n currentAccounts: currentAccounts\n })\n }\n }, [accounts, repaymentOptions, paymentConfiguration, financialDropdownData]);\n\n if (loading || !initialValues || !formData || !financialDropdownData) {\n return ;\n }\n return (\n \n \n \n );\n\n}\n\nexport default PaymentConfiguration;\n","import { AngleRightIcon, Body, Box, FileIcon, NavigationElement, Space, Stack } from \"omnichannel-design-system\";\nimport { DocumentDetailsType, ReportCodes } from \"pages/DocumentDetails/services/domain\";\nimport { FormikErrors, useFormikContext, withFormik } from \"formik\";\n\nimport { AccountOption } from \"flows/services/paymentConfigurationApi\";\nimport { Button } from \"components/Button\";\nimport { DocumentDetails } from \"pages/DocumentDetails/DocumentDetails\";\nimport DropdownField from \"components/form/DropdownField\";\nimport { Heading } from \"components/Heading\";\nimport { PaymentConfigurationContext } from \"../PaymentConfiguration\";\nimport _ from \"lodash\";\nimport styled from \"styled-components\";\nimport { useFormatMessage } from \"services/formatMessageHook\";\nimport { useState } from \"react\";\n\nexport interface FormValues {\n\tdisbursementAccount: string,\n\trepaymentMethod: string,\n\tcurrentAccount: string,\n\tpersonalAmount?: string,\n\tsalaryAmount?: string\n}\n\ninterface Props {\n\tformData: PaymentConfigurationContext;\n\tfinancialIds: {\n\t\tSINGLE_ACCOUNT_METHOD: string;\n\t\tCASH_METHOD: string;\n\t};\n\tonBack: () => unknown;\n}\n\nconst ContainerStyled = styled(Box)`\n\t.navigation-element-wrapper{\n\t\tborder-radius: 10px;\n\t\tpadding:15px;\n\t\tmargin: 5px;\n\t\tbackground-color: #f5f5f5;\n\t};\n`;\n\nexport function PaymentConfigurationInner(props: Props) {\n\tconst { formData, financialIds: { CASH_METHOD, SINGLE_ACCOUNT_METHOD } } = props;\n\tconst { isValid, touched, errors, values, handleSubmit } = useFormikContext()\n\tconst { formatMessage } = useFormatMessage();\n\tconst [displayAutomaticData, setDisplayAutomaticData] = useState(false);\n\n\tconst getAmount = (value: string, options: Array): string => {\n\t\tconst selectedAccount = options.filter(item => item.value === value)[0];\n\t\treturn selectedAccount?.title + \" \" + (selectedAccount?.availableAmount || \"\").replace(\"RON\", formatMessage(\"dbn.formatAmount.currency\"));\n\t};\n\n\tconst handleAutomaticDebitDocument = () => {\n\t\tsetDisplayAutomaticData(true);\n\t};\n\n\tconst handleCloseAutomaticDebitDetails = () => {\n\t\tsetDisplayAutomaticData(false);\n\t};\n\n\tif (displayAutomaticData) {\n\t\treturn (\n\t\t\t\n\t\t)\n\t}\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{formatMessage(\"dbn.paymentConfigurationForm.description\")}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t{values.repaymentMethod === SINGLE_ACCOUNT_METHOD &&\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\n\t\t\t{values.repaymentMethod !== CASH_METHOD &&\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t
\n\t);\n}\n\ninterface MyFormProps {\n\tonSubmit: (values: any) => unknown;\n\tonBack: () => unknown;\n\tinitialValues: FormValues;\n\tformData: PaymentConfigurationContext;\n\tfinancialIds: {\n\t\tSINGLE_ACCOUNT_METHOD: string;\n\t\tCASH_METHOD: string;\n\t},\n\tpersonalAmount?: string;\n\tsalaryAmount?: string;\n}\n\nconst PaymentConfigurationForm = withFormik({\n\tmapPropsToValues: props => {\n\t\tconst { initialValues } = props;\n\t\tconst { disbursementAccount, repaymentMethod, currentAccount, personalAmount, salaryAmount } = initialValues;\n\t\treturn {\n\t\t\tdisbursementAccount,\n\t\t\trepaymentMethod,\n\t\t\tcurrentAccount,\n\t\t\tpersonalAmount,\n\t\t\tsalaryAmount\n\t\t};\n\t},\n\n\tvalidate: (values: FormValues, props: MyFormProps) => {\n\t\tconst { CASH_METHOD } = props.financialIds;\n\t\tlet errors: FormikErrors = {};\n\n\t\tif (_.isEmpty(values.repaymentMethod)) {\n\t\t\terrors.repaymentMethod = \"dbn.paymentConfigurationForm.repaymentMethod.required\";\n\t\t}\n\t\tif (_.isEmpty(values.disbursementAccount)) {\n\t\t\terrors.disbursementAccount = \"dbn.paymentConfigurationForm.disbursementAccount.required\";\n\t\t}\n\t\tif (values.repaymentMethod !== CASH_METHOD && _.isEmpty(values.currentAccount)) {\n\t\t\terrors.currentAccount = \"dbn.paymentConfigurationForm.currentAccount.required\";\n\t\t}\n\t\treturn errors;\n\t},\n\n\thandleSubmit: (values, bag) => {\n\t\tbag.props.onSubmit(values);\n\t},\n})(PaymentConfigurationInner);\n\nexport default PaymentConfigurationForm;\n","import { executeAxios } from \"services/axiosHook\";\nimport { useCallback, useState } from \"react\";\nimport { AxiosRequestConfig, Method } from \"axios\";\n\nconst saveConfigureLoanDetailsConfig = {\n\turl: \"/packages/loans-ro/accountsConfiguration/save\",\n\tmethod: \"post\" as Method\n};\n\nexport const useSaveConfigureLoanDetailsApi = (onSubmit: Function) => {\n\tconst [loading, setLoading] = useState(false);\n\n\treturn {\n\t\tloading,\n\t\tsaveConfigureLoanDetails: useCallback((apiConfig: AxiosRequestConfig) => {\n\t\t\texecuteAxios({\n\t\t\t\tparams: { ...saveConfigureLoanDetailsConfig, ...apiConfig },\n\t\t\t\tonLoading: setLoading,\n\t\t\t\tonSuccess: onSubmit\n\t\t\t});\n\n\t\t}, [onSubmit])\n\t};\n};\n\n","import { Body, Box, Stack, } from \"omnichannel-design-system\";\nimport { useApprovalStatusApi, useSignPrecontractsApi } from \"./services/signPrecontracts\";\nimport { useEffect, useState } from \"react\";\n\nimport AnalyzingRequest from \"./components/AnalyzingRequest\";\nimport { Heading } from \"components/Heading\";\nimport Loader from \"components/Loader\";\nimport { Page } from \"flows/CashLoan/services/domain\";\nimport RejectedOffer from \"../../FinancialInformationDataAnalyze/components/RejectedOffer\";\nimport SignatureComponent from \"../../../../../pages/Signature/Signature\";\nimport { Status } from \"flows/services/domain\";\nimport ToBeContacted from \"../../../../../pages/ToBeContacted/ToBeContacted\";\nimport { useCashLoanContext } from \"flows/CashLoan/services/cashLoanContext\";\nimport { useFormatMessage } from \"services/formatMessageHook\";\n\ninterface Props {\n\tonSubmit: () => unknown\n}\n\nfunction Signature(props: Props) {\n\tconst { formatMessage } = useFormatMessage();\n\tconst [status, setStatus] = useState(Status.Todo);\n\n\tconst { preContractsSign, preContractsSignLoading } = useSignPrecontractsApi();\n\tconst { fetchDataStatus, contentStatus } = useApprovalStatusApi();\n\tconst { updateStepRequest } = useCashLoanContext();\n\n\tconst handleSubmit = (values: any) => {\n\t\tpreContractsSign({ data: { otp: values.pin } }, () =>\n\t\t\tupdateStepRequest(Page.PRECONTRACTUAL_DOCUMENTS_STATUS_POLLING, fetchDataStatus)\n\t\t);\n\t};\n\tuseEffect(() => {\n\t\tif (contentStatus?.status === Status.Complete) {\n\t\t\tprops.onSubmit();\n\t\t} else if (contentStatus) {\n\t\t\tsetStatus(contentStatus.status);\n\t\t\tif (contentStatus.status === Status.InProgress) {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tfetchDataStatus();\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t}\n\t}, [fetchDataStatus, contentStatus, props]);\n\n\tif (preContractsSignLoading) {\n\t\treturn ;\n\t}\n\n\tif (status === Status.InProgress) {\n\t\treturn \n\t}\n\n\tif (status === Status.ToBeContacted) {\n\t\treturn \n\t}\n\n\tif (status === Status.Rejected) {\n\t\treturn \n\t}\n\n\treturn (\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{formatMessage(\"dbn.documents.signature.description\")}\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t)\n}\n\nexport default Signature;\n","import {Body, Box, Space, Stack} from \"omnichannel-design-system\";\n\nimport {Heading} from \"components/Heading\";\nimport image from \"assets/CashLoan/analyze-request-credit.gif\";\nimport {useFormatMessage} from \"services/formatMessageHook\";\n\nconst AnalyzingRequest = () => {\n\tconst {formatMessage} = useFormatMessage();\n\n\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{formatMessage(\"dbn.analyzingRequest.description\")}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t{formatMessage(\"dbn.analyzingRequest.title\")}/\n\t\t\t\t\n\t\t\t\n\t);\n}\n\nexport default AnalyzingRequest;","import { AxiosRequestConfig, Method } from \"axios\";\nimport { axiosInstance, executeAxios } from \"services/axiosHook\";\nimport { useCallback, useState } from \"react\";\n\nimport { Status } from \"flows/services/domain\";\n\nconst apiConfigSignPrecontracts = {\n\tmethod: \"post\" as Method,\n\turl: \"packages/loans-ro/precontracts/sign\"\n};\n\nconst apiConfigApprovalStatus = {\n\tmethod: \"post\" as Method,\n\turl: \"packages/loans-ro/contracts/approval/status\"\n};\ntype LoanApprovalStatusResponse = { status: Status };\n\nexport const useSignPrecontractsApi = () => {\n\tconst [loading, setLoading] = useState(false);\n\n\treturn {\n\t\tpreContractsSignLoading: loading,\n\t\tpreContractsSign: useCallback((apiConfig: AxiosRequestConfig, onSuccess: any) => {\n\t\t\texecuteAxios({\n\t\t\t\tparams: { ...apiConfigSignPrecontracts, ...apiConfig },\n\t\t\t\tonLoading: setLoading,\n\t\t\t\tonSuccess\n\t\t\t});\n\t\t}, [])\n\t};\n};\n\nexport const useApprovalStatusApi = () => {\n\tconst [contentStatus, setContentStatus] = useState();\n\tconst [error, setError] = useState();\n\n\treturn {\n\t\tcontentStatus,\n\t\terror,\n\t\tfetchDataStatus: useCallback(() => {\n\t\t\taxiosInstance.request(apiConfigApprovalStatus).then((response) => {\n\t\t\t\tsetContentStatus(response.data);\n\t\t\t}).catch((err) => {\n\t\t\t\tsetError(err.response);\n\t\t\t});\n\t\t}, [])\n\t};\n};","import { useEffect, useState } from \"react\";\n\nimport { CheckSignStatus } from \"components/PinSgnaturePolling/service/domain\";\nimport { Method } from \"axios\";\nimport { Page } from \"../../../services/domain\";\nimport PinSignaturePolling from \"components/PinSgnaturePolling/PinSignaturePolling\";\nimport Signature from \"../Signature/Signature\";\nimport { useCashLoanContext } from \"../../../services/cashLoanContext\";\nimport { useCheckSignAuthorization } from \"components/PinSgnaturePolling/service/checkSignaturePolling\";\nimport { useFormatMessage } from \"services/formatMessageHook\";\n\nconst checkSignAuthorizationCallConfig = {\n url: \"/packages/loans-ro/precontracts/check\",\n method: \"post\" as Method,\n};\n\ninterface Props {\n onSubmit: () => unknown;\n onBack: () => unknown;\n}\n\nfunction SignaturePolling(props: Props) {\n const { formatMessage } = useFormatMessage();\n const { checkSignStatus, checkSignAuthorization } = useCheckSignAuthorization(checkSignAuthorizationCallConfig);\n const { updateCurrentPage } = useCashLoanContext();\n const [stepBack, setStepBack] = useState(false);\n const [loading, setLoading] = useState(true);\n\n useEffect(() => {\n setStepBack(checkSignStatus && checkSignStatus !== CheckSignStatus.OK && checkSignStatus !== CheckSignStatus.RETRY);\n setLoading(checkSignStatus !== CheckSignStatus.OK);\n }, [checkSignStatus]);\n\n const handlePinComponentSubmit = () => {\n updateCurrentPage(Page.LOAN_APPROVAL);\n }\n\n return }\n />;\n}\n\nexport default SignaturePolling;\n","import AnalyzingRequest from \"../Signature/components/AnalyzingRequest\";\nimport { Method } from \"axios\";\nimport RejectedOffer from \"../../FinancialInformationDataAnalyze/components/RejectedOffer\";\nimport { Status } from \"./service/domain\";\nimport ToBeContacted from \"../../../../../pages/ToBeContacted/ToBeContacted\";\nimport { useEffect } from \"react\";\nimport { usePoolingService } from \"flows/services/poolingServices\";\nimport {useFormatMessage} from \"../../../../../services/formatMessageHook\";\n\nconst apiConfigApprovalStatus = {\n method: \"post\" as Method,\n url: \"packages/loans-ro/contracts/approval/status\"\n};\n\ninterface Props {\n onSubmit: () => unknown,\n onBack?: () => unknown\n}\n\nfunction StatusPolling({ onSubmit }: Props) {\n const { formatMessage } = useFormatMessage();\n const { currentStatus, setCurrentStatus, queryStatus } = usePoolingService(apiConfigApprovalStatus);\n\n useEffect(() => {\n setCurrentStatus(Status.InProgress);\n queryStatus({\n [Status.InProgress]: () => true,\n [Status.Complete]: () => {\n onSubmit();\n return false;\n }\n });\n }, [onSubmit, queryStatus, setCurrentStatus])\n\n if (currentStatus === Status.ToBeContacted) {\n return ;\n }\n\n if (currentStatus === Status.Rejected) {\n return ;\n }\n\n return ;\n}\n\nexport default StatusPolling;","export enum Status {\n Todo = \"Todo\",\n InProgress = \"InProgress\",\n ToBeContacted = \"ToBeContacted\",\n Complete = \"Complete\",\n Rejected = \"Rejected\"\n // Error = \"Error\" //TODO clarify with BA what happens in case of an error\n}","import { useEffect, useState } from \"react\";\nimport { useSaveSelectedExternalCreditsApi, useSelectedExternalCreditsApi } from \"./services/externalCreditsApi\";\n\nimport { Box } from \"omnichannel-design-system\";\nimport { CreditInfo } from \"./services/domain\";\nimport { ExternalCreditCategories } from \"../../../services/domain\";\nimport ExternalCreditsForm from \"./components/ExternalCreditsForm\";\nimport Loader from \"../../../../components/Loader\";\nimport { useFinancialApi } from \"../../../services/financialApi\";\n\ninterface Props {\n onSubmit: () => unknown\n}\n\nconst SelectedExternalCredits = (props: Props) => {\n const { onSubmit } = props;\n const { financialData, financialDataLoading } = useFinancialApi(ExternalCreditCategories);\n const { externalCredits, externalCreditsLoading } = useSelectedExternalCreditsApi();\n const { saveExternalCredits, loading: saveExternalCreditsLoading } = useSaveSelectedExternalCreditsApi();\n const [formValues, setFormValues] = useState>(externalCredits);\n\n useEffect(() => {\n setFormValues(externalCredits);\n }, [externalCredits]);\n\n const updateValues = (values: any) => {\n setFormValues(Object.values(formValues).map((credit: CreditInfo) => ({\n ...credit,\n iban: values[\"iban_\" + credit.creditId],\n contractNumber: values[\"contractNumber_\" + credit.creditId]\n })));\n };\n\n const getCreditInfoData = (values: Array) : Array => {\n return values.map(creditItem =>{ return {...creditItem, iban:creditItem.iban.toUpperCase()};});\n }\n\n const handleSubmit = () => {\n saveExternalCredits({ data: getCreditInfoData(Object.values(formValues))}).then(() => {\n onSubmit();\n });\n };\n\n if (saveExternalCreditsLoading || financialDataLoading || externalCreditsLoading) {\n return (\n \n );\n }\n\n return (\n \n {\n \n }\n \n );\n}\n\nexport default SelectedExternalCredits;\n","import ReadOnlyField from \"components/ReadOnlyField\"\nimport { SelectOption } from \"components/form/DropdownField\";\nimport { useFormatMessage } from \"services/formatMessageHook\";\nimport { useFormatNumber } from \"services/formatNumberHook\";\n\ntype CreditTypeFieldProps = {\n type: string;\n totalAmount: number;\n typeList: Array;\n}\n\nexport default function CreditTypeField({totalAmount, type, typeList}: CreditTypeFieldProps){\n const { formatMessage } = useFormatMessage();\n const { formatAmount } = useFormatNumber();\n\n const labelItem = typeList.find(item => item.value === type);\n\n return(\n \n )\n}","import {\n Body,\n Box,\n CheckboxPanel,\n Divider,\n Heading as HeadingDS,\n ReadOnlyField,\n Space,\n Stack,\n buttonLink\n} from \"omnichannel-design-system\";\nimport { CategoryItem, FinancialDataResponse, FinancialElement } from \"../../FinancialInformation/services/domain\";\nimport { DocumentDetailsType, ReportCodes } from \"../../../../../pages/DocumentDetails/services/domain\";\nimport { FormikErrors, useFormikContext, withFormik } from \"formik\";\nimport _, { toNumber } from \"lodash\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { Button } from \"components/Button\";\nimport { Category } from \"../../../../services/domain\";\nimport { CreditInfo } from \"../services/domain\";\nimport CreditTypeField from \"./CreditTypeField\";\nimport { DocumentDetails } from \"../../../../../pages/DocumentDetails/DocumentDetails\";\nimport { EMPTY_STRING } from \"components/form/utils\";\nimport { Heading } from \"components/Heading\";\nimport { LooseObject } from \"services/types\";\nimport TextField from \"components/form/TextField\";\nimport { TextFieldUppercase } from \"../styles/styles\";\nimport { computeFinancialInformationOptionByCategory } from \"../../OurOffer/utils/utils\";\nimport moment from \"moment\";\nimport { palette } from \"omnichannel-design-system/lib/styleConstants\";\nimport { useFormatMessage } from \"services/formatMessageHook\";\nimport { useFormatNumber } from \"services/formatNumberHook\";\nimport { usePrevious } from \"helper/usePrevious\";\nimport { validateIbanApi } from \"../services/validateIbanApi\";\n\ninterface Props {\n updateValues: Function\n financialData: FinancialDataResponse\n creditsData: Array\n onSubmit: Function\n}\n\nconst {\n CL_REFINANCING_INFORMATION\n} = DocumentDetailsType;\n\nexport function ExternalCreditInner(props: Props) {\n const { creditsData, financialData, updateValues } = props;\n const { values, errors, touched, isValid, setFieldTouched, handleSubmit } = useFormikContext();\n const myErrors: any = errors;\n const myTouched: any = touched;\n const prevValues = usePrevious(values);\n const { formatAmount } = useFormatNumber();\n const { formatMessage } = useFormatMessage();\n const [validationError, setValidationError] = useState({});\n const [ibansNumberValidity, setIbansNumberValidity] = useState({});\n const [ibansBicValidity, setIbansBicValidity] = useState({});\n const [revolving, setRevolving] = useState({});\n const [ibanValidationInProgress, setIbanValidationInProgress] = useState(false);\n const [showRefinancingInfo, setShowRefinancingInfo] = useState(false);\n\n const onSubmit = () => {\n Object.keys(values).forEach(item => {\n setFieldTouched(item, true);\n })\n if (isValid) {\n handleSubmit();\n }\n };\n\n useEffect(() => {\n let validationErrors = {};\n Object.keys(ibansBicValidity).forEach(item => {\n let errorMessageKey;\n if (!ibansBicValidity[item]) {\n errorMessageKey = \"dbn.externalCredit.iban.bic.not.valid\";\n }\n if (!ibansNumberValidity[item]) {\n errorMessageKey = \"dbn.externalCredit.iban.number.not.valid\";\n }\n validationErrors = {\n ...validationErrors,\n [item]: errorMessageKey\n };\n });\n setValidationError(validationErrors);\n }, [ibansBicValidity, ibansNumberValidity]);\n\n const getFinancialInstitutionName = (bankId: number) => {\n if (!financialData) {\n return EMPTY_STRING;\n }\n const items = financialData.financialData.find((item: FinancialElement) => item.categoryId === Category.Banks);\n if (!items) {\n return EMPTY_STRING;\n }\n const bankItem = items.categoryItems.find((item: CategoryItem) => item.id === bankId);\n return bankItem ? bankItem.value : EMPTY_STRING;\n\n }\n\n const validateIbanDebounce = useMemo(() =>\n _.debounce((iban: string, onSuccess: Function, onFail: Function, onLoading: Function) => {\n validateIbanApi({ data: { iban } }, { onSuccess, onFail, onLoading })\n }, 1000), []\n );\n\n useEffect(() => {\n if (values !== prevValues) {\n updateValues(values)\n }\n }, [values, prevValues, updateValues]);\n\n const validateBicCode = useCallback((iban: string, financialInstitution: string) => {\n if (financialData) {\n const items = financialData.financialData.find((item: FinancialElement) => item.categoryId === Category.Bic);\n if (items) {\n const bicItem = items.categoryItems.find((item: CategoryItem) => item.id === toNumber(financialInstitution));\n return !bicItem || iban.substr(4, 4).toUpperCase() === bicItem.value.substr(0, 4).toUpperCase();\n }\n }\n return true;\n }, [financialData]);\n\n const validateCreditByIban = useCallback((credit: CreditInfo, iban: string, needsDebounce: boolean) => {\n if (iban.length !== 24) {\n return;\n }\n setIbansNumberValidity(prevState => ({\n ...prevState,\n [credit.creditId]: true\n }))\n let isBicValid = validateBicCode(iban, credit.financialInstitution);\n setIbansBicValidity(prevState => ({\n ...prevState,\n [credit.creditId]: isBicValid\n }))\n\n const onValidateIbanSuccess = (isValidIban: boolean) => {\n setIbansNumberValidity(prevState => ({\n ...prevState,\n [credit.creditId]: isValidIban\n }))\n }\n const onValidateIbanError = () => {\n setIbansNumberValidity(prevState => ({\n ...prevState,\n [credit.creditId]: false\n }))\n }\n const onValidateIbanLoading = (loading: boolean) => {\n setIbanValidationInProgress(loading);\n }\n\n if (isBicValid) {\n if (needsDebounce) {\n setIbanValidationInProgress(true);\n validateIbanDebounce(iban, onValidateIbanSuccess, onValidateIbanError, onValidateIbanLoading);\n } else {\n validateIbanApi(\n { data: { iban } },\n { onSuccess: onValidateIbanSuccess, onFail: onValidateIbanError, onLoading: onValidateIbanLoading })\n }\n }\n }, [validateIbanDebounce, validateBicCode]);\n\n const initialActionsDone = useRef(false);\n useEffect(() => {\n if (initialActionsDone.current) {\n return;\n }\n let revolvingCredits = {};\n Object.values(creditsData).forEach(credit => {\n if (credit.loanType === \"18\" || credit.loanType === \"19\") {\n revolvingCredits = { ...revolvingCredits, [credit.creditId]: true };\n }\n if (credit.iban && credit.iban.length === 24) {\n validateCreditByIban(credit, credit.iban, false);\n }\n });\n setRevolving(revolvingCredits);\n initialActionsDone.current = true;\n }, [creditsData, validateCreditByIban]);\n\n const renderHeader = (credit: CreditInfo) => (\n \n \n \n \n {!revolving[credit.creditId] &&\n \n \n }\n \n );\n\n const renderContent = (credit: CreditInfo) => (\n \n \n \n \n \n \n \n \n \n \n \n \n {formatMessage(\"dbn.externalCredit.financialInstitution.description\")}\n \n \n validateCreditByIban(credit, newValue, true)}\n />\n \n \n \n );\n\n if (showRefinancingInfo) {\n return (\n setShowRefinancingInfo(false)}\n onConfirm={() => setShowRefinancingInfo(false)}\n isReadOptional={true}\n translationsKeys={{\n title: \"dbn.externalCreditsForm.refinancing.info.title\",\n confirmationButtonText: \"dbn.externalCreditsForm.refinancing.info.confirm\",\n downloadButtonText: \"dbn.externalCreditsForm.refinancing.info.download.document\"\n }}\n />\n )\n }\n\n return (<>\n \n \n\n \n \n {formatMessage(\"dbn.externalCreditsForm.description\")}\n \n \n \n \n {[\n formatMessage(\"dbn.externalCreditsForm.refinancingAdditionalInformation.description\"),\n buttonLink(() => setShowRefinancingInfo(true), formatMessage(\"dbn.externalCreditsForm.description.link.placeholder\"))\n ]}\n \n \n \n \n \n {formatMessage(\"dbn.externalCreditsForm.subtitle\")}\n \n \n \n\n {creditsData.map((credit, index) => (\n \n \n \n \n ))}\n \n !item) ||\n Object.values(ibansNumberValidity).some(item => !item)}\n />\n \n )\n}\n\ninterface MyFormProps {\n updateValues: Function\n financialData: FinancialDataResponse\n creditsData: Array\n onSubmit: Function\n}\n\nconst ExternalCreditsForm = withFormik({\n mapPropsToValues: (props: MyFormProps) => {\n const { creditsData } = props;\n const initialValues: LooseObject = {};\n\n creditsData.forEach(credit => {\n initialValues[\"iban_\" + credit.creditId] = credit.iban;\n initialValues[\"contractNumber_\" + credit.creditId] = credit.contractNumber;\n })\n return initialValues;\n },\n validate: (values: LooseObject, props: Props) => {\n let errors: FormikErrors = {};\n props.creditsData.forEach((credit) => {\n const ibanKey = \"iban_\" + credit.creditId;\n const contractNumberKey = \"contractNumber_\" + credit.creditId;\n if (!values[ibanKey]) {\n errors[ibanKey] = \"dbn.externalCredit.iban.empty\";\n } else if (values[ibanKey].length !== 24) {\n errors[ibanKey] = \"dbn.externalCredit.iban.length.notValid\";\n } else if (values[ibanKey].substr(0, 2).toUpperCase() !== \"RO\") {\n errors[ibanKey] = \"dbn.externalCredit.iban.notDomestic\";\n } else if (values[ibanKey].substr(4, 4).toUpperCase() === \"TREZ\") {\n errors[ibanKey] = \"dbn.externalCredit.iban.treasury.account\";\n }\n\n if (!values[contractNumberKey]) {\n errors[contractNumberKey] = \"dbn.externalCredit.contractNumber.empty\";\n } else if (values[contractNumberKey].length > 100) {\n errors[contractNumberKey] = \"dbn.externalCredit.contractNumber.tooLong\";\n }\n })\n\n return errors;\n },\n handleSubmit: (values: LooseObject, bag: { props: { onSubmit: Function } }) => {\n bag.props.onSubmit(values);\n }\n})(ExternalCreditInner);\n\nexport default ExternalCreditsForm;","import {AxiosRequestConfig, Method} from \"axios\";\nimport {axiosInstance, useAxios} from \"../../../../../services/axiosHook\";\nimport {useCallback, useEffect, useState} from \"react\";\n\nimport {externalCredits} from \"./mockExternalCredits\";\n\nexport const externalCreditsCallConfig = {\n url: \"/packages/loans-ro/externalCredits/selected\",\n method: \"post\" as Method\n};\n\nconst saveSelectedExternalCreditsConfig = {\n url: \"/packages/loans-ro/externalCredits/save\",\n method: \"post\" as Method\n};\n\nexport const useSaveSelectedExternalCreditsApi = () => {\n const [loading, setLoading] = useState(false);\n\n return {\n loading,\n saveExternalCredits: useCallback((apiConfig: AxiosRequestConfig) => {\n setLoading(true);\n return axiosInstance.request({...saveSelectedExternalCreditsConfig, ...apiConfig})\n .finally(() => {\n setLoading(false)\n });\n }, [])\n };\n};\n\nexport const useSelectedExternalCreditsApi = () => {\n const {response, error, loading, fetchData} = useAxios(externalCreditsCallConfig);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n return {\n externalCredits: response || (process.env.REACT_APP_USE_MOCK && externalCredits),\n externalCreditsError: error,\n externalCreditsLoading: loading\n };\n};","export const externalCredits = [\n {\n \"creditId\":1,\n \"creditValue\": 1000,\n \"monthlyPayment\": 25,\n \"remainingValue\": 15000,\n \"openingDate\": \"2015-02-20\",\n \"financialInstitution\": \"177\",\n \"loanType\": \"18\"\n },\n {\n \"creditId\":2,\n \"creditValue\": 2000,\n \"monthlyPayment\": 50,\n \"remainingValue\": 8300,\n \"openingDate\": \"2020-01-01\",\n \"financialInstitution\": \"61\",\n \"loanType\": \"17\"\n }\n]","import {AxiosRequestConfig, Method} from \"axios\";\n\nimport {executeAxios, ExecuteAxiosFunctions} from \"../../../../../services/axiosHook\";\n\nexport const validateIbanApiConfig = {\n url: \"/packages/loans-ro/externalCredits/validateIban\",\n method: \"post\" as Method\n};\n\nexport function validateIbanApi(apiConfig: AxiosRequestConfig, promiseFunctions?: ExecuteAxiosFunctions) {\n executeAxios({\n params: {...validateIbanApiConfig, ...apiConfig},\n onSuccess: promiseFunctions?.onSuccess,\n onLoading: promiseFunctions?.onLoading,\n onFail: promiseFunctions?.onFail\n })\n}\n","import {Box} from \"omnichannel-design-system\";\nimport styled from \"styled-components\";\n\nexport const TextFieldUppercase = styled(Box)`\ninput{text-transform: uppercase;}\n`","import { ActiveApplication, RejectedApplication } from \"../../services/domain\";\nimport {\n CashLoanAction,\n CashLoanContextProviderProps,\n CashLoanState,\n OurOffer,\n Page,\n PagesWithoutStep,\n PaymentConfiguration,\n initialCashLoanState\n} from \"./domain\";\nimport React, { useCallback, useContext, useMemo, useReducer } from \"react\";\n\nimport { FinancialInformationValues } from \"../pages/FinancialInformation/services/domain\";\nimport { InitialContextState } from \"../../../constants/types/contextTypes\";\nimport { Method } from \"axios\";\nimport { OfferDataResponse } from \"../pages/OurOffer/services/domain\";\nimport { constVoid } from \"fp-ts/lib/function\";\nimport { executeAxios } from \"services/axiosHook\";\nimport { reducer } from \"./reducer\";\n\nconst {\n CURRENT_PAGE_UPDATE,\n FINANCIAL_INFORMATION_UPDATE,\n OUR_OFFER_UPDATE,\n PAYMENT_CONFIGURATION_UPDATE,\n REPLACE_CONTEXT_AFTER_RESUME,\n INITIAL_OFFER_DATA_RESPONSE,\n UPDATE_PAGE_TO_EXISTING_BLOCKING_APPLICATIONS,\n} = CashLoanAction;\n\ninterface InitialContextStateCashLoan extends InitialContextState {\n state: CashLoanState\n}\n\nexport const initialContextState: InitialContextStateCashLoan = {\n state: initialCashLoanState,\n dispatch: constVoid\n};\n\nconst updateCurrentStep = {\n url: \"/packages/loans-ro/application/step\",\n method: \"post\" as Method,\n};\n\nconst CashLoanContext = React.createContext(initialContextState);\n\nconst CashLoanContextProvider = (props: CashLoanContextProviderProps) => {\n\n const cashLoanState = props.initialState;\n const [state, dispatch] = useReducer(reducer, cashLoanState);\n\n const value = useMemo(() => ({ state, dispatch }), [state]);\n return (\n \n {props.children}\n \n );\n}\n\nconst useCashLoanContext = () => {\n const { state, dispatch } = useContext(CashLoanContext);\n\n const updateStepRequest = useCallback((page: Page, onSuccess?: Function) => {\n executeAxios({\n params: { ...updateCurrentStep, data: { newStep: page } },\n onSuccess: () => {\n dispatch({ type: CURRENT_PAGE_UPDATE, value: page });\n onSuccess && onSuccess();\n }\n });\n // Wait until the step is send to be\n dispatch({ type: CURRENT_PAGE_UPDATE, value: Page.LOADING });\n }, [dispatch]);\n\n const updateCurrentPage = useCallback((currentPage: Page) => {\n if (PagesWithoutStep.includes(currentPage)) {\n dispatch({ type: CURRENT_PAGE_UPDATE, value: currentPage })\n } else {\n updateStepRequest(currentPage)\n }\n }, [dispatch, updateStepRequest]);\n\n const updateFinancialInformation = useCallback((financialInformation: FinancialInformationValues) => {\n dispatch({ type: FINANCIAL_INFORMATION_UPDATE, value: financialInformation });\n }, [dispatch]);\n\n const updateOurOffer = useCallback((ourOffer: OurOffer) => {\n dispatch({ type: OUR_OFFER_UPDATE, value: ourOffer });\n }, [dispatch]);\n\n const updatePaymentConfiguration = useCallback((paymentConfiguration: PaymentConfiguration) => {\n dispatch({ type: PAYMENT_CONFIGURATION_UPDATE, value: paymentConfiguration });\n }, [dispatch]);\n\n const setContext = useCallback((newContext: CashLoanState) => {\n dispatch({ type: REPLACE_CONTEXT_AFTER_RESUME, value: newContext });\n }, [dispatch]);\n\n const setInitialOffers = useCallback((initialOffer: OfferDataResponse) => {\n dispatch({ type: INITIAL_OFFER_DATA_RESPONSE, value: initialOffer });\n }, [dispatch]);\n\n const updateCurrentPageToExistingBlockingApplications = useCallback((activeApplications?: ActiveApplication[], rejectedApplication?: RejectedApplication) => {\n dispatch({ type: UPDATE_PAGE_TO_EXISTING_BLOCKING_APPLICATIONS, value: { activeApplications, rejectedApplication } });\n }, [dispatch]);\n\n return {\n ...state,\n updateCurrentPage,\n updateFinancialInformation,\n updateOurOffer,\n updatePaymentConfiguration,\n setContext,\n updateStepRequest,\n setInitialOffers,\n updateCurrentPageToExistingBlockingApplications,\n };\n};\n\nexport { CashLoanContextProvider, useCashLoanContext };","import { AxiosRequestConfig, Method } from \"axios\";\nimport { ExecuteAxiosFunctions, executeAxios } from \"services/axiosHook\";\nimport { useCallback, useState } from \"react\";\n\nconst docConsentTimestampConfig = {\n\turl: \"/packages/loans-ro/updateDocConsentTimestamp\",\n\tmethod: \"post\" as Method,\n};\n\nexport const useDocConsentTimestampApi = () => {\n\tconst [loading, setLoading] = useState(false);\n\treturn {\n\t\tloading,\n\t\tupdateConsentTimestamp: useCallback((apiConfig: AxiosRequestConfig, { onSuccess, onFail}: ExecuteAxiosFunctions) => {\n\t\t\texecuteAxios({\n\t\t\t\tparams: { ...docConsentTimestampConfig, ...apiConfig },\n\t\t\t\tonSuccess,\n\t\t\t\tonFail,\n\t\t\t\tonLoading: setLoading\n\t\t\t})\n\t\t}, [])\n\t};\n};\n\nconst paramConsentTimestampConfig = {\n\turl: \"/packages/loans-ro/updateParamConsentTimestamp\",\n\tmethod: \"post\" as Method,\n};\n\nexport const useParamConsentTimestampApi = () => {\n\tconst [loading, setLoading] = useState(false);\n\n\treturn {\n\t\tloading,\n\t\tupdateParamConsentTimestamp: useCallback((apiConfig: AxiosRequestConfig, { onSuccess, onFail }: ExecuteAxiosFunctions) => {\n\t\t\texecuteAxios({\n\t\t\t\tparams: { ...paramConsentTimestampConfig, ...apiConfig },\n\t\t\t\tonSuccess,\n\t\t\t\tonFail,\n\t\t\t\tonLoading: setLoading\n\t\t\t})\n\t\t}, [])\n\t};\n};\n\nconst discardConsentTimestampConfig = {\n\turl: \"/packages/loans-ro/discardParamConsentsTimestampByDoc\",\n\tmethod: \"post\" as Method,\n};\n\nexport const useDiscardConsentTimestampApi = () => {\n\tconst [error, setError] = useState();\n\n\treturn {\n\t\terror,\n\t\tdiscardConsentTimestamp: useCallback((apiConfig: AxiosRequestConfig, { onSuccess }: ExecuteAxiosFunctions) => {\n\t\t\texecuteAxios({\n\t\t\t\tparams: { ...discardConsentTimestampConfig, ...apiConfig },\n\t\t\t\tonSuccess,\n\t\t\t\tonFail: setError\n\t\t\t})\n\t\t}, [])\n\t};\n};\n\n","import { Method } from \"axios\";\nimport { executeAxios, ExecuteAxiosFunctions } from \"services/axiosHook\";\n\nexport enum REQUEST_DAR {\n CONSUMER_FINANCE_CONSENTS = \"ConsumerFinanceInitialConsentsRO\",\n CONSUMER_FINANCE_INITIAL_PRECONTRACTUAL_RO = \"ConsumerFinanceInitialPrecontractualRO\",\n CONSUMER_FINANCE_INITIAL_CONTRACTUAL_RO = \"ConsumerFinanceInitialContractualRO\"\n}\n\nconst apiConfig = {\n method: \"post\" as Method,\n url: \"packages/loans-ro/dar/initial\"\n};\n\nexport function sendDarOption(darCode: REQUEST_DAR, details?: ExecuteAxiosFunctions) {\n executeAxios({\n params: { ...apiConfig, data: { darCode } },\n onSuccess: details?.onSuccess,\n onFail: details?.onFail,\n onLoading: details?.onLoading,\n });\n}","import { ActiveApplication, RejectedApplication } from \"../../services/domain\";\nimport { ExistingCredit, OfferDataResponse, OfferType } from \"../pages/OurOffer/services/domain\";\n\nimport { FinancialInformationValues } from \"../pages/FinancialInformation/services/domain\";\n\nexport interface CashLoanState {\n currentPage: string;\n financialInformation: FinancialInformationValues;\n ourOffer?: OurOffer;\n paymentConfiguration: PaymentConfiguration;\n applicationId?: string;\n cancelableApplication?: boolean;\n initialOffersResponse?: OfferDataResponse;\n kycExpired?: boolean;\n activeApplications: ActiveApplication[];\n rejectedApplication?: RejectedApplication;\n}\n\nexport interface OurOffer {\n amount: number;\n period: number;\n paymentType: string;\n paymentDay: string;\n insurance: boolean;\n gdprAcord: boolean;\n ourOfferPageData: OfferDataResponse;\n offerType: OfferType;\n refinancedCredits?: Array;\n}\n\nexport interface PaymentConfiguration {\n disbursementAccount: string,\n repaymentMethod: string,\n currentAccount: string,\n personalAmount?: string,\n salaryAmount?: string\n}\n\nexport enum Page {\n AGREEMENTS = \"agreements\",\n AGREEMENTS_SIGNATURE_POLLING = \"agreementsSignaturePolling\",\n FINANCIAL_INFORMATION = \"financialInformation\",\n FINANCIAL_INFORMATION_DATA_ANALYZE = \"financialInformationDataAnalyze\",\n PAYMENT_CONFIGURATION = \"paymentConfiguration\",\n CONTRACTS = \"contracts\",\n PRELIMINARY_OFFER = \"preliminaryOffer\",\n INCOMES_DOCUMENTS = \"incomeDocuments\",\n ADDITIONAL_INCOME_DOCUMENTS = \"additionalIncomeDocument\",\n ADDITIONAL_INCOME_DOCUMENTS_DATA_ANALYZE = \"additionalIncomeDocumentDataAnalyze\",\n OUR_OFFER = \"ourOffer\",\n CONTRACT_SIGNATURE = \"contractSignature\",\n LOAN_APPROVAL = \"loanApproval\",\n GRANTED_CREDIT = \"grantedCredit\",\n SUMMARY_OFFER = \"summaryOffer\",\n PRECONTRACTUAL_DOCUMENTS_SIGNATURE_POLLING = \"precontractualDocumentsSignaturePolling\",\n PRECONTRACTUAL_DOCUMENTS_STATUS_POLLING = \"precontractualDocumentsStatusPolling\",\n LOADING = \"LOADING\",\n ACTIVE_OFFER = \"activeOffer\",\n SELECTED_EXTERNAL_CREDITS = \"selectedExternalCredits\",\n EXPIRED = \"EXPIRED\",\n CANCEL_APPLICATION_FEEDBACK = \"cancelApplicationFeedback\",\n FINISH_CASH_LOAN_WITH_FEEDBACK = \"finishCashLoanWithFeedback\",\n KYC_EXPIRED = \"kycExpired\",\n EXISTING_BLOCKING_APPLICATIONS = \"existingBlockingApplications\",\n}\n\nexport enum CashLoanAction {\n CURRENT_PAGE_UPDATE = \"currentPage_update\",\n FINANCIAL_INFORMATION_UPDATE = \"financialInformation_update\",\n OUR_OFFER_UPDATE = \"ourOffer_update\",\n PAYMENT_CONFIGURATION_UPDATE = \"paymentConfiguration_update\",\n CONTINUE_UNFINISHED_LOAN = \"continueUnfinishedLoan\",\n REPLACE_CONTEXT_AFTER_RESUME = \"replaceContextAfterResume\",\n INITIAL_OFFER_DATA_RESPONSE = \"initialOfferDataResponse\",\n KYC_EXPIRED_UPDATE = \"kycExpiredUpdate\",\n UPDATE_PAGE_TO_EXISTING_BLOCKING_APPLICATIONS = \"updatePageToExistingBlockingApplications\",\n}\n\nexport const PagesWithoutStep = [\n Page.AGREEMENTS_SIGNATURE_POLLING,\n Page.PRECONTRACTUAL_DOCUMENTS_SIGNATURE_POLLING,\n Page.CANCEL_APPLICATION_FEEDBACK,\n Page.AGREEMENTS,\n Page.KYC_EXPIRED,\n];\n\nexport type CashLoanContextProviderProps = {\n children: any;\n initialState: CashLoanState;\n};\n\nexport const initialCashLoanState: CashLoanState = {\n currentPage: Page.AGREEMENTS,\n applicationId: undefined,\n financialInformation: {\n professionalStatus: \"\",\n sourceOfIncome: \"\",\n occupation: \"\",\n dependents: \"\",\n maritalStatus: \"\",\n ucfinExpose: \"\",\n birthNumber: \"\",\n expirationDate: \"\",\n otherIncomeTypes: []\n\n },\n paymentConfiguration: {\n disbursementAccount: \"\",\n repaymentMethod: \"\",\n currentAccount: \"\",\n personalAmount: \"\",\n salaryAmount: \"\"\n },\n activeApplications: [],\n rejectedApplication: undefined,\n};","import { CashLoanAction, CashLoanState, Page } from \"./domain\";\n\nimport { Action } from \"constants/types/contextTypes\";\n\nconst {\n CURRENT_PAGE_UPDATE,\n FINANCIAL_INFORMATION_UPDATE,\n OUR_OFFER_UPDATE,\n PAYMENT_CONFIGURATION_UPDATE,\n REPLACE_CONTEXT_AFTER_RESUME,\n INITIAL_OFFER_DATA_RESPONSE,\n UPDATE_PAGE_TO_EXISTING_BLOCKING_APPLICATIONS,\n} = CashLoanAction;\n\nexport const reducer = (state: CashLoanState, action: Action) => {\n const { type, value } = action;\n\n switch (type) {\n case CURRENT_PAGE_UPDATE: return { ...state, currentPage: value };\n case FINANCIAL_INFORMATION_UPDATE: return { ...state, financialInformation: value };\n case OUR_OFFER_UPDATE: return { ...state, ourOffer: value };\n case PAYMENT_CONFIGURATION_UPDATE: return { ...state, paymentConfiguration: value };\n case INITIAL_OFFER_DATA_RESPONSE: return { ...state, initialOffersResponse: value };\n case UPDATE_PAGE_TO_EXISTING_BLOCKING_APPLICATIONS: return { ...state, activeApplications: value.activeApplications ?? [], rejectedApplication: value.rejectedApplication, currentPage: Page.EXISTING_BLOCKING_APPLICATIONS };\n case REPLACE_CONTEXT_AFTER_RESUME: return value;\n default: return state;\n }\n};","import { LocalizedString, unsafeLocalizedString } from \"omnichannel-design-system\";\n\nimport { LooseObject } from \"services/types\";\nimport { useCallback } from \"react\";\nimport { useCashLoanContext } from \"flows/CashLoan/services/cashLoanContext\";\nimport { useFormatMessage } from \"services/formatMessageHook\";\n\ntype FormatMessage = (key: string, values?: LooseObject | undefined) => LocalizedString;\n\nfunction useComputeTranslationKey() {\n const { currentPage } = useCashLoanContext();\n return {\n computeTranslationKey: useCallback((keys: string[] | string) => {\n return [\"dbn.CF\", currentPage, ...(typeof keys === \"string\" ? [keys] : keys)].join(\".\")\n }, [currentPage])\n }\n}\n\nexport default function useCashLoanTranslation(prefix?: string) {\n const { formatMessage: originalFormatMessage } = useFormatMessage();\n const { computeTranslationKey } = useComputeTranslationKey();\n\n const formatMessage: FormatMessage = useCallback((key, values) => {\n const computedKey = prefix ? [prefix, key] : key;\n const receivedText = originalFormatMessage(computeTranslationKey(computedKey), values);\n return computeTranslationKey(computedKey) === receivedText ? unsafeLocalizedString(\"\") : receivedText;\n }, [originalFormatMessage, prefix, computeTranslationKey]);\n\n const computeKey = useCallback((key: string) => {\n return computeTranslationKey(prefix ? [prefix, key] : key)\n }, [prefix, computeTranslationKey])\n\n return {\n formatMessage,\n computeKey,\n }\n}","import { DocumentDetailsType, ReportCodes } from \"pages/DocumentDetails/services/domain\";\n\nimport { Category } from \"flows/services/domain\";\nimport { CategoryItem } from \"../pages/FinancialInformation/services/domain\";\nimport { GlobalEvents } from \"services/globalEvents\";\nimport { executeAxios } from \"services/axiosHook\";\nimport {download} from \"../../../pages/DocumentDetails/DocumentDetails\";\n\nexport function toBase64(file: File) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = () => resolve(reader.result);\n reader.onerror = reject;\n })\n}\n\nexport function downloadDocument(documentType: DocumentDetailsType, fileName: string) {\n executeAxios({\n params: {\n method: \"POST\",\n url: \"/packages/loans-ro/reports/create\",\n data: { reportCode: ReportCodes[documentType] }\n },\n onSuccess: (document?: { url: string, content: string }) => {\n if (document?.url) {\n const fileNameFormatted = fileName.toLowerCase()\n .replace(/ /g, \"_\")\n .replace(/-/g, \"\") + \".pdf\";\n download(document.url, fileNameFormatted, true);\n }\n }\n })\n}\n\nexport type FileMeta = {\n file: File;\n id: string;\n url?: string;\n}\n\ntype GetFileClientProps = {\n onSuccess: (file: FileMeta) => void;\n toLargeFileError: string;\n emptyFileError: string;\n notAcceptedTypeError: string;\n accept?: string;\n notAccepted?: string[];\n maxSizeMB?: number;\n isIOS?: boolean;\n}\n\nexport function uuidV4() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n const r = Math.random() * 16 | 0,\n v = c === \"x\" ? r : (r & (0x3 | 0x8));\n return v.toString(16);\n });\n}\n\nfunction postIOSMessage(message: string) {\n const customWindow: any = window;\n if (customWindow.webkit && customWindow.webkit.messageHandlers && customWindow.webkit.messageHandlers.iosconsole) {\n customWindow.webkit.messageHandlers.iosconsole.postMessage(message);\n }\n}\n\nexport function getFileClient(props: GetFileClientProps) {\n const {\n isIOS = false,\n accept = \"image/*,.pdf\",\n notAccepted = [\".heic\", \".heif\"],\n maxSizeMB = 10,\n onSuccess, toLargeFileError, emptyFileError, notAcceptedTypeError\n } = props;\n postIOSMessage(\"getFileClient\");\n const input = document.createElement(\"input\");\n input.setAttribute(\"type\", \"file\");\n input.setAttribute(\"accept\", accept);\n\n input.onerror = (event: any) => {\n postIOSMessage(\"Error on input element: \" + event);\n };\n\n input.onchange = (event: any) => {\n postIOSMessage(\"input.onchange activated\");\n\n if (!event || !event.target || !event.target.files) {\n postIOSMessage(\"Fail on primary condition: !event || !event.target || !event.target.files; \");\n return;\n }\n const file = event.target.files[0];\n const fileSize = file.size;\n const fileMb = fileSize / 1024 ** 2;\n\n if (fileSize === 0) {\n document.dispatchEvent(new CustomEvent(GlobalEvents.SHOW_SNACK_BAR, {\n detail: { message: emptyFileError }\n }));\n postIOSMessage(\"Fail on fileSize === 0: \" + fileSize);\n return;\n }\n\n if (fileMb > maxSizeMB) {\n document.dispatchEvent(new CustomEvent(GlobalEvents.SHOW_SNACK_BAR, {\n detail: { message: toLargeFileError }\n }));\n postIOSMessage(\"Fail on fileMb > maxSizeMB, \" + fileMb + \", \" + maxSizeMB);\n return;\n }\n\n const fileType = file.type + \"\";\n\n if (notAccepted.some(termination => fileType.endsWith(termination))) {\n document.dispatchEvent(new CustomEvent(GlobalEvents.SHOW_SNACK_BAR, {\n detail: { message: notAcceptedTypeError }\n }));\n return;\n }\n\n if (!fileType.startsWith(\"image/\") && \"application/pdf\" !== fileType) {\n document.dispatchEvent(new CustomEvent(GlobalEvents.SHOW_SNACK_BAR, {\n detail: { message: notAcceptedTypeError }\n }));\n postIOSMessage(\"Fail on fileType check: \" + fileType);\n return;\n }\n\n const fileTemporal: FileMeta = {\n id: uuidV4(),\n file\n }\n\n onSuccess(fileTemporal);\n }\n\n if (isIOS) {\n input.setAttribute(\"id\", \"getFileClient\");\n input.setAttribute(\"style\", \"display:none\");\n document.body.appendChild(input);\n }\n\n input.click();\n}\n\ntype GetCategoryItemProps = {\n financialData: {\n categoryId: Category;\n categoryItems: CategoryItem[];\n }[];\n category: Category;\n internalNames: string[];\n}\n\nexport function getCategoryItem(props: GetCategoryItemProps): CategoryItem[] {\n const { financialData, category, internalNames } = props;\n const financialSection = financialData.find(item => item.categoryId === category);\n\n if (!financialSection) {\n return [];\n }\n\n return financialSection.categoryItems.filter(item => internalNames.includes(item.internalName));\n}"],"names":["InstallmentTypes","CreditTypes","Banks","Category","INSTALMENT_TYPE_EQUALS","UNICREDIT_CONSUMER_FINANCING","UNICREDIT_SA","REVOLVING_FACILITIES_1","REVOLVING_FACILITIES_2","CategoryItemsInternalNames","props","_financialDropdownDat","_financialDropdownDat2","onSubmit","onIncomeDocuments","currentPage","useCashLoanContext","loading","financialDropdownData","ourOffer","handleOnSubmit","useInitialLoadOurOffer","Page","PRELIMINARY_OFFER","otherInstitutionId","financialData","find","item","categoryId","categoryItems","internalName","OTHER","id","toString","Object","keys","length","_jsx","Loader","Box","column","wrap","grow","shrink","children","OurOfferForm","financialIds","PAYMENT_EQUAL_TYPE_ID","getIdByInternalName","READONLY_FINANCIAL_INSTITUTIONS","REVOLVING_FACILITIES","initialValues","BannerDataWrapper","_ref","refinancingWarning","refinancingError","creditCount","amountRefinanced","maxAmount","formatMessage","formatRichTextMessage","useFormatMessage","formatNumber","useFormatNumber","bannerContent","bannerType","parseFloat","toFixed","some","createWarning","previousContent","list","row","shift","content","_jsxs","style","color","palette","dark","Space","units","filter","Banner","type","_Fragment","CreditTypeField","totalAmount","typeList","formatAmount","labelItem","value","ReadOnlyField","label","InsuranceSection","handleToggleActionGdpr","updateConsentGdpr","gdprAcord","setDisplayGdprAcord","disabled","refinancing","cpiDiscountPercentage","Heading","size","weight","RadioField","name","OUR_OFFER_FIELD_NAMES","INSURANCE","extended","handleChange","options","description","jsx","interestDiscountCpi","NavigationSwitch","title","customContent","Body","neutral500","overflowWrap","buttonLink","switchOn","toggleAction","gdprReportApiConfig","method","url","data","reportCode","ReportCodes","DocumentDetailsType","CL_OFFER_FORM_GDPR","OFFER_FORM_GDPR_CONSENT","GDPR_ACCORD","AMOUNT","TENOR","removePreviousValue","previous","undefined","withFormik","mapPropsToValues","validate","handleSubmit","values","bag","errors","touched","setFieldValue","isValid","setValues","useFormikContext","insurance","paymentType","refinancedCredits","ourOfferPageData","offerType","isRefinancing","OfferType","WITH_REFINANCING","initialOffersResponse","formatFirstAvailableMessage","formatPercentage","error","calculateOffer","newOfferLoading","useCalculateOfferService","updateConsentTimestamp","useDocConsentTimestampApi","updateParamConsentTimestamp","useParamConsentTimestampApi","calculateOfferRequest","shouldCalculateNewOffer","useComputeOffer","customFormatMessage","getKeysToFormat","useCustomFormatMessage","setLoading","useState","displayGdprAccord","setDisplayGdprAccord","reportCreated","setReportCreated","showRefinancingDetails","setShowRefinancingDetails","setRefinancingWarning","showFloatingBar","setShowFloatingBar","gdprAccordHistory","setGdprAccordHistory","topRef","useRef","hideAfterRef","dontUpdateCalculate","outputParameters","productParameters","inputParameters","insuranceParameters","maximumMonthlyPaymentExceeded","productAllowsInsurance","insuranceTypeId","footerContent","show","topUpAmount","labelId","haveError","monthlyPayment","previousMonthlyPayment","interestRate","useCallback","accepted","handleSetFieldValue","consent","historyItems","consentType","onSuccess","onFail","updateConsentInsurance","paramConsentType","useEffect","executeAxios","params","onLoading","isInitialMount","current","waitingAndCalculatingIfNeeded","useMemo","_","formValues","computeOfferRequest","shouldCalculate","previousRefinancedCredits","response","invalidOffer","previousValues","synchronizeFormWithCalculatedOffer","useLayoutEffect","handleTouched","defaultError","hasErrorMessage","handleTab","tabName","OfferTypeRequest","notReplaceOffer","DocumentDetails","apiConfig","onClose","onConfirm","handleConfirmGdprAcord","isReadOptional","translationsKeys","concat","confirmationButtonText","downloadButtonText","CL_REFINANCING_INFORMATION","disabledFields","maxTopUpAmount","maxLoanAmount","components","COMPONENTS_NAME","accordInsuranceProcessData","component","setTimeout","PAYMENT_TYPE","PaymentTypeSection","showHeader","CREDIT_INFORMATION","HeadingDS","NumberFieldStepper","step","rightContent","assistiveText","minLoanAmount","amount","EMPTY_STRING","min","max","period","maxTenor","minTenor","MAX_AMOUNT","loanAmount","HIDE_FLOATING_FOOTER_AFTER_REF","ref","MAX_LOAN_AMOUNT","ADDITIONAL_AMOUNT","REFINANCED_AMOUNT","refinancedAmount","MONTHLY_RATE","InlineMessage","message","noIcon","INSTALLMENTS_THAT_YOU_PAY_NOW","INTEREST_RATE","DAE","dae","TOTAL_AMOUNT","SPACE_8","index","SPACE_4","handleErrors","Stack","text","offerWithRefinancing","offerWithoutRefinancing","Tabs","selectedTab","tabsData","RefinancingTabs","REFINANCING","WITHOUT_REFINANCING","setTab","existingCredits","RefinancingCarousel","selectedItems","forEach","credit","map","creditId","includes","remainingValue","onShowRefinancingDetails","itemList","setSelectedItems","newSelectedValues","COMPONENTS_PER_FLOW_TYPE","STANDARD","componentName","errorName","FINANCIAL_INSTITUTION","vAlignContent","hAlignContent","Button","translationKey","variant","action","FloatingFooter","showAfterRef","_ref2","width","padding","FooterLabelStyled","fluid","FooterValueStyled","error400","unsafeLocalizedString","PAYMENT_DAY","DropdownField","computeFinancialInformationOptionByCategory","category","DueDays","MONTHS","RefinancingCard","_initialOffersRespons","creditValue","openingDate","remainingTenor","loanType","creditType","checkedItems","indexList","isSelectable","formatter","defaultOffer","currentPosition","indexOf","itemPosition","keyDropDownItem","handleCheck","_initialOffersRespons2","isNonRevolvingFacility","financialInstitutionDisabled","financialInstitution","financialInstitutionOptions","sort","a","b","localeCompare","institution","computeStyleRefinancingSlide","isCompatible","Checkbox","onChange","Divider","searchable","valuesResetOnChange","key","when","number","suffix","FORMATTER_TYPES","CUSTOM_SUFFIX","moment","format","CarouselContainerStyled","styled","_templateObject","_taggedTemplateLiteral","other","selectedCard","setSelectedCard","carouselContainerRef","selectedItem","externalCreditsMessage","existingCredit","push","bold","RefinancingCarouselLoader","loaderContainerStyles","position","height","Carousel","centerPadding","centerMode","slides","itemWidth","window","screen","carouselStepValidation","setValue","maxSteps","zIndex","backgroundColor","white","opacity","SpinnerIcon","blue600","calculateOfferConfig","setError","err","OUR_OFFER_PAGE_DATA","ourInitialOfferCallConfig","saveOfferConfig","onSuccessCalculateOffer","setOurOfferPageData","computedOffer","_response$existingCre","creditResponse","creditRes","handleLoading","useLoadingPipeline","setFinancialDropdownData","updateOurOffer","setInitialOffers","ourOfferData","setOurOfferData","paymentDay","getOfferRequestDoneRef","flowType","selected","tenor","dueDayId","installmentTypeId","insuranceIncluded","computedData","String","onExistingOfferFromContext","installmentType","dueDay","categories","financialDataDropdownCallConfig","selectedRefinancedCredits","getSelectedCredits","selectedCredit","_values$ourOfferPageD","creditInContext","computeRefinancedCredits","_templateObject2","_values$previousRefin","newSelectedCreditIds","refinancingChanged","onNoCreditsSelected","_values$previousRefin2","isValidPeriod","parametersAreNotValid","isOtherParametersChanged","actualSelection","valuesLoosesObject","keyParameter","valueFinancialInstitution","validateOfferWithRefinancing","computedValues","computeAmount","_ref3","border","borderWidth","borderColor","red700","borderRadius","marginLeft","marginRight","items","categoryItem","formatFirstAvailableRichTextMessage","isFooter","result","intermediateKey","unshift","isHTML","RepaymentMethod","DIRECT_DEBIT_SINGLE_ACCOUNT","DIRECT_DEBIT_ALL_ACCOUNTS","CASH","acceptedRepaymentOptions","useFinancialApi","CashLoanPaymentConfigurationCategories","fetchData","accounts","usePaymentConfigurationApi","paymentConfiguration","updatePaymentConfiguration","setInitialValues","formData","setFormData","saveConfigureLoanDetails","useSaveConfigureLoanDetailsApi","repaymentOptions","setRepaymentOptions","getOptions","disbursementAccounts","currentAccounts","disbursementAccount","repaymentMethod","currentAccount","personalAmount","salaryAmount","repaymentMethods","PaymentConfigurationForm","directDebitSingleAccountId","valuesToSubmit","onBack","CASH_METHOD","SINGLE_ACCOUNT_METHOD","ContainerStyled","displayAutomaticData","setDisplayAutomaticData","getAmount","selectedAccount","availableAmount","replace","handleCloseAutomaticDebitDetails","isDraft","CL_PAYMENT_CONFIGURATION_AGREEMENT","className","onClick","handleAutomaticDebitDocument","NavigationElement","firstLine","secondLine","rightIcon","AngleRightIcon","leftIcon","FileIcon","saveConfigureLoanDetailsConfig","status","setStatus","Status","Todo","preContractsSign","preContractsSignLoading","useSignPrecontractsApi","fetchDataStatus","contentStatus","useApprovalStatusApi","updateStepRequest","Complete","InProgress","AnalyzingRequest","ToBeContacted","buttonKey","Rejected","RejectedOffer","align","SignatureComponent","otp","pin","PRECONTRACTUAL_DOCUMENTS_STATUS_POLLING","pinLabel","pinDescription","submitLabel","src","image","maxWidth","alt","apiConfigSignPrecontracts","apiConfigApprovalStatus","setContentStatus","axiosInstance","request","then","catch","checkSignAuthorizationCallConfig","checkSignStatus","checkSignAuthorization","useCheckSignAuthorization","updateCurrentPage","stepBack","setStepBack","CheckSignStatus","OK","RETRY","PinSignaturePolling","checkPinCall","stepBackCondition","loadingMessage","defaultPinComponent","Signature","handlePinComponentSubmit","LOAN_APPROVAL","currentStatus","setCurrentStatus","queryStatus","usePoolingService","financialDataLoading","ExternalCreditCategories","externalCredits","externalCreditsLoading","useSelectedExternalCreditsApi","saveExternalCredits","saveExternalCreditsLoading","useSaveSelectedExternalCreditsApi","setFormValues","ExternalCreditsForm","creditsData","updateValues","iban","contractNumber","creditItem","toUpperCase","ibanKey","contractNumberKey","substr","setFieldTouched","myErrors","myTouched","prevValues","usePrevious","validationError","setValidationError","ibansNumberValidity","setIbansNumberValidity","ibansBicValidity","setIbansBicValidity","revolving","setRevolving","ibanValidationInProgress","setIbanValidationInProgress","showRefinancingInfo","setShowRefinancingInfo","validationErrors","errorMessageKey","getFinancialInstitutionName","bankId","bankItem","validateIbanDebounce","validateIbanApi","validateBicCode","Bic","bicItem","toNumber","validateCreditByIban","needsDebounce","prevState","isBicValid","onValidateIbanSuccess","isValidIban","onValidateIbanError","onValidateIbanLoading","initialActionsDone","revolvingCredits","renderHeader","renderContent","orientation","TextFieldUppercase","TextField","isValidatedOnBlur","virtualKeyboardInputType","newValue","CheckboxPanel","checked","header","externalCreditsCallConfig","saveSelectedExternalCreditsConfig","finally","useAxios","process","REACT_APP_USE_MOCK","externalCreditsError","validateIbanApiConfig","promiseFunctions","CURRENT_PAGE_UPDATE","FINANCIAL_INFORMATION_UPDATE","OUR_OFFER_UPDATE","PAYMENT_CONFIGURATION_UPDATE","REPLACE_CONTEXT_AFTER_RESUME","INITIAL_OFFER_DATA_RESPONSE","UPDATE_PAGE_TO_EXISTING_BLOCKING_APPLICATIONS","CashLoanAction","initialContextState","state","initialCashLoanState","dispatch","constVoid","updateCurrentStep","CashLoanContext","React","CashLoanContextProvider","cashLoanState","initialState","useReducer","reducer","Provider","useContext","page","newStep","LOADING","PagesWithoutStep","updateFinancialInformation","financialInformation","setContext","newContext","initialOffer","updateCurrentPageToExistingBlockingApplications","activeApplications","rejectedApplication","docConsentTimestampConfig","paramConsentTimestampConfig","discardConsentTimestampConfig","useDiscardConsentTimestampApi","discardConsentTimestamp","REQUEST_DAR","sendDarOption","darCode","details","AGREEMENTS_SIGNATURE_POLLING","PRECONTRACTUAL_DOCUMENTS_SIGNATURE_POLLING","CANCEL_APPLICATION_FEEDBACK","AGREEMENTS","KYC_EXPIRED","applicationId","professionalStatus","sourceOfIncome","occupation","dependents","maritalStatus","ucfinExpose","birthNumber","expirationDate","otherIncomeTypes","_value$activeApplicat","EXISTING_BLOCKING_APPLICATIONS","useCashLoanTranslation","prefix","originalFormatMessage","computeTranslationKey","join","useComputeTranslationKey","computedKey","receivedText","computeKey","toBase64","file","Promise","resolve","reject","reader","FileReader","readAsDataURL","onload","onerror","uuidV4","c","r","Math","random","postIOSMessage","customWindow","webkit","messageHandlers","iosconsole","postMessage","getFileClient","isIOS","accept","notAccepted","maxSizeMB","toLargeFileError","emptyFileError","notAcceptedTypeError","input","document","createElement","setAttribute","event","onchange","target","files","fileSize","fileMb","dispatchEvent","CustomEvent","GlobalEvents","SHOW_SNACK_BAR","detail","fileType","termination","endsWith","startsWith","fileTemporal","body","appendChild","click","getCategoryItem","internalNames","financialSection"],"sourceRoot":""}