sysone-api-mapper 1.0.148 → 1.0.150

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.
Files changed (60) hide show
  1. package/dist/axiosInstance.d.ts +2 -1
  2. package/dist/axiosInstance.js +10 -0
  3. package/dist/index.d.ts +2 -2
  4. package/dist/index.js +20 -0
  5. package/dist/services.js +100 -0
  6. package/dist/servicesData.js +999 -0
  7. package/dist/src/adapters/createApiAdapter.d.ts +1 -0
  8. package/dist/src/adapters/createApiAdapter.js +12 -0
  9. package/dist/src/adapters/financeAdapter.d.ts +1 -0
  10. package/dist/src/adapters/financeAdapter.js +9 -0
  11. package/dist/src/adapters/locationAdapter.js +9 -0
  12. package/dist/src/adapters/partyAdapter.js +11 -0
  13. package/{src → dist/src}/components/notificationToast.js +35 -37
  14. package/dist/src/contexts/actionsContext.js +80 -0
  15. package/dist/src/contexts/apiContext.js +12 -0
  16. package/dist/src/contexts/translationContext.js +56 -0
  17. package/dist/src/mapper/Mapper.js +106 -0
  18. package/{src → dist/src}/mapper/endpointsConfig.js +824 -915
  19. package/dist/src/mapper/helpers/mappingHelpers.js +30 -0
  20. package/dist/src/mapper/modules/billing/index.js +136 -0
  21. package/dist/src/mapper/modules/claim/index.js +19 -0
  22. package/dist/src/mapper/modules/general/index.js +11 -0
  23. package/dist/src/mapper/modules/party/index.js +131 -0
  24. package/dist/src/mapper/modules/policy/index.js +592 -0
  25. package/dist/src/mapper/modules/quotation/index.js +494 -0
  26. package/{src → dist/src}/mapper/modules/request/index.js +65 -67
  27. package/dist/src/public/index.js +7 -0
  28. package/{src → dist/src}/server.js +18 -23
  29. package/package.json +3 -3
  30. package/.babelrc +0 -4
  31. package/.gitlab-ci.yml +0 -42
  32. package/axiosInstance.js +0 -7
  33. package/config/dist/index.js +0 -307
  34. package/config/dist/index.js.LICENSE.txt +0 -1
  35. package/config/dist/index.ts +0 -319
  36. package/config/webpack.dev.js +0 -63
  37. package/config/webpack.prod.js +0 -63
  38. package/index.d.ts +0 -5
  39. package/index.ts +0 -20
  40. package/services.js +0 -105
  41. package/servicesData.js +0 -1013
  42. package/src/adapters/createApiAdapter.ts +0 -29
  43. package/src/adapters/financeAdapter.js +0 -5
  44. package/src/adapters/locationAdapter.js +0 -6
  45. package/src/adapters/partyAdapter.js +0 -8
  46. package/src/contexts/actionsContext.js +0 -54
  47. package/src/contexts/apiContext.js +0 -9
  48. package/src/contexts/translationContext.js +0 -29
  49. package/src/mapper/Mapper.js +0 -141
  50. package/src/mapper/helpers/mappingHelpers.js +0 -26
  51. package/src/mapper/modules/billing/index.js +0 -131
  52. package/src/mapper/modules/claim/index.js +0 -17
  53. package/src/mapper/modules/general/index.js +0 -7
  54. package/src/mapper/modules/party/index.js +0 -128
  55. package/src/mapper/modules/policy/index.js +0 -613
  56. package/src/mapper/modules/quotation/index.js +0 -480
  57. package/src/public/index.html +0 -15
  58. package/src/public/index.js +0 -9
  59. package/test/script.js +0 -0
  60. package/tsconfig.json +0 -9
