sysone-api-mapper 1.0.171 → 1.0.173
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/axiosInstance.d.ts +3 -3
- package/dist/axiosInstance.js +10 -10
- package/dist/index.d.ts +8 -8
- package/dist/index.js +20 -20
- package/dist/services.d.ts +2 -2
- package/dist/services.js +100 -100
- package/dist/servicesData.d.ts +143 -143
- package/dist/servicesData.js +999 -999
- package/dist/src/adapters/billingAdapter.d.ts +6 -6
- package/dist/src/adapters/billingAdapter.js +11 -11
- package/dist/src/adapters/claimsAdapter.d.ts +3 -3
- package/dist/src/adapters/claimsAdapter.js +8 -8
- package/dist/src/adapters/collectionAdapter.d.ts +6 -6
- package/dist/src/adapters/collectionAdapter.js +11 -11
- package/dist/src/adapters/createApiAdapter.d.ts +57 -55
- package/dist/src/adapters/createApiAdapter.js +20 -20
- package/dist/src/adapters/financeAdapter.d.ts +6 -6
- package/dist/src/adapters/financeAdapter.js +11 -11
- package/dist/src/adapters/locationAdapter.d.ts +6 -6
- package/dist/src/adapters/locationAdapter.js +11 -11
- package/dist/src/adapters/partyAdapter.d.ts +17 -15
- package/dist/src/adapters/partyAdapter.js +22 -20
- package/dist/src/adapters/policyAdapter.d.ts +11 -11
- package/dist/src/adapters/policyAdapter.js +16 -16
- package/dist/src/components/notificationToast.js +35 -35
- package/dist/src/contexts/actionsContext.d.ts +6 -6
- package/dist/src/contexts/actionsContext.js +78 -78
- package/dist/src/contexts/apiContext.d.ts +3 -3
- package/dist/src/contexts/apiContext.js +12 -12
- package/dist/src/contexts/translationContext.d.ts +6 -6
- package/dist/src/contexts/translationContext.js +54 -54
- package/dist/src/mapper/Mapper.d.ts +2 -2
- package/dist/src/mapper/Mapper.js +115 -115
- package/dist/src/mapper/endpointsConfig.d.ts +2918 -2884
- package/dist/src/mapper/endpointsConfig.js +1034 -1016
- package/dist/src/mapper/helpers/mappingHelpers.d.ts +3 -3
- package/dist/src/mapper/helpers/mappingHelpers.js +30 -30
- package/dist/src/mapper/modules/billing/index.d.ts +20 -20
- package/dist/src/mapper/modules/billing/index.js +136 -136
- package/dist/src/mapper/modules/claim/index.d.ts +3 -3
- package/dist/src/mapper/modules/claim/index.js +19 -19
- package/dist/src/mapper/modules/general/index.d.ts +4 -4
- package/dist/src/mapper/modules/general/index.js +11 -11
- package/dist/src/mapper/modules/party/index.d.ts +29 -29
- package/dist/src/mapper/modules/party/index.js +131 -131
- package/dist/src/mapper/modules/policy/index.d.ts +366 -366
- package/dist/src/mapper/modules/policy/index.js +592 -592
- package/dist/src/mapper/modules/quotation/index.d.ts +297 -297
- package/dist/src/mapper/modules/quotation/index.js +494 -494
- package/dist/src/mapper/modules/request/index.d.ts +42 -42
- package/dist/src/mapper/modules/request/index.js +65 -65
- package/dist/src/public/index.d.ts +3 -3
- package/dist/src/public/index.js +7 -7
- package/dist/src/server.d.ts +1 -1
- package/dist/src/server.js +18 -18
- package/package.json +1 -1
|
@@ -1,494 +1,494 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getPaymentFrecuencies = exports.getProductParameters = exports.getProductsBySubsections = exports.getActivityList = exports.quotationVariablePlanCreationMapped = exports.quotationStandardPlanCreationMapped = exports.getQuotations_Request = exports.getQuotationByCode_Request = exports.getQuotationByCode = exports.getQuotationDetail = exports.getQuotationsList = void 0;
|
|
7
|
-
const mappingHelpers_1 = require("../../helpers/mappingHelpers");
|
|
8
|
-
const dayjs_1 = __importDefault(require("dayjs"));
|
|
9
|
-
const normalizeDateToYYYYMMDD = (date) => {
|
|
10
|
-
if (!date)
|
|
11
|
-
return null;
|
|
12
|
-
const formats = ['DD/MM/YYYY', 'YYYY/MM/DD'];
|
|
13
|
-
const parsed = (0, dayjs_1.default)(date, formats, true);
|
|
14
|
-
return parsed.isValid()
|
|
15
|
-
? parsed.format('YYYY/MM/DD')
|
|
16
|
-
: null;
|
|
17
|
-
};
|
|
18
|
-
const getQuotationsList = async (response) => {
|
|
19
|
-
const quotations = Array.isArray(response === null || response === void 0 ? void 0 : response.quotations)
|
|
20
|
-
? response.quotations.map(q => {
|
|
21
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
22
|
-
return ({
|
|
23
|
-
code: q.code || null,
|
|
24
|
-
email: q.email || null,
|
|
25
|
-
creationDate: normalizeDateToYYYYMMDD(q.creationDate),
|
|
26
|
-
expirationDate: normalizeDateToYYYYMMDD(q.expirationDate),
|
|
27
|
-
number: q.number || null,
|
|
28
|
-
paymentFrequency: {
|
|
29
|
-
name: ((_a = q.paymentFrequency) === null || _a === void 0 ? void 0 : _a.name) || null,
|
|
30
|
-
code: ((_b = q.paymentFrequency) === null || _b === void 0 ? void 0 : _b.code) || null,
|
|
31
|
-
},
|
|
32
|
-
product: {
|
|
33
|
-
code: ((_d = (_c = q.product) === null || _c === void 0 ? void 0 : _c.code) === null || _d === void 0 ? void 0 : _d.toString()) || null,
|
|
34
|
-
name: ((_e = q.product) === null || _e === void 0 ? void 0 : _e.name) || null,
|
|
35
|
-
subsection: {
|
|
36
|
-
code: ((_g = (_f = q.product) === null || _f === void 0 ? void 0 : _f.subsection) === null || _g === void 0 ? void 0 : _g.code) || null,
|
|
37
|
-
name: ((_j = (_h = q.product) === null || _h === void 0 ? void 0 : _h.subsection) === null || _j === void 0 ? void 0 : _j.name) || null,
|
|
38
|
-
section: {
|
|
39
|
-
code: ((_m = (_l = (_k = q.product) === null || _k === void 0 ? void 0 : _k.subsection) === null || _l === void 0 ? void 0 : _l.section) === null || _m === void 0 ? void 0 : _m.code) || null,
|
|
40
|
-
name: ((_q = (_p = (_o = q.product) === null || _o === void 0 ? void 0 : _o.subsection) === null || _p === void 0 ? void 0 : _p.section) === null || _q === void 0 ? void 0 : _q.name) || null,
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
version: ((_r = q.product) === null || _r === void 0 ? void 0 : _r.version) || 0,
|
|
44
|
-
},
|
|
45
|
-
status: {
|
|
46
|
-
code: ((_s = q.status) === null || _s === void 0 ? void 0 : _s.code) || null,
|
|
47
|
-
name: ((_t = q.status) === null || _t === void 0 ? void 0 : _t.name) || null,
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
})
|
|
51
|
-
: [];
|
|
52
|
-
const total = (response === null || response === void 0 ? void 0 : response.total) ? response.total : 0;
|
|
53
|
-
return {
|
|
54
|
-
quotations,
|
|
55
|
-
total,
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
exports.getQuotationsList = getQuotationsList;
|
|
59
|
-
const getQuotationDetail = async (res) => {
|
|
60
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
61
|
-
const quotation = {
|
|
62
|
-
areaCode: (res === null || res === void 0 ? void 0 : res.areaCode) || null,
|
|
63
|
-
code: (res === null || res === void 0 ? void 0 : res.code) || null,
|
|
64
|
-
commercialStructure: {
|
|
65
|
-
data: {
|
|
66
|
-
code: null,
|
|
67
|
-
description: null,
|
|
68
|
-
name: null,
|
|
69
|
-
status: {
|
|
70
|
-
code: null,
|
|
71
|
-
name: null
|
|
72
|
-
},
|
|
73
|
-
version: 0
|
|
74
|
-
},
|
|
75
|
-
intermediaries: {
|
|
76
|
-
values: []
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
creationDate: (res === null || res === void 0 ? void 0 : res.creationDate) || null,
|
|
80
|
-
email: (res === null || res === void 0 ? void 0 : res.email) || null,
|
|
81
|
-
intermediary: {
|
|
82
|
-
code: ((_a = res === null || res === void 0 ? void 0 : res.intermediary) === null || _a === void 0 ? void 0 : _a.code) || null,
|
|
83
|
-
group: {
|
|
84
|
-
code: null,
|
|
85
|
-
name: null
|
|
86
|
-
},
|
|
87
|
-
licence: ((_b = res === null || res === void 0 ? void 0 : res.intermediary) === null || _b === void 0 ? void 0 : _b.licence) || null,
|
|
88
|
-
name: ((_c = res === null || res === void 0 ? void 0 : res.intermediary) === null || _c === void 0 ? void 0 : _c.name) || null,
|
|
89
|
-
roles: [
|
|
90
|
-
{
|
|
91
|
-
code: null,
|
|
92
|
-
name: null
|
|
93
|
-
}
|
|
94
|
-
],
|
|
95
|
-
status: {
|
|
96
|
-
code: null,
|
|
97
|
-
name: null
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
number: (res === null || res === void 0 ? void 0 : res.number) || null,
|
|
101
|
-
paymentFrequency: {
|
|
102
|
-
code: ((_d = res === null || res === void 0 ? void 0 : res.paymentFrequency) === null || _d === void 0 ? void 0 : _d.code) || null,
|
|
103
|
-
months: ((_e = res === null || res === void 0 ? void 0 : res.paymentFrequency) === null || _e === void 0 ? void 0 : _e.months) || null,
|
|
104
|
-
name: ((_f = res === null || res === void 0 ? void 0 : res.paymentFrequency) === null || _f === void 0 ? void 0 : _f.name) || null
|
|
105
|
-
},
|
|
106
|
-
phone: (res === null || res === void 0 ? void 0 : res.phone) || null,
|
|
107
|
-
product: {
|
|
108
|
-
code: ((_g = res === null || res === void 0 ? void 0 : res.product) === null || _g === void 0 ? void 0 : _g.code) || null,
|
|
109
|
-
currency: {
|
|
110
|
-
code: null,
|
|
111
|
-
mnemonic: null,
|
|
112
|
-
name: null,
|
|
113
|
-
symbol: null
|
|
114
|
-
},
|
|
115
|
-
name: ((_h = res === null || res === void 0 ? void 0 : res.product) === null || _h === void 0 ? void 0 : _h.name) || null,
|
|
116
|
-
status: {
|
|
117
|
-
code: null,
|
|
118
|
-
name: null
|
|
119
|
-
},
|
|
120
|
-
subsection: {
|
|
121
|
-
code: ((_k = (_j = res === null || res === void 0 ? void 0 : res.product) === null || _j === void 0 ? void 0 : _j.subsection) === null || _k === void 0 ? void 0 : _k.code) || null,
|
|
122
|
-
name: ((_m = (_l = res === null || res === void 0 ? void 0 : res.product) === null || _l === void 0 ? void 0 : _l.subsection) === null || _m === void 0 ? void 0 : _m.name) || null,
|
|
123
|
-
section: {
|
|
124
|
-
category: null,
|
|
125
|
-
code: ((_q = (_p = (_o = res === null || res === void 0 ? void 0 : res.product) === null || _o === void 0 ? void 0 : _o.subsection) === null || _p === void 0 ? void 0 : _p.section) === null || _q === void 0 ? void 0 : _q.code) || null,
|
|
126
|
-
name: ((_t = (_s = (_r = res === null || res === void 0 ? void 0 : res.product) === null || _r === void 0 ? void 0 : _r.subsection) === null || _s === void 0 ? void 0 : _s.section) === null || _t === void 0 ? void 0 : _t.name) || null,
|
|
127
|
-
type: null
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
version: ((_u = res === null || res === void 0 ? void 0 : res.product) === null || _u === void 0 ? void 0 : _u.version) || 0
|
|
131
|
-
},
|
|
132
|
-
productSegment: null,
|
|
133
|
-
status: {
|
|
134
|
-
code: ((_v = res === null || res === void 0 ? void 0 : res.status) === null || _v === void 0 ? void 0 : _v.code) || null,
|
|
135
|
-
name: ((_w = res === null || res === void 0 ? void 0 : res.status) === null || _w === void 0 ? void 0 : _w.name) || null
|
|
136
|
-
},
|
|
137
|
-
validity: {
|
|
138
|
-
code: null,
|
|
139
|
-
months: 0,
|
|
140
|
-
name: null
|
|
141
|
-
},
|
|
142
|
-
values: {
|
|
143
|
-
commercialAgreement: {
|
|
144
|
-
code: null,
|
|
145
|
-
intermediaries: []
|
|
146
|
-
},
|
|
147
|
-
expenses: [],
|
|
148
|
-
groupedEconomicValues: ((_y = (_x = res === null || res === void 0 ? void 0 : res.values) === null || _x === void 0 ? void 0 : _x.groupedEconomicValues) === null || _y === void 0 ? void 0 : _y.map((e) => {
|
|
149
|
-
var _a, _b;
|
|
150
|
-
return ({
|
|
151
|
-
type: {
|
|
152
|
-
code: ((_a = e === null || e === void 0 ? void 0 : e.type) === null || _a === void 0 ? void 0 : _a.code) || null,
|
|
153
|
-
name: ((_b = e === null || e === void 0 ? void 0 : e.type) === null || _b === void 0 ? void 0 : _b.name) || null
|
|
154
|
-
},
|
|
155
|
-
value: (e === null || e === void 0 ? void 0 : e.value) || null
|
|
156
|
-
});
|
|
157
|
-
})) || [],
|
|
158
|
-
risks: ((_0 = (_z = res === null || res === void 0 ? void 0 : res.values) === null || _z === void 0 ? void 0 : _z.risks) === null || _0 === void 0 ? void 0 : _0.map((risk) => {
|
|
159
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
160
|
-
return ({
|
|
161
|
-
adherents: [],
|
|
162
|
-
code: (risk === null || risk === void 0 ? void 0 : risk.code) || null,
|
|
163
|
-
coverages: ((_a = risk === null || risk === void 0 ? void 0 : risk.coverages) === null || _a === void 0 ? void 0 : _a.map((cv) => {
|
|
164
|
-
var _a;
|
|
165
|
-
return ({
|
|
166
|
-
code: (cv === null || cv === void 0 ? void 0 : cv.code) || null,
|
|
167
|
-
coverageValues: ((_a = cv === null || cv === void 0 ? void 0 : cv.coverageValues) === null || _a === void 0 ? void 0 : _a.map((c) => {
|
|
168
|
-
var _a, _b;
|
|
169
|
-
return ({
|
|
170
|
-
type: {
|
|
171
|
-
code: ((_a = c === null || c === void 0 ? void 0 : c.type) === null || _a === void 0 ? void 0 : _a.code) || null,
|
|
172
|
-
name: ((_b = c === null || c === void 0 ? void 0 : c.type) === null || _b === void 0 ? void 0 : _b.name) || null
|
|
173
|
-
},
|
|
174
|
-
value: (c === null || c === void 0 ? void 0 : c.value) || null
|
|
175
|
-
});
|
|
176
|
-
})) || [],
|
|
177
|
-
deductible: null,
|
|
178
|
-
economicValues: [
|
|
179
|
-
{
|
|
180
|
-
type: {
|
|
181
|
-
code: null,
|
|
182
|
-
name: null
|
|
183
|
-
},
|
|
184
|
-
value: 0
|
|
185
|
-
}
|
|
186
|
-
],
|
|
187
|
-
name: (cv === null || cv === void 0 ? void 0 : cv.description) || null,
|
|
188
|
-
description: (cv === null || cv === void 0 ? void 0 : cv.name) || null
|
|
189
|
-
});
|
|
190
|
-
})) || [],
|
|
191
|
-
data: {
|
|
192
|
-
city: {
|
|
193
|
-
code: ((_c = (_b = risk === null || risk === void 0 ? void 0 : risk.data) === null || _b === void 0 ? void 0 : _b.city) === null || _c === void 0 ? void 0 : _c.code) || null,
|
|
194
|
-
name: ((_e = (_d = risk === null || risk === void 0 ? void 0 : risk.data) === null || _d === void 0 ? void 0 : _d.city) === null || _e === void 0 ? void 0 : _e.name) || null,
|
|
195
|
-
province: ((_g = (_f = risk === null || risk === void 0 ? void 0 : risk.data) === null || _f === void 0 ? void 0 : _f.city) === null || _g === void 0 ? void 0 : _g.province) || null
|
|
196
|
-
},
|
|
197
|
-
gender: {
|
|
198
|
-
code: ((_j = (_h = risk === null || risk === void 0 ? void 0 : risk.data) === null || _h === void 0 ? void 0 : _h.gender) === null || _j === void 0 ? void 0 : _j.code) || null,
|
|
199
|
-
name: ((_l = (_k = risk === null || risk === void 0 ? void 0 : risk.data) === null || _k === void 0 ? void 0 : _k.gender) === null || _l === void 0 ? void 0 : _l.name) || null
|
|
200
|
-
},
|
|
201
|
-
birthdate: ((_m = risk === null || risk === void 0 ? void 0 : risk.data) === null || _m === void 0 ? void 0 : _m.birthdate) || null,
|
|
202
|
-
savings: ((_o = risk === null || risk === void 0 ? void 0 : risk.data) === null || _o === void 0 ? void 0 : _o.savings) || null,
|
|
203
|
-
identification: (_q = (_p = risk === null || risk === void 0 ? void 0 : risk.data) === null || _p === void 0 ? void 0 : _p.identification) !== null && _q !== void 0 ? _q : null,
|
|
204
|
-
firstName: (_s = (_r = risk === null || risk === void 0 ? void 0 : risk.data) === null || _r === void 0 ? void 0 : _r.firstName) !== null && _s !== void 0 ? _s : null,
|
|
205
|
-
lastName: (_u = (_t = risk === null || risk === void 0 ? void 0 : risk.data) === null || _t === void 0 ? void 0 : _t.lastName) !== null && _u !== void 0 ? _u : null,
|
|
206
|
-
spouse: (_w = (_v = risk === null || risk === void 0 ? void 0 : risk.data) === null || _v === void 0 ? void 0 : _v.spouse) !== null && _w !== void 0 ? _w : null,
|
|
207
|
-
values: ((_x = risk === null || risk === void 0 ? void 0 : risk.data) === null || _x === void 0 ? void 0 : _x.values) || null,
|
|
208
|
-
activity: ((_y = risk === null || risk === void 0 ? void 0 : risk.data) === null || _y === void 0 ? void 0 : _y.activity) || null,
|
|
209
|
-
bloodPressure: ((_z = risk === null || risk === void 0 ? void 0 : risk.data) === null || _z === void 0 ? void 0 : _z.bloodPressure) || null,
|
|
210
|
-
height: ((_0 = risk === null || risk === void 0 ? void 0 : risk.data) === null || _0 === void 0 ? void 0 : _0.height) || null,
|
|
211
|
-
weight: ((_1 = risk === null || risk === void 0 ? void 0 : risk.data) === null || _1 === void 0 ? void 0 : _1.weight) || null,
|
|
212
|
-
},
|
|
213
|
-
groupedEconomicValues: []
|
|
214
|
-
});
|
|
215
|
-
})) || []
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
return quotation;
|
|
219
|
-
};
|
|
220
|
-
exports.getQuotationDetail = getQuotationDetail;
|
|
221
|
-
const getQuotationByCode = async (response) => {
|
|
222
|
-
var _a, _b, _c;
|
|
223
|
-
const objectMapped = {
|
|
224
|
-
code: ((_a = response.quotationNumber) === null || _a === void 0 ? void 0 : _a.toString()) || null,
|
|
225
|
-
number: response.activityCode || 0,
|
|
226
|
-
creationDate: response.vigencyDateFrom || null,
|
|
227
|
-
expirationDate: response.vigencyDateTo || null,
|
|
228
|
-
validity: {
|
|
229
|
-
code: "N/A",
|
|
230
|
-
name: "N/A",
|
|
231
|
-
months: "N/A"
|
|
232
|
-
},
|
|
233
|
-
status: {
|
|
234
|
-
code: "N/A",
|
|
235
|
-
name: "N/A"
|
|
236
|
-
},
|
|
237
|
-
paymentFrequency: {
|
|
238
|
-
name: "N/A",
|
|
239
|
-
code: "N/A",
|
|
240
|
-
months: 0
|
|
241
|
-
},
|
|
242
|
-
email: "N/A",
|
|
243
|
-
phone: "N/A",
|
|
244
|
-
intermediary: {
|
|
245
|
-
code: "N/A",
|
|
246
|
-
name: "N/A",
|
|
247
|
-
roles: {},
|
|
248
|
-
},
|
|
249
|
-
commercialStructure: {
|
|
250
|
-
data: {
|
|
251
|
-
name: "N/A",
|
|
252
|
-
code: "N/A",
|
|
253
|
-
version: 0,
|
|
254
|
-
description: "N/A",
|
|
255
|
-
status: {
|
|
256
|
-
name: "N/A",
|
|
257
|
-
code: "N/A"
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
intermediaries: {
|
|
261
|
-
values: [
|
|
262
|
-
{
|
|
263
|
-
code: "N/A",
|
|
264
|
-
name: "N/A",
|
|
265
|
-
licence: "N/A",
|
|
266
|
-
role: {
|
|
267
|
-
name: "N/A",
|
|
268
|
-
code: "N/A"
|
|
269
|
-
},
|
|
270
|
-
status: {
|
|
271
|
-
name: "N/A",
|
|
272
|
-
code: "N/A"
|
|
273
|
-
},
|
|
274
|
-
group: {
|
|
275
|
-
name: "N/A",
|
|
276
|
-
code: "N/A"
|
|
277
|
-
},
|
|
278
|
-
}
|
|
279
|
-
]
|
|
280
|
-
}
|
|
281
|
-
},
|
|
282
|
-
product: {
|
|
283
|
-
name: "N/A",
|
|
284
|
-
code: ((_b = response === null || response === void 0 ? void 0 : response.productCode) === null || _b === void 0 ? void 0 : _b.toString()) || null,
|
|
285
|
-
version: 0,
|
|
286
|
-
subsection: {
|
|
287
|
-
name: "N/A",
|
|
288
|
-
code: "N/A",
|
|
289
|
-
section: {
|
|
290
|
-
name: "N/A",
|
|
291
|
-
code: ((_c = response === null || response === void 0 ? void 0 : response.sectionCode) === null || _c === void 0 ? void 0 : _c.toString()) || null,
|
|
292
|
-
type: {
|
|
293
|
-
name: "N/A",
|
|
294
|
-
code: "N/A"
|
|
295
|
-
},
|
|
296
|
-
category: {
|
|
297
|
-
name: "N/A",
|
|
298
|
-
code: "N/A"
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
},
|
|
302
|
-
status: {
|
|
303
|
-
code: "N/A",
|
|
304
|
-
name: "N/A"
|
|
305
|
-
},
|
|
306
|
-
currency: {
|
|
307
|
-
name: "N/A",
|
|
308
|
-
code: "N/A",
|
|
309
|
-
mnemonic: "N/A",
|
|
310
|
-
symbol: "N/A"
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
|
-
productSegment: {
|
|
314
|
-
coverages: [],
|
|
315
|
-
expenses: [],
|
|
316
|
-
name: "N/A",
|
|
317
|
-
code: "N/A",
|
|
318
|
-
version: 0,
|
|
319
|
-
description: "N/A"
|
|
320
|
-
},
|
|
321
|
-
values: {
|
|
322
|
-
risks: [
|
|
323
|
-
{
|
|
324
|
-
code: "N/A",
|
|
325
|
-
coverages: [
|
|
326
|
-
{
|
|
327
|
-
code: "N/A",
|
|
328
|
-
name: "N/A",
|
|
329
|
-
deductible: {
|
|
330
|
-
name: "N/A",
|
|
331
|
-
code: "N/A",
|
|
332
|
-
value: 0,
|
|
333
|
-
appliedValue: 0
|
|
334
|
-
},
|
|
335
|
-
economicValues: [
|
|
336
|
-
{
|
|
337
|
-
type: {
|
|
338
|
-
name: "N/A",
|
|
339
|
-
code: "N/A"
|
|
340
|
-
},
|
|
341
|
-
value: 0
|
|
342
|
-
}
|
|
343
|
-
],
|
|
344
|
-
coverageValues: [
|
|
345
|
-
{
|
|
346
|
-
type: {
|
|
347
|
-
name: "N/A",
|
|
348
|
-
code: "N/A"
|
|
349
|
-
},
|
|
350
|
-
value: 0
|
|
351
|
-
}
|
|
352
|
-
]
|
|
353
|
-
}
|
|
354
|
-
],
|
|
355
|
-
data: {},
|
|
356
|
-
adherents: [
|
|
357
|
-
{
|
|
358
|
-
code: "N/A",
|
|
359
|
-
coverages: [
|
|
360
|
-
{
|
|
361
|
-
code: "N/A",
|
|
362
|
-
name: "N/A",
|
|
363
|
-
deductible: {
|
|
364
|
-
name: "N/A",
|
|
365
|
-
code: "N/A",
|
|
366
|
-
value: 0,
|
|
367
|
-
appliedValue: 0
|
|
368
|
-
},
|
|
369
|
-
economicValues: [{
|
|
370
|
-
type: "N/A",
|
|
371
|
-
code: "N/A"
|
|
372
|
-
}],
|
|
373
|
-
coverageValues: [{
|
|
374
|
-
type: {
|
|
375
|
-
name: "N/A",
|
|
376
|
-
code: "N/A"
|
|
377
|
-
},
|
|
378
|
-
value: 0
|
|
379
|
-
}]
|
|
380
|
-
}
|
|
381
|
-
],
|
|
382
|
-
data: {}
|
|
383
|
-
}
|
|
384
|
-
]
|
|
385
|
-
}
|
|
386
|
-
],
|
|
387
|
-
expenses: [
|
|
388
|
-
{
|
|
389
|
-
type: {
|
|
390
|
-
name: "N/A",
|
|
391
|
-
code: "N/A"
|
|
392
|
-
},
|
|
393
|
-
value: 0
|
|
394
|
-
}
|
|
395
|
-
],
|
|
396
|
-
groupedEconomicValues: [
|
|
397
|
-
{
|
|
398
|
-
type: {
|
|
399
|
-
name: "N/A",
|
|
400
|
-
code: "N/A"
|
|
401
|
-
},
|
|
402
|
-
value: 0
|
|
403
|
-
}
|
|
404
|
-
],
|
|
405
|
-
commercialAgreement: {}
|
|
406
|
-
}
|
|
407
|
-
};
|
|
408
|
-
return objectMapped;
|
|
409
|
-
};
|
|
410
|
-
exports.getQuotationByCode = getQuotationByCode;
|
|
411
|
-
const getQuotationByCode_Request = (inputParams) => {
|
|
412
|
-
return {};
|
|
413
|
-
};
|
|
414
|
-
exports.getQuotationByCode_Request = getQuotationByCode_Request;
|
|
415
|
-
const getQuotations_Request = (inputParams) => {
|
|
416
|
-
return {
|
|
417
|
-
number: inputParams.quotationNumber || undefined,
|
|
418
|
-
from: inputParams.dateFrom || undefined,
|
|
419
|
-
to: inputParams.dateTo || undefined,
|
|
420
|
-
};
|
|
421
|
-
};
|
|
422
|
-
exports.getQuotations_Request = getQuotations_Request;
|
|
423
|
-
const quotationStandardPlanCreationMapped = (params) => {
|
|
424
|
-
if (!params)
|
|
425
|
-
return null;
|
|
426
|
-
return {
|
|
427
|
-
sectionCode: 17, // no recibe se asigna 17 por defecto
|
|
428
|
-
paymentTypeCode: (0, mappingHelpers_1.mapPaymentFrequency)(params.paymentFrequencyCode),
|
|
429
|
-
productCode: (0, mappingHelpers_1.mapProductCode)(params.productCode),
|
|
430
|
-
provinceCode: 1, // no recibe provincia, se asigna 1 por defecto
|
|
431
|
-
};
|
|
432
|
-
};
|
|
433
|
-
exports.quotationStandardPlanCreationMapped = quotationStandardPlanCreationMapped;
|
|
434
|
-
const quotationVariablePlanCreationMapped = (params) => {
|
|
435
|
-
var _a, _b, _c, _d;
|
|
436
|
-
if (!params)
|
|
437
|
-
return null;
|
|
438
|
-
return {
|
|
439
|
-
sectionCode: 17, // no recibe se asigna 17 por defecto
|
|
440
|
-
paymentTypeCode: (0, mappingHelpers_1.mapPaymentFrequency)(params.paymentFrequencyCode),
|
|
441
|
-
productCode: (0, mappingHelpers_1.mapProductCode)(params.productCode),
|
|
442
|
-
provinceCode: 1, // no recibe provincia, se asigna 1 por defecto
|
|
443
|
-
birthdate: (_a = params.risks[0]) === null || _a === void 0 ? void 0 : _a.birthDate,
|
|
444
|
-
insuredAmount: ((_d = (_c = (_b = params.risks[0]) === null || _b === void 0 ? void 0 : _b.coverages[0]) === null || _c === void 0 ? void 0 : _c.values.find(v => v.code === "INSURED_AMOUNT")) === null || _d === void 0 ? void 0 : _d.value) || 0,
|
|
445
|
-
};
|
|
446
|
-
};
|
|
447
|
-
exports.quotationVariablePlanCreationMapped = quotationVariablePlanCreationMapped;
|
|
448
|
-
const getActivityList = async (response) => {
|
|
449
|
-
const objectMapped = {
|
|
450
|
-
values: response.activities.map(a => ({
|
|
451
|
-
code: a.code,
|
|
452
|
-
name: a.name,
|
|
453
|
-
})),
|
|
454
|
-
};
|
|
455
|
-
return objectMapped;
|
|
456
|
-
};
|
|
457
|
-
exports.getActivityList = getActivityList;
|
|
458
|
-
const getProductsBySubsections = async (response) => {
|
|
459
|
-
const objectMapped = {
|
|
460
|
-
values: response.products.map(item => ({
|
|
461
|
-
name: item.name,
|
|
462
|
-
code: item.code,
|
|
463
|
-
version: item.version,
|
|
464
|
-
subsection: (item === null || item === void 0 ? void 0 : item.subsection) || null,
|
|
465
|
-
fieldExclusions: (item === null || item === void 0 ? void 0 : item.exclusions) || null,
|
|
466
|
-
fields: (item === null || item === void 0 ? void 0 : item.fieldValues) || (item === null || item === void 0 ? void 0 : item.fields) || null
|
|
467
|
-
})),
|
|
468
|
-
};
|
|
469
|
-
return objectMapped;
|
|
470
|
-
};
|
|
471
|
-
exports.getProductsBySubsections = getProductsBySubsections;
|
|
472
|
-
const getProductParameters = async (item) => {
|
|
473
|
-
const objectMapped = {
|
|
474
|
-
name: item.name,
|
|
475
|
-
code: item.code,
|
|
476
|
-
version: item.version,
|
|
477
|
-
subsection: (item === null || item === void 0 ? void 0 : item.subsection) || null,
|
|
478
|
-
fieldExclusions: (item === null || item === void 0 ? void 0 : item.exclusions) || null,
|
|
479
|
-
fields: (item === null || item === void 0 ? void 0 : item.fields) || null
|
|
480
|
-
};
|
|
481
|
-
return objectMapped;
|
|
482
|
-
};
|
|
483
|
-
exports.getProductParameters = getProductParameters;
|
|
484
|
-
const getPaymentFrecuencies = async (response) => {
|
|
485
|
-
const objectMapped = {
|
|
486
|
-
frequencies: response.frequencies.map(a => ({
|
|
487
|
-
name: a.name,
|
|
488
|
-
code: a.code,
|
|
489
|
-
months: a.months
|
|
490
|
-
})),
|
|
491
|
-
};
|
|
492
|
-
return objectMapped;
|
|
493
|
-
};
|
|
494
|
-
exports.getPaymentFrecuencies = getPaymentFrecuencies;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getPaymentFrecuencies = exports.getProductParameters = exports.getProductsBySubsections = exports.getActivityList = exports.quotationVariablePlanCreationMapped = exports.quotationStandardPlanCreationMapped = exports.getQuotations_Request = exports.getQuotationByCode_Request = exports.getQuotationByCode = exports.getQuotationDetail = exports.getQuotationsList = void 0;
|
|
7
|
+
const mappingHelpers_1 = require("../../helpers/mappingHelpers");
|
|
8
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
9
|
+
const normalizeDateToYYYYMMDD = (date) => {
|
|
10
|
+
if (!date)
|
|
11
|
+
return null;
|
|
12
|
+
const formats = ['DD/MM/YYYY', 'YYYY/MM/DD'];
|
|
13
|
+
const parsed = (0, dayjs_1.default)(date, formats, true);
|
|
14
|
+
return parsed.isValid()
|
|
15
|
+
? parsed.format('YYYY/MM/DD')
|
|
16
|
+
: null;
|
|
17
|
+
};
|
|
18
|
+
const getQuotationsList = async (response) => {
|
|
19
|
+
const quotations = Array.isArray(response === null || response === void 0 ? void 0 : response.quotations)
|
|
20
|
+
? response.quotations.map(q => {
|
|
21
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
22
|
+
return ({
|
|
23
|
+
code: q.code || null,
|
|
24
|
+
email: q.email || null,
|
|
25
|
+
creationDate: normalizeDateToYYYYMMDD(q.creationDate),
|
|
26
|
+
expirationDate: normalizeDateToYYYYMMDD(q.expirationDate),
|
|
27
|
+
number: q.number || null,
|
|
28
|
+
paymentFrequency: {
|
|
29
|
+
name: ((_a = q.paymentFrequency) === null || _a === void 0 ? void 0 : _a.name) || null,
|
|
30
|
+
code: ((_b = q.paymentFrequency) === null || _b === void 0 ? void 0 : _b.code) || null,
|
|
31
|
+
},
|
|
32
|
+
product: {
|
|
33
|
+
code: ((_d = (_c = q.product) === null || _c === void 0 ? void 0 : _c.code) === null || _d === void 0 ? void 0 : _d.toString()) || null,
|
|
34
|
+
name: ((_e = q.product) === null || _e === void 0 ? void 0 : _e.name) || null,
|
|
35
|
+
subsection: {
|
|
36
|
+
code: ((_g = (_f = q.product) === null || _f === void 0 ? void 0 : _f.subsection) === null || _g === void 0 ? void 0 : _g.code) || null,
|
|
37
|
+
name: ((_j = (_h = q.product) === null || _h === void 0 ? void 0 : _h.subsection) === null || _j === void 0 ? void 0 : _j.name) || null,
|
|
38
|
+
section: {
|
|
39
|
+
code: ((_m = (_l = (_k = q.product) === null || _k === void 0 ? void 0 : _k.subsection) === null || _l === void 0 ? void 0 : _l.section) === null || _m === void 0 ? void 0 : _m.code) || null,
|
|
40
|
+
name: ((_q = (_p = (_o = q.product) === null || _o === void 0 ? void 0 : _o.subsection) === null || _p === void 0 ? void 0 : _p.section) === null || _q === void 0 ? void 0 : _q.name) || null,
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
version: ((_r = q.product) === null || _r === void 0 ? void 0 : _r.version) || 0,
|
|
44
|
+
},
|
|
45
|
+
status: {
|
|
46
|
+
code: ((_s = q.status) === null || _s === void 0 ? void 0 : _s.code) || null,
|
|
47
|
+
name: ((_t = q.status) === null || _t === void 0 ? void 0 : _t.name) || null,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
})
|
|
51
|
+
: [];
|
|
52
|
+
const total = (response === null || response === void 0 ? void 0 : response.total) ? response.total : 0;
|
|
53
|
+
return {
|
|
54
|
+
quotations,
|
|
55
|
+
total,
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
exports.getQuotationsList = getQuotationsList;
|
|
59
|
+
const getQuotationDetail = async (res) => {
|
|
60
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
61
|
+
const quotation = {
|
|
62
|
+
areaCode: (res === null || res === void 0 ? void 0 : res.areaCode) || null,
|
|
63
|
+
code: (res === null || res === void 0 ? void 0 : res.code) || null,
|
|
64
|
+
commercialStructure: {
|
|
65
|
+
data: {
|
|
66
|
+
code: null,
|
|
67
|
+
description: null,
|
|
68
|
+
name: null,
|
|
69
|
+
status: {
|
|
70
|
+
code: null,
|
|
71
|
+
name: null
|
|
72
|
+
},
|
|
73
|
+
version: 0
|
|
74
|
+
},
|
|
75
|
+
intermediaries: {
|
|
76
|
+
values: []
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
creationDate: (res === null || res === void 0 ? void 0 : res.creationDate) || null,
|
|
80
|
+
email: (res === null || res === void 0 ? void 0 : res.email) || null,
|
|
81
|
+
intermediary: {
|
|
82
|
+
code: ((_a = res === null || res === void 0 ? void 0 : res.intermediary) === null || _a === void 0 ? void 0 : _a.code) || null,
|
|
83
|
+
group: {
|
|
84
|
+
code: null,
|
|
85
|
+
name: null
|
|
86
|
+
},
|
|
87
|
+
licence: ((_b = res === null || res === void 0 ? void 0 : res.intermediary) === null || _b === void 0 ? void 0 : _b.licence) || null,
|
|
88
|
+
name: ((_c = res === null || res === void 0 ? void 0 : res.intermediary) === null || _c === void 0 ? void 0 : _c.name) || null,
|
|
89
|
+
roles: [
|
|
90
|
+
{
|
|
91
|
+
code: null,
|
|
92
|
+
name: null
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
status: {
|
|
96
|
+
code: null,
|
|
97
|
+
name: null
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
number: (res === null || res === void 0 ? void 0 : res.number) || null,
|
|
101
|
+
paymentFrequency: {
|
|
102
|
+
code: ((_d = res === null || res === void 0 ? void 0 : res.paymentFrequency) === null || _d === void 0 ? void 0 : _d.code) || null,
|
|
103
|
+
months: ((_e = res === null || res === void 0 ? void 0 : res.paymentFrequency) === null || _e === void 0 ? void 0 : _e.months) || null,
|
|
104
|
+
name: ((_f = res === null || res === void 0 ? void 0 : res.paymentFrequency) === null || _f === void 0 ? void 0 : _f.name) || null
|
|
105
|
+
},
|
|
106
|
+
phone: (res === null || res === void 0 ? void 0 : res.phone) || null,
|
|
107
|
+
product: {
|
|
108
|
+
code: ((_g = res === null || res === void 0 ? void 0 : res.product) === null || _g === void 0 ? void 0 : _g.code) || null,
|
|
109
|
+
currency: {
|
|
110
|
+
code: null,
|
|
111
|
+
mnemonic: null,
|
|
112
|
+
name: null,
|
|
113
|
+
symbol: null
|
|
114
|
+
},
|
|
115
|
+
name: ((_h = res === null || res === void 0 ? void 0 : res.product) === null || _h === void 0 ? void 0 : _h.name) || null,
|
|
116
|
+
status: {
|
|
117
|
+
code: null,
|
|
118
|
+
name: null
|
|
119
|
+
},
|
|
120
|
+
subsection: {
|
|
121
|
+
code: ((_k = (_j = res === null || res === void 0 ? void 0 : res.product) === null || _j === void 0 ? void 0 : _j.subsection) === null || _k === void 0 ? void 0 : _k.code) || null,
|
|
122
|
+
name: ((_m = (_l = res === null || res === void 0 ? void 0 : res.product) === null || _l === void 0 ? void 0 : _l.subsection) === null || _m === void 0 ? void 0 : _m.name) || null,
|
|
123
|
+
section: {
|
|
124
|
+
category: null,
|
|
125
|
+
code: ((_q = (_p = (_o = res === null || res === void 0 ? void 0 : res.product) === null || _o === void 0 ? void 0 : _o.subsection) === null || _p === void 0 ? void 0 : _p.section) === null || _q === void 0 ? void 0 : _q.code) || null,
|
|
126
|
+
name: ((_t = (_s = (_r = res === null || res === void 0 ? void 0 : res.product) === null || _r === void 0 ? void 0 : _r.subsection) === null || _s === void 0 ? void 0 : _s.section) === null || _t === void 0 ? void 0 : _t.name) || null,
|
|
127
|
+
type: null
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
version: ((_u = res === null || res === void 0 ? void 0 : res.product) === null || _u === void 0 ? void 0 : _u.version) || 0
|
|
131
|
+
},
|
|
132
|
+
productSegment: null,
|
|
133
|
+
status: {
|
|
134
|
+
code: ((_v = res === null || res === void 0 ? void 0 : res.status) === null || _v === void 0 ? void 0 : _v.code) || null,
|
|
135
|
+
name: ((_w = res === null || res === void 0 ? void 0 : res.status) === null || _w === void 0 ? void 0 : _w.name) || null
|
|
136
|
+
},
|
|
137
|
+
validity: {
|
|
138
|
+
code: null,
|
|
139
|
+
months: 0,
|
|
140
|
+
name: null
|
|
141
|
+
},
|
|
142
|
+
values: {
|
|
143
|
+
commercialAgreement: {
|
|
144
|
+
code: null,
|
|
145
|
+
intermediaries: []
|
|
146
|
+
},
|
|
147
|
+
expenses: [],
|
|
148
|
+
groupedEconomicValues: ((_y = (_x = res === null || res === void 0 ? void 0 : res.values) === null || _x === void 0 ? void 0 : _x.groupedEconomicValues) === null || _y === void 0 ? void 0 : _y.map((e) => {
|
|
149
|
+
var _a, _b;
|
|
150
|
+
return ({
|
|
151
|
+
type: {
|
|
152
|
+
code: ((_a = e === null || e === void 0 ? void 0 : e.type) === null || _a === void 0 ? void 0 : _a.code) || null,
|
|
153
|
+
name: ((_b = e === null || e === void 0 ? void 0 : e.type) === null || _b === void 0 ? void 0 : _b.name) || null
|
|
154
|
+
},
|
|
155
|
+
value: (e === null || e === void 0 ? void 0 : e.value) || null
|
|
156
|
+
});
|
|
157
|
+
})) || [],
|
|
158
|
+
risks: ((_0 = (_z = res === null || res === void 0 ? void 0 : res.values) === null || _z === void 0 ? void 0 : _z.risks) === null || _0 === void 0 ? void 0 : _0.map((risk) => {
|
|
159
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
160
|
+
return ({
|
|
161
|
+
adherents: [],
|
|
162
|
+
code: (risk === null || risk === void 0 ? void 0 : risk.code) || null,
|
|
163
|
+
coverages: ((_a = risk === null || risk === void 0 ? void 0 : risk.coverages) === null || _a === void 0 ? void 0 : _a.map((cv) => {
|
|
164
|
+
var _a;
|
|
165
|
+
return ({
|
|
166
|
+
code: (cv === null || cv === void 0 ? void 0 : cv.code) || null,
|
|
167
|
+
coverageValues: ((_a = cv === null || cv === void 0 ? void 0 : cv.coverageValues) === null || _a === void 0 ? void 0 : _a.map((c) => {
|
|
168
|
+
var _a, _b;
|
|
169
|
+
return ({
|
|
170
|
+
type: {
|
|
171
|
+
code: ((_a = c === null || c === void 0 ? void 0 : c.type) === null || _a === void 0 ? void 0 : _a.code) || null,
|
|
172
|
+
name: ((_b = c === null || c === void 0 ? void 0 : c.type) === null || _b === void 0 ? void 0 : _b.name) || null
|
|
173
|
+
},
|
|
174
|
+
value: (c === null || c === void 0 ? void 0 : c.value) || null
|
|
175
|
+
});
|
|
176
|
+
})) || [],
|
|
177
|
+
deductible: null,
|
|
178
|
+
economicValues: [
|
|
179
|
+
{
|
|
180
|
+
type: {
|
|
181
|
+
code: null,
|
|
182
|
+
name: null
|
|
183
|
+
},
|
|
184
|
+
value: 0
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
name: (cv === null || cv === void 0 ? void 0 : cv.description) || null,
|
|
188
|
+
description: (cv === null || cv === void 0 ? void 0 : cv.name) || null
|
|
189
|
+
});
|
|
190
|
+
})) || [],
|
|
191
|
+
data: {
|
|
192
|
+
city: {
|
|
193
|
+
code: ((_c = (_b = risk === null || risk === void 0 ? void 0 : risk.data) === null || _b === void 0 ? void 0 : _b.city) === null || _c === void 0 ? void 0 : _c.code) || null,
|
|
194
|
+
name: ((_e = (_d = risk === null || risk === void 0 ? void 0 : risk.data) === null || _d === void 0 ? void 0 : _d.city) === null || _e === void 0 ? void 0 : _e.name) || null,
|
|
195
|
+
province: ((_g = (_f = risk === null || risk === void 0 ? void 0 : risk.data) === null || _f === void 0 ? void 0 : _f.city) === null || _g === void 0 ? void 0 : _g.province) || null
|
|
196
|
+
},
|
|
197
|
+
gender: {
|
|
198
|
+
code: ((_j = (_h = risk === null || risk === void 0 ? void 0 : risk.data) === null || _h === void 0 ? void 0 : _h.gender) === null || _j === void 0 ? void 0 : _j.code) || null,
|
|
199
|
+
name: ((_l = (_k = risk === null || risk === void 0 ? void 0 : risk.data) === null || _k === void 0 ? void 0 : _k.gender) === null || _l === void 0 ? void 0 : _l.name) || null
|
|
200
|
+
},
|
|
201
|
+
birthdate: ((_m = risk === null || risk === void 0 ? void 0 : risk.data) === null || _m === void 0 ? void 0 : _m.birthdate) || null,
|
|
202
|
+
savings: ((_o = risk === null || risk === void 0 ? void 0 : risk.data) === null || _o === void 0 ? void 0 : _o.savings) || null,
|
|
203
|
+
identification: (_q = (_p = risk === null || risk === void 0 ? void 0 : risk.data) === null || _p === void 0 ? void 0 : _p.identification) !== null && _q !== void 0 ? _q : null,
|
|
204
|
+
firstName: (_s = (_r = risk === null || risk === void 0 ? void 0 : risk.data) === null || _r === void 0 ? void 0 : _r.firstName) !== null && _s !== void 0 ? _s : null,
|
|
205
|
+
lastName: (_u = (_t = risk === null || risk === void 0 ? void 0 : risk.data) === null || _t === void 0 ? void 0 : _t.lastName) !== null && _u !== void 0 ? _u : null,
|
|
206
|
+
spouse: (_w = (_v = risk === null || risk === void 0 ? void 0 : risk.data) === null || _v === void 0 ? void 0 : _v.spouse) !== null && _w !== void 0 ? _w : null,
|
|
207
|
+
values: ((_x = risk === null || risk === void 0 ? void 0 : risk.data) === null || _x === void 0 ? void 0 : _x.values) || null,
|
|
208
|
+
activity: ((_y = risk === null || risk === void 0 ? void 0 : risk.data) === null || _y === void 0 ? void 0 : _y.activity) || null,
|
|
209
|
+
bloodPressure: ((_z = risk === null || risk === void 0 ? void 0 : risk.data) === null || _z === void 0 ? void 0 : _z.bloodPressure) || null,
|
|
210
|
+
height: ((_0 = risk === null || risk === void 0 ? void 0 : risk.data) === null || _0 === void 0 ? void 0 : _0.height) || null,
|
|
211
|
+
weight: ((_1 = risk === null || risk === void 0 ? void 0 : risk.data) === null || _1 === void 0 ? void 0 : _1.weight) || null,
|
|
212
|
+
},
|
|
213
|
+
groupedEconomicValues: []
|
|
214
|
+
});
|
|
215
|
+
})) || []
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
return quotation;
|
|
219
|
+
};
|
|
220
|
+
exports.getQuotationDetail = getQuotationDetail;
|
|
221
|
+
const getQuotationByCode = async (response) => {
|
|
222
|
+
var _a, _b, _c;
|
|
223
|
+
const objectMapped = {
|
|
224
|
+
code: ((_a = response.quotationNumber) === null || _a === void 0 ? void 0 : _a.toString()) || null,
|
|
225
|
+
number: response.activityCode || 0,
|
|
226
|
+
creationDate: response.vigencyDateFrom || null,
|
|
227
|
+
expirationDate: response.vigencyDateTo || null,
|
|
228
|
+
validity: {
|
|
229
|
+
code: "N/A",
|
|
230
|
+
name: "N/A",
|
|
231
|
+
months: "N/A"
|
|
232
|
+
},
|
|
233
|
+
status: {
|
|
234
|
+
code: "N/A",
|
|
235
|
+
name: "N/A"
|
|
236
|
+
},
|
|
237
|
+
paymentFrequency: {
|
|
238
|
+
name: "N/A",
|
|
239
|
+
code: "N/A",
|
|
240
|
+
months: 0
|
|
241
|
+
},
|
|
242
|
+
email: "N/A",
|
|
243
|
+
phone: "N/A",
|
|
244
|
+
intermediary: {
|
|
245
|
+
code: "N/A",
|
|
246
|
+
name: "N/A",
|
|
247
|
+
roles: {},
|
|
248
|
+
},
|
|
249
|
+
commercialStructure: {
|
|
250
|
+
data: {
|
|
251
|
+
name: "N/A",
|
|
252
|
+
code: "N/A",
|
|
253
|
+
version: 0,
|
|
254
|
+
description: "N/A",
|
|
255
|
+
status: {
|
|
256
|
+
name: "N/A",
|
|
257
|
+
code: "N/A"
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
intermediaries: {
|
|
261
|
+
values: [
|
|
262
|
+
{
|
|
263
|
+
code: "N/A",
|
|
264
|
+
name: "N/A",
|
|
265
|
+
licence: "N/A",
|
|
266
|
+
role: {
|
|
267
|
+
name: "N/A",
|
|
268
|
+
code: "N/A"
|
|
269
|
+
},
|
|
270
|
+
status: {
|
|
271
|
+
name: "N/A",
|
|
272
|
+
code: "N/A"
|
|
273
|
+
},
|
|
274
|
+
group: {
|
|
275
|
+
name: "N/A",
|
|
276
|
+
code: "N/A"
|
|
277
|
+
},
|
|
278
|
+
}
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
product: {
|
|
283
|
+
name: "N/A",
|
|
284
|
+
code: ((_b = response === null || response === void 0 ? void 0 : response.productCode) === null || _b === void 0 ? void 0 : _b.toString()) || null,
|
|
285
|
+
version: 0,
|
|
286
|
+
subsection: {
|
|
287
|
+
name: "N/A",
|
|
288
|
+
code: "N/A",
|
|
289
|
+
section: {
|
|
290
|
+
name: "N/A",
|
|
291
|
+
code: ((_c = response === null || response === void 0 ? void 0 : response.sectionCode) === null || _c === void 0 ? void 0 : _c.toString()) || null,
|
|
292
|
+
type: {
|
|
293
|
+
name: "N/A",
|
|
294
|
+
code: "N/A"
|
|
295
|
+
},
|
|
296
|
+
category: {
|
|
297
|
+
name: "N/A",
|
|
298
|
+
code: "N/A"
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
status: {
|
|
303
|
+
code: "N/A",
|
|
304
|
+
name: "N/A"
|
|
305
|
+
},
|
|
306
|
+
currency: {
|
|
307
|
+
name: "N/A",
|
|
308
|
+
code: "N/A",
|
|
309
|
+
mnemonic: "N/A",
|
|
310
|
+
symbol: "N/A"
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
productSegment: {
|
|
314
|
+
coverages: [],
|
|
315
|
+
expenses: [],
|
|
316
|
+
name: "N/A",
|
|
317
|
+
code: "N/A",
|
|
318
|
+
version: 0,
|
|
319
|
+
description: "N/A"
|
|
320
|
+
},
|
|
321
|
+
values: {
|
|
322
|
+
risks: [
|
|
323
|
+
{
|
|
324
|
+
code: "N/A",
|
|
325
|
+
coverages: [
|
|
326
|
+
{
|
|
327
|
+
code: "N/A",
|
|
328
|
+
name: "N/A",
|
|
329
|
+
deductible: {
|
|
330
|
+
name: "N/A",
|
|
331
|
+
code: "N/A",
|
|
332
|
+
value: 0,
|
|
333
|
+
appliedValue: 0
|
|
334
|
+
},
|
|
335
|
+
economicValues: [
|
|
336
|
+
{
|
|
337
|
+
type: {
|
|
338
|
+
name: "N/A",
|
|
339
|
+
code: "N/A"
|
|
340
|
+
},
|
|
341
|
+
value: 0
|
|
342
|
+
}
|
|
343
|
+
],
|
|
344
|
+
coverageValues: [
|
|
345
|
+
{
|
|
346
|
+
type: {
|
|
347
|
+
name: "N/A",
|
|
348
|
+
code: "N/A"
|
|
349
|
+
},
|
|
350
|
+
value: 0
|
|
351
|
+
}
|
|
352
|
+
]
|
|
353
|
+
}
|
|
354
|
+
],
|
|
355
|
+
data: {},
|
|
356
|
+
adherents: [
|
|
357
|
+
{
|
|
358
|
+
code: "N/A",
|
|
359
|
+
coverages: [
|
|
360
|
+
{
|
|
361
|
+
code: "N/A",
|
|
362
|
+
name: "N/A",
|
|
363
|
+
deductible: {
|
|
364
|
+
name: "N/A",
|
|
365
|
+
code: "N/A",
|
|
366
|
+
value: 0,
|
|
367
|
+
appliedValue: 0
|
|
368
|
+
},
|
|
369
|
+
economicValues: [{
|
|
370
|
+
type: "N/A",
|
|
371
|
+
code: "N/A"
|
|
372
|
+
}],
|
|
373
|
+
coverageValues: [{
|
|
374
|
+
type: {
|
|
375
|
+
name: "N/A",
|
|
376
|
+
code: "N/A"
|
|
377
|
+
},
|
|
378
|
+
value: 0
|
|
379
|
+
}]
|
|
380
|
+
}
|
|
381
|
+
],
|
|
382
|
+
data: {}
|
|
383
|
+
}
|
|
384
|
+
]
|
|
385
|
+
}
|
|
386
|
+
],
|
|
387
|
+
expenses: [
|
|
388
|
+
{
|
|
389
|
+
type: {
|
|
390
|
+
name: "N/A",
|
|
391
|
+
code: "N/A"
|
|
392
|
+
},
|
|
393
|
+
value: 0
|
|
394
|
+
}
|
|
395
|
+
],
|
|
396
|
+
groupedEconomicValues: [
|
|
397
|
+
{
|
|
398
|
+
type: {
|
|
399
|
+
name: "N/A",
|
|
400
|
+
code: "N/A"
|
|
401
|
+
},
|
|
402
|
+
value: 0
|
|
403
|
+
}
|
|
404
|
+
],
|
|
405
|
+
commercialAgreement: {}
|
|
406
|
+
}
|
|
407
|
+
};
|
|
408
|
+
return objectMapped;
|
|
409
|
+
};
|
|
410
|
+
exports.getQuotationByCode = getQuotationByCode;
|
|
411
|
+
const getQuotationByCode_Request = (inputParams) => {
|
|
412
|
+
return {};
|
|
413
|
+
};
|
|
414
|
+
exports.getQuotationByCode_Request = getQuotationByCode_Request;
|
|
415
|
+
const getQuotations_Request = (inputParams) => {
|
|
416
|
+
return {
|
|
417
|
+
number: inputParams.quotationNumber || undefined,
|
|
418
|
+
from: inputParams.dateFrom || undefined,
|
|
419
|
+
to: inputParams.dateTo || undefined,
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
exports.getQuotations_Request = getQuotations_Request;
|
|
423
|
+
const quotationStandardPlanCreationMapped = (params) => {
|
|
424
|
+
if (!params)
|
|
425
|
+
return null;
|
|
426
|
+
return {
|
|
427
|
+
sectionCode: 17, // no recibe se asigna 17 por defecto
|
|
428
|
+
paymentTypeCode: (0, mappingHelpers_1.mapPaymentFrequency)(params.paymentFrequencyCode),
|
|
429
|
+
productCode: (0, mappingHelpers_1.mapProductCode)(params.productCode),
|
|
430
|
+
provinceCode: 1, // no recibe provincia, se asigna 1 por defecto
|
|
431
|
+
};
|
|
432
|
+
};
|
|
433
|
+
exports.quotationStandardPlanCreationMapped = quotationStandardPlanCreationMapped;
|
|
434
|
+
const quotationVariablePlanCreationMapped = (params) => {
|
|
435
|
+
var _a, _b, _c, _d;
|
|
436
|
+
if (!params)
|
|
437
|
+
return null;
|
|
438
|
+
return {
|
|
439
|
+
sectionCode: 17, // no recibe se asigna 17 por defecto
|
|
440
|
+
paymentTypeCode: (0, mappingHelpers_1.mapPaymentFrequency)(params.paymentFrequencyCode),
|
|
441
|
+
productCode: (0, mappingHelpers_1.mapProductCode)(params.productCode),
|
|
442
|
+
provinceCode: 1, // no recibe provincia, se asigna 1 por defecto
|
|
443
|
+
birthdate: (_a = params.risks[0]) === null || _a === void 0 ? void 0 : _a.birthDate,
|
|
444
|
+
insuredAmount: ((_d = (_c = (_b = params.risks[0]) === null || _b === void 0 ? void 0 : _b.coverages[0]) === null || _c === void 0 ? void 0 : _c.values.find(v => v.code === "INSURED_AMOUNT")) === null || _d === void 0 ? void 0 : _d.value) || 0,
|
|
445
|
+
};
|
|
446
|
+
};
|
|
447
|
+
exports.quotationVariablePlanCreationMapped = quotationVariablePlanCreationMapped;
|
|
448
|
+
const getActivityList = async (response) => {
|
|
449
|
+
const objectMapped = {
|
|
450
|
+
values: response.activities.map(a => ({
|
|
451
|
+
code: a.code,
|
|
452
|
+
name: a.name,
|
|
453
|
+
})),
|
|
454
|
+
};
|
|
455
|
+
return objectMapped;
|
|
456
|
+
};
|
|
457
|
+
exports.getActivityList = getActivityList;
|
|
458
|
+
const getProductsBySubsections = async (response) => {
|
|
459
|
+
const objectMapped = {
|
|
460
|
+
values: response.products.map(item => ({
|
|
461
|
+
name: item.name,
|
|
462
|
+
code: item.code,
|
|
463
|
+
version: item.version,
|
|
464
|
+
subsection: (item === null || item === void 0 ? void 0 : item.subsection) || null,
|
|
465
|
+
fieldExclusions: (item === null || item === void 0 ? void 0 : item.exclusions) || null,
|
|
466
|
+
fields: (item === null || item === void 0 ? void 0 : item.fieldValues) || (item === null || item === void 0 ? void 0 : item.fields) || null
|
|
467
|
+
})),
|
|
468
|
+
};
|
|
469
|
+
return objectMapped;
|
|
470
|
+
};
|
|
471
|
+
exports.getProductsBySubsections = getProductsBySubsections;
|
|
472
|
+
const getProductParameters = async (item) => {
|
|
473
|
+
const objectMapped = {
|
|
474
|
+
name: item.name,
|
|
475
|
+
code: item.code,
|
|
476
|
+
version: item.version,
|
|
477
|
+
subsection: (item === null || item === void 0 ? void 0 : item.subsection) || null,
|
|
478
|
+
fieldExclusions: (item === null || item === void 0 ? void 0 : item.exclusions) || null,
|
|
479
|
+
fields: (item === null || item === void 0 ? void 0 : item.fields) || null
|
|
480
|
+
};
|
|
481
|
+
return objectMapped;
|
|
482
|
+
};
|
|
483
|
+
exports.getProductParameters = getProductParameters;
|
|
484
|
+
const getPaymentFrecuencies = async (response) => {
|
|
485
|
+
const objectMapped = {
|
|
486
|
+
frequencies: response.frequencies.map(a => ({
|
|
487
|
+
name: a.name,
|
|
488
|
+
code: a.code,
|
|
489
|
+
months: a.months
|
|
490
|
+
})),
|
|
491
|
+
};
|
|
492
|
+
return objectMapped;
|
|
493
|
+
};
|
|
494
|
+
exports.getPaymentFrecuencies = getPaymentFrecuencies;
|