fix load-kp

This commit is contained in:
vchikalkin 2023-02-13 19:05:18 +03:00
parent 70e4dbf408
commit 7e17f67ef8
2 changed files with 13 additions and 6 deletions

View File

@ -73,6 +73,7 @@ export default function loadKpReactions({ store, trpcClient }: ReactionsContext)
content: `Ошибка во время загрузки КП ${quoteName}`,
key,
});
$calculation.element('selectQuote').resetValue();
})
.finally(() => {
$process.delete('LoadKP');

View File

@ -10,6 +10,7 @@ import { GetQuoteDataInputSchema, GetQuoteDataOutputSchema } from '@/process/loa
import getPaymentsDataFromKP from '@/process/payments/get-kp-data';
import getPriceDataFromKP from '@/process/price/get-kp-data';
import getSupplierAgentsDataFromKP from '@/process/supplier-agent/get-kp-values';
import { shake } from 'radash';
const DEFAULT_OSAGO_ROW = defaultInsuranceValues.find((x) => x.key === 'osago');
const DEFAULT_KASKO_ROW = defaultInsuranceValues.find((x) => x.key === 'kasko');
@ -27,15 +28,20 @@ const quoteRouter = t.router({
const { values: leasingObjectValues } = await getLeasingObjectDataFromKP(input);
const { fingap, insurance: fingapInsurance } = await getFingapDataFromKP(input);
// TODO: remove this temp fix
const quoteValues = shake({
...configuratorValues,
...supplierAgentsValues,
...paymentsValues,
...priceValues,
...bonusValues,
...leasingObjectValues,
});
return {
values: {
...defaultValues,
...configuratorValues,
...supplierAgentsValues,
...paymentsValues,
...priceValues,
...bonusValues,
...leasingObjectValues,
...quoteValues,
},
payments,
insurance: {