@wenn/onb
Version:
onb-core
378 lines (360 loc) • 10.2 kB
JavaScript
import { saveCamundaData } from './camundaData.actions'
import { saveCamunda } from './camunda.actions'
import { transformOffer } from './offer.actions'
import { change } from 'redux-form'
export function saveFakeData() {
return dispatch => {
const requestedamount = '16000'
const identity_validation = [
{
firstname: 'Enrique Segundo',
lastname: 'Rolon Pozo',
fiscal_id: '20358880577',
birthdate: '19910601',
gender: 'MASCULINO',
national_id: '35888057'
}
]
const scoring = {
id: '5c3cad09cff47e0001967600',
result: {
dictum: 'Aprobar',
reason: {
phase: '',
message: ''
}
}
}
const questions = {
query_id: '1543624-27127376507',
validation_questionnaire: {
questions: [
{
id: 12,
text: '¿En cuál de las siguientes empresas trabaja o trabajó?',
options: [
{ id: 0, text: 'Tarjetas Cuyanas SA' },
{ id: 1, text: 'Starbucks Coffee Argentina SRL' },
{ id: 2, text: 'Comision Nacional de Energia Atomica' },
{ id: 3, text: 'Anteofer SA' },
{ id: 4, text: 'Ninguna de las anteriores' }
]
},
{
id: 2,
text:
'¿En cuál de las siguientes entidades tiene o tuvo una Tarjeta de Crédito?',
options: [
{ id: 0, text: 'Bco Cordoba' },
{ id: 1, text: 'Icbc' },
{ id: 2, text: 'Bco Masventas SA' },
{ id: 3, text: 'Ninguna de las anteriores' }
]
},
{
id: 11,
text: '¿Conoce a alguna de estas personas?',
options: [
{ id: 0, text: 'Eberhardt Kurt Alberto' },
{ id: 1, text: 'Britez Victor Benito' },
{ id: 2, text: 'Neris Nicomedes' },
{ id: 3, text: 'Ninguna de las anteriores' }
]
},
{
id: 25,
text: '¿En qué calle vive o vivió?',
options: [
{ id: 0, text: '33 Lavalle' },
{ id: 1, text: 'Las Heras' },
{ id: 2, text: 'Mendoza' },
{ id: 3, text: 'Chacabuco' },
{ id: 4, text: 'Ninguno de los anteriores' }
]
}
]
},
time_per_question: 0
}
const offer_retrieval = {
id: '5c3c839b4cedfd00016a21e0',
risk_score_id: '5c3c839b4cedfd00016a21e0',
product_id: '5bfff20197290d990ed3e835',
product_name: 'POSTA 2',
product_and_version: '302V5',
min_amount: 3500,
max_amount: 30000,
offer_rate: 14.75,
offer_installments: [
{
max_amount: 14312,
max_quota: 7879,
installment: 3,
rates: {
CFT: {
type: 'CFTNA',
value: 2252.62,
value_with_tax: 2725.67
},
TEA: {
type: 'TEA',
value: 421.23,
value_with_tax: 509.69
},
TPD: {
type: 'TPD',
value: 0.727,
value_with_tax: 0.88
},
TNA: {
type: 'TNA',
value: 177,
value_with_tax: 214.17
},
TEM: {
type: 'TEM',
value: 14.75,
value_with_tax: 17.85
}
},
interest: 9327,
commission_amount: 2862.4
},
{
max_amount: 23056,
max_quota: 7879,
installment: 6,
rates: {
CFT: {
type: 'CFTNA',
value: 1413.73,
value_with_tax: 1710.61
},
TEA: {
type: 'TEA',
value: 421.23,
value_with_tax: 509.69
},
TPD: {
type: 'TPD',
value: 0.727,
value_with_tax: 0.88
},
TNA: {
type: 'TNA',
value: 177,
value_with_tax: 214.17
},
TEM: {
type: 'TEM',
value: 14.75,
value_with_tax: 17.85
}
},
interest: 24221,
commission_amount: 4611.2
},
{
max_amount: 28399,
max_quota: 7879,
installment: 9,
rates: {
CFT: {
type: 'CFTNA',
value: 1182.74,
value_with_tax: 1431.12
},
TEA: {
type: 'TEA',
value: 421.23,
value_with_tax: 509.69
},
TPD: {
type: 'TPD',
value: 0.727,
value_with_tax: 0.88
},
TNA: {
type: 'TNA',
value: 177,
value_with_tax: 214.17
},
TEM: {
type: 'TEM',
value: 14.75,
value_with_tax: 17.85
}
},
interest: 42517,
commission_amount: 5679.8
},
{
max_amount: 30000,
max_quota: 7465,
installment: 12,
rates: {
CFT: {
type: 'CFTNA',
value: 1077.74,
value_with_tax: 1304.07
},
TEA: {
type: 'TEA',
value: 421.23,
value_with_tax: 509.69
},
TPD: {
type: 'TPD',
value: 0.727,
value_with_tax: 0.88
},
TNA: {
type: 'TNA',
value: 177,
value_with_tax: 214.17
},
TEM: {
type: 'TEM',
value: 14.75,
value_with_tax: 17.85
}
},
interest: 59586,
commission_amount: 6000
},
{
max_amount: 30000,
max_quota: 7023,
installment: 15,
rates: {
CFT: {
type: 'CFTNA',
value: 1020.9,
value_with_tax: 1235.29
},
TEA: {
type: 'TEA',
value: 421.23,
value_with_tax: 509.69
},
TPD: {
type: 'TPD',
value: 0.727,
value_with_tax: 0.88
},
TNA: {
type: 'TNA',
value: 177,
value_with_tax: 214.17
},
TEM: {
type: 'TEM',
value: 14.75,
value_with_tax: 17.85
}
},
interest: 75346,
commission_amount: 6000
}
],
commission: 20,
min_period: 3,
max_period: 15,
quotas: [3, 6, 9, 12, 15],
max_quota: 7879
}
dispatch(saveCamunda({ requestedamount }))
dispatch(saveCamundaData({ identity_validation }))
dispatch(saveCamunda({ offerid: scoring.id }))
dispatch(saveCamundaData({ scoring }))
dispatch(saveCamundaData({ validation_questions_retrieval: questions }))
dispatch(change('Product', 'amount', offer_retrieval.max_amount))
dispatch(transformOffer('offer_retrieval', offer_retrieval))
}
}
const dataLanding = {
amount: 40000
}
const dataStepOne = {
email: 'pablohernanaraujo@gmail.com',
dni: '34924746',
area: '11',
phone: '42424242',
termsyconditions: true
}
const dataAfip = {
afip: '34924746',
username: 'Nasif Mussare, Josefina Victoria'
}
const dataStepTwo = {
SMS: '4242',
bank: {
value: '017',
label: 'Banco Frances'
},
workStatus: 'relacion-dependencia'
}
const dataProducts = {
amount: '40000',
product: 'a12'
}
const dataPersonalInfo = {
cbu: '0170301440000042694612',
street: 'Siempre Viva',
number: '123',
floor: '',
apartment: '',
postalCode: '1234',
city: 'Springfield',
expirationDates: 'Primera semana',
province: 'Buenos Aires',
alternativePhoneCategory: {
label: 'Fijo',
value: 'landline'
},
alternativePhoneNumber: '43434343'
}
export function getFakeData() {
return dispatch => {
dispatch(change('landing', 'amount', dataLanding.amount))
dispatch(change('InitialInfo', 'email', dataStepOne.email))
dispatch(change('InitialInfo', 'national_id', dataStepOne.dni))
dispatch(change('InitialInfo', 'validationcellcode', dataStepOne.area))
dispatch(change('InitialInfo', 'validationcellphone', dataStepOne.phone))
dispatch(change('afip', 'afip', dataAfip.afip))
dispatch(change('afip', 'username', dataAfip.username))
dispatch(change('BasicInfo', 'validationcode', dataStepTwo.SMS))
dispatch(change('BasicInfo', 'bank', dataStepTwo.bank))
dispatch(change('BasicInfo', 'employmentstatus', dataStepTwo.workStatus))
dispatch(change('Product', 'product', dataProducts.product))
dispatch(change('personalInfo', 'cbu_code', dataPersonalInfo.cbu))
dispatch(
change(
'personalInfo',
'firstexpirationdate',
dataPersonalInfo.expirationDates
)
)
dispatch(change('personalInfo', 'streetname', dataPersonalInfo.street))
dispatch(change('personalInfo', 'streetnumber', dataPersonalInfo.number))
dispatch(change('personalInfo', 'floor', dataPersonalInfo.floor))
dispatch(change('personalInfo', 'department', dataPersonalInfo.apartment))
dispatch(change('personalInfo', 'postalcode', dataPersonalInfo.postalCode))
dispatch(change('personalInfo', 'province', dataPersonalInfo.province))
dispatch(change('personalInfo', 'city', dataPersonalInfo.city))
dispatch(
change(
'personalInfo',
'alternativePhoneCategory',
dataPersonalInfo.alternativePhoneCategory
)
)
dispatch(
change(
'personalInfo',
'alternativePhoneNumber',
dataPersonalInfo.alternativePhoneNumber
)
)
}
}