@@ -0,0 +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,67 +1,65 @@
1
-
2
-
3
- export const getRequest_Params = (i) => {
4
- return {
5
- number: i.quotationNumber,
6
- statusCode: i.status,
7
- productCode: i.productCode,
8
- from: i.creationDateFrom,
9
- to: i.creationDateTo
10
- }
11
- }
12
-
13
-
14
- export const getRequestDetail = (data) => {
15
- const mappedCoverages = data.coverages.map(cov => ({
16
- code: cov.code || null,
17
- name: cov.name || null,
18
- deductible: null,
19
- economicValues: [],
20
- coverageValues: cov.coverageValues.map(val => ({
21
- value: val.value,
22
- type: {
23
- name: val.type.name,
24
- code: val.type.code
25
- }
26
- }))
27
- }))
28
-
29
- const request = {
30
- code: data.number,
31
- commercialStructure: null,
32
- creationDate: data.creationDate,
33
- email: data.insured.email,
34
- expirationDate: data?.expirationDate || null,
35
- holder: data.holder || null,
36
- intermediary: null,
37
- legalConstraint: null,
38
- number: data.number || null,
39
- paymentMethods: {
40
- payment: data.payment
41
- },
42
- paymentFrequency: data.payment.period || null,
43
- phone: data.insured.phoneNumber || null,
44
- product: data.product || null,
45
- productSegment: null,
46
- quotationNumber: data.quotationNumber || null,
47
- quotationCode: data.quotationNumber || null,
48
- requiresBilling: null,
49
- status: data.status || null,
50
- validity: null,
51
-
52
- values: {
53
- risks: [{
54
- coverages: mappedCoverages
55
- }]
56
- } || null,
57
-
58
- vigencyDateFrom: null,
59
- wordingPlan: null,
60
- holderPep: data.holderPep,
61
- holderSoi: data.holderSoi,
62
- insured: data.insured || null,
63
- questionnaires: data.questionnaires || null,
64
- spouse: data.spouse || null,
65
- }
66
- return request;
67
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRequestDetail = exports.getRequest_Params = void 0;
4
+ const getRequest_Params = (i) => {
5
+ return {
6
+ number: i.quotationNumber,
7
+ statusCode: i.status,
8
+ productCode: i.productCode,
9
+ from: i.creationDateFrom,
10
+ to: i.creationDateTo
11
+ };
12
+ };
13
+ exports.getRequest_Params = getRequest_Params;
14
+ const getRequestDetail = (data) => {
15
+ const mappedCoverages = data.coverages.map(cov => ({
16
+ code: cov.code || null,
17
+ name: cov.name || null,
18
+ deductible: null,
19
+ economicValues: [],
20
+ coverageValues: cov.coverageValues.map(val => ({
21
+ value: val.value,
22
+ type: {
23
+ name: val.type.name,
24
+ code: val.type.code
25
+ }
26
+ }))
27
+ }));
28
+ const request = {
29
+ code: data.number,
30
+ commercialStructure: null,
31
+ creationDate: data.creationDate,
32
+ email: data.insured.email,
33
+ expirationDate: (data === null || data === void 0 ? void 0 : data.expirationDate) || null,
34
+ holder: data.holder || null,
35
+ intermediary: null,
36
+ legalConstraint: null,
37
+ number: data.number || null,
38
+ paymentMethods: {
39
+ payment: data.payment
40
+ },
41
+ paymentFrequency: data.payment.period || null,
42
+ phone: data.insured.phoneNumber || null,
43
+ product: data.product || null,
44
+ productSegment: null,
45
+ quotationNumber: data.quotationNumber || null,
46
+ quotationCode: data.quotationNumber || null,
47
+ requiresBilling: null,
48
+ status: data.status || null,
49
+ validity: null,
50
+ values: {
51
+ risks: [{
52
+ coverages: mappedCoverages
53
+ }]
54
+ } || null,
55
+ vigencyDateFrom: null,
56
+ wordingPlan: null,
57
+ holderPep: data.holderPep,
58
+ holderSoi: data.holderSoi,
59
+ insured: data.insured || null,
60
+ questionnaires: data.questionnaires || null,
61
+ spouse: data.spouse || null,
62
+ };
63
+ return request;
64
+ };
65
+ exports.getRequestDetail = getRequestDetail;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ const root = document.getElementById("root");
3
+ const header = document.createElement("h1");
4
+ const div = document.createElement("div");
5
+ header.innerHTML = "HOLA";
6
+ div.append(header);
7
+ root.append(div);
@@ -1,23 +1,18 @@
1
- const express = require("express");
2
- const cors = require("cors");
3
- require("dotenv").config();
4
- const path = require("path");
5
-
6
-
7
- const app = express();
8
- const port = process.env.PORT || 3000;
9
-
10
- // Middleware
11
- app.use(cors());
12
- app.use(express.json());
13
-
14
- // Ruta raíz
15
- app.get("*", (req, res) => {
16
- res.sendFile(path.join(__dirname, "public", "index.html"));
17
- })
18
-
19
-
20
- // Iniciar el servidor
21
- app.listen(port, () => {
22
- console.log(`Server is running on http://localhost:${port}`);
23
- });
1
+ "use strict";
2
+ const express = require("express");
3
+ const cors = require("cors");
4
+ require("dotenv").config();
5
+ const path = require("path");
6
+ const app = express();
7
+ const port = process.env.PORT || 3000;
8
+ // Middleware
9
+ app.use(cors());
10
+ app.use(express.json());
11
+ // Ruta raíz
12
+ app.get("*", (req, res) => {
13
+ res.sendFile(path.join(__dirname, "public", "index.html"));
14
+ });
15
+ // Iniciar el servidor
16
+ app.listen(port, () => {
17
+ console.log(`Server is running on http://localhost:${port}`);
18
+ });