From f275cebc402be7471e549187f48641753f0ffd25 Mon Sep 17 00:00:00 2001 From: Chika Date: Fri, 18 Jun 2021 15:02:03 +0300 Subject: [PATCH] lesse subject type --- .../ELT/Content/Kasko/lib/composeRequest.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/client/Components/Calculation/ELT/Content/Kasko/lib/composeRequest.ts b/src/client/Components/Calculation/ELT/Content/Kasko/lib/composeRequest.ts index 5cabef9..d7e1969 100644 --- a/src/client/Components/Calculation/ELT/Content/Kasko/lib/composeRequest.ts +++ b/src/client/Components/Calculation/ELT/Content/Kasko/lib/composeRequest.ts @@ -34,6 +34,11 @@ const mapCategory = { 100000004: 'E1', }; +const mapInfuranceToLesseSubjectType = { + 100000000: '1', + 100000001: '2', +}; + const getSpecified = value => !isNull(value); export default function (this: ICalculationStore) { @@ -111,6 +116,13 @@ export default function (this: ICalculationStore) { const INN = `${this.getValue('INNForCalc')}`; + const infuranceOPF = this.getValue('infuranceOPF'); + const lesseSubjectType = get( + mapInfuranceToLesseSubjectType, + infuranceOPF, + '0', + ); + return { preparams: { kladr, @@ -172,7 +184,7 @@ export default function (this: ICalculationStore) { SubjectTypeSpecified: true, }, Lessee: { - SubjectType: 1, + SubjectType: lesseSubjectType, SubjectTypeSpecified: true, INN, },