import getUrls from '@/config/urls'; import { rest } from 'msw'; const _ = require('radash'); const users = { akalinina: { displayName: 'Анна Калинина', username: 'akalinina', department: 'Управление бизнес процессов, технологий и продуктов', position: 'Бизнес-аналитик', mail: 'akalinina@evoleasing.ru', domain: 'EVOLEASING', domainName: 'EVOLEASING\\akalinina', }, // vchikalkin: { // username: 'vchikalkin', // displayName: 'Влад Чикалкин', // mail: 'vchikalkin@evoleasing.ru', // domain: 'EVOLEASING', // department: 'IT', // position: 'Старший разработчик', // domainName: 'EVOLEASING\\vchikalkin', // }, }; const { URL_GET_USER, URL_CORE_FINGAP, URL_1C_TRANSTAX, URL_ELT_OSAGO, URL_ELT_KASKO } = getUrls(); export const handlers = [ rest.get(URL_GET_USER, (req, res, ctx) => res(ctx.json(users.akalinina))), rest.post(URL_CORE_FINGAP, (req, res, ctx) => res( ctx.json({ sum: _.random(100000, 200000), premium: _.random(1000, 10000), }) ) ), rest.post(URL_1C_TRANSTAX, (req, res, ctx) => res( ctx.json({ Error: null, Tax: _.random(100000, 200000), }) ) ), rest.post(URL_ELT_OSAGO, async (req, res, ctx) => res( ctx.json({ numCalc: _.random(1000000, 3000000), skCalcId: _.random(50000000, 60000000).toString(), premiumSum: _.random(10000, 20000), message: 'OSAGO Message', }) ) ), rest.post(URL_ELT_KASKO, async (req, res, ctx) => res( ctx.json({ requestId: _.random(3000000, 4000000).toString(), skCalcId: _.random(50000000, 60000000).toString(), message: 'KASKO Message', premiumSum: _.random(100000, 200000), kaskoSum: _.random(100000, 200000), paymentPeriods: [ { num: 1, kaskoSum: _.random(100000, 200000), }, ], totalFranchise: _.random(20000, 40000), }) ) ), // rest.post(URL_CRM_GRAPHQL, (req, res, ctx) => { // return res(ctx.status(503)); // }), ];