sysone-api-mapper 1.0.149 → 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.
- package/dist/axiosInstance.d.ts +2 -1
- package/dist/axiosInstance.js +8 -3
- package/dist/index.js +20 -7
- package/dist/services.js +23 -15
- package/dist/servicesData.js +367 -364
- package/dist/src/adapters/createApiAdapter.d.ts +1 -0
- package/dist/src/adapters/createApiAdapter.js +11 -7
- package/dist/src/adapters/financeAdapter.d.ts +1 -0
- package/dist/src/adapters/financeAdapter.js +8 -3
- package/dist/src/adapters/locationAdapter.js +8 -4
- package/dist/src/adapters/partyAdapter.js +10 -6
- package/dist/src/contexts/actionsContext.js +45 -8
- package/dist/src/contexts/apiContext.js +8 -4
- package/dist/src/contexts/translationContext.js +43 -6
- package/dist/src/mapper/Mapper.js +21 -13
- package/dist/src/mapper/endpointsConfig.js +155 -152
- package/dist/src/mapper/helpers/mappingHelpers.js +9 -3
- package/dist/src/mapper/modules/billing/index.js +13 -5
- package/dist/src/mapper/modules/claim/index.js +5 -1
- package/dist/src/mapper/modules/general/index.js +7 -2
- package/dist/src/mapper/modules/party/index.js +21 -9
- package/dist/src/mapper/modules/policy/index.js +24 -5
- package/dist/src/mapper/modules/quotation/index.js +35 -18
- package/dist/src/mapper/modules/request/index.js +7 -2
- package/package.json +1 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapProvinceCode = exports.mapProductCode = exports.mapPaymentFrequency = void 0;
|
|
4
|
+
const mapPaymentFrequency = (frequencyCode) => {
|
|
2
5
|
const mapping = {
|
|
3
6
|
'ANNUAL': 6,
|
|
4
7
|
'MONTHLY': 1,
|
|
@@ -7,7 +10,8 @@ export const mapPaymentFrequency = (frequencyCode) => {
|
|
|
7
10
|
};
|
|
8
11
|
return mapping[frequencyCode] || 6;
|
|
9
12
|
};
|
|
10
|
-
|
|
13
|
+
exports.mapPaymentFrequency = mapPaymentFrequency;
|
|
14
|
+
const mapProductCode = (productCode) => {
|
|
11
15
|
const mapping = {
|
|
12
16
|
'SC_SC': 534,
|
|
13
17
|
'VI_VI_VIDA_IND_1': 120,
|
|
@@ -15,10 +19,12 @@ export const mapProductCode = (productCode) => {
|
|
|
15
19
|
};
|
|
16
20
|
return mapping[productCode] || 404;
|
|
17
21
|
};
|
|
18
|
-
|
|
22
|
+
exports.mapProductCode = mapProductCode;
|
|
23
|
+
const mapProvinceCode = (provinceCode) => {
|
|
19
24
|
const mapping = {
|
|
20
25
|
'BS_AS': 1,
|
|
21
26
|
'CABA': 2,
|
|
22
27
|
};
|
|
23
28
|
return mapping[provinceCode] || 0;
|
|
24
29
|
};
|
|
30
|
+
exports.mapProvinceCode = mapProvinceCode;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBillingTypeResponse = exports.getCollecionsResponse = exports.getDebtorsResponse = exports.getBillingsResponse = exports.getBillingsParams = void 0;
|
|
4
|
+
const getBillingsParams = (i) => {
|
|
2
5
|
return {};
|
|
3
6
|
};
|
|
4
|
-
|
|
7
|
+
exports.getBillingsParams = getBillingsParams;
|
|
8
|
+
const getBillingsResponse = (data) => {
|
|
5
9
|
const values = data.paymentsEndorsement.flatMap((endorsement, index) => {
|
|
6
10
|
return endorsement.payments.map((payment, pIndex) => {
|
|
7
11
|
var _a;
|
|
@@ -43,7 +47,8 @@ export const getBillingsResponse = (data) => {
|
|
|
43
47
|
total: values.length
|
|
44
48
|
};
|
|
45
49
|
};
|
|
46
|
-
|
|
50
|
+
exports.getBillingsResponse = getBillingsResponse;
|
|
51
|
+
const getDebtorsResponse = (data) => {
|
|
47
52
|
const values = data.paymentsEndorsement
|
|
48
53
|
.flatMap((endorsement, index) => {
|
|
49
54
|
return endorsement.payments.map((payment, pIndex) => {
|
|
@@ -87,7 +92,8 @@ export const getDebtorsResponse = (data) => {
|
|
|
87
92
|
total: values.length
|
|
88
93
|
};
|
|
89
94
|
};
|
|
90
|
-
|
|
95
|
+
exports.getDebtorsResponse = getDebtorsResponse;
|
|
96
|
+
const getCollecionsResponse = (data) => {
|
|
91
97
|
const values = data.paymentsEndorsement.flatMap((endorsement, index) => {
|
|
92
98
|
return endorsement.payments.map((payment, pIndex) => ({
|
|
93
99
|
code: `${index + 1}-${pIndex + 1}`,
|
|
@@ -115,7 +121,8 @@ export const getCollecionsResponse = (data) => {
|
|
|
115
121
|
total: values.length
|
|
116
122
|
};
|
|
117
123
|
};
|
|
118
|
-
|
|
124
|
+
exports.getCollecionsResponse = getCollecionsResponse;
|
|
125
|
+
const getBillingTypeResponse = () => {
|
|
119
126
|
return {
|
|
120
127
|
types: [
|
|
121
128
|
{
|
|
@@ -126,3 +133,4 @@ export const getBillingTypeResponse = () => {
|
|
|
126
133
|
]
|
|
127
134
|
};
|
|
128
135
|
};
|
|
136
|
+
exports.getBillingTypeResponse = getBillingTypeResponse;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getClaims_CNP = void 0;
|
|
4
|
+
const getClaims_CNP = async (response) => {
|
|
2
5
|
var _a;
|
|
3
6
|
const objectMapped = {
|
|
4
7
|
values: (_a = response === null || response === void 0 ? void 0 : response.claims) === null || _a === void 0 ? void 0 : _a.map((claim) => ({
|
|
@@ -13,3 +16,4 @@ export const getClaims_CNP = async (response) => {
|
|
|
13
16
|
};
|
|
14
17
|
return objectMapped;
|
|
15
18
|
};
|
|
19
|
+
exports.getClaims_CNP = getClaims_CNP;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getModules_Request = exports.getModules = void 0;
|
|
4
|
+
const getModules = () => { };
|
|
5
|
+
exports.getModules = getModules;
|
|
6
|
+
const getModules_Request = (params) => {
|
|
3
7
|
return {
|
|
4
8
|
roles: params.roles,
|
|
5
9
|
};
|
|
6
10
|
};
|
|
11
|
+
exports.getModules_Request = getModules_Request;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCoverages = exports.partySearch = exports.partySearchParams = exports.getProductsBySubsections_Request = exports.getGenders = exports.getMaritalStatuses = exports.getProvinces = exports.getCountries = exports.getIdentificationTypes = void 0;
|
|
4
|
+
const getIdentificationTypes = async (response) => {
|
|
2
5
|
const objectMapped = {
|
|
3
6
|
values: response.types.map(a => ({
|
|
4
7
|
code: a.code,
|
|
@@ -7,7 +10,8 @@ export const getIdentificationTypes = async (response) => {
|
|
|
7
10
|
};
|
|
8
11
|
return objectMapped;
|
|
9
12
|
};
|
|
10
|
-
|
|
13
|
+
exports.getIdentificationTypes = getIdentificationTypes;
|
|
14
|
+
const getCountries = async (response) => {
|
|
11
15
|
const objectMapped = {
|
|
12
16
|
countries: response.countries.map(a => ({
|
|
13
17
|
code: a.code,
|
|
@@ -17,7 +21,8 @@ export const getCountries = async (response) => {
|
|
|
17
21
|
};
|
|
18
22
|
return objectMapped;
|
|
19
23
|
};
|
|
20
|
-
|
|
24
|
+
exports.getCountries = getCountries;
|
|
25
|
+
const getProvinces = async (response) => {
|
|
21
26
|
const objectMapped = {
|
|
22
27
|
provinces: response.provinces.map(a => ({
|
|
23
28
|
name: a.name,
|
|
@@ -31,7 +36,8 @@ export const getProvinces = async (response) => {
|
|
|
31
36
|
};
|
|
32
37
|
return objectMapped;
|
|
33
38
|
};
|
|
34
|
-
|
|
39
|
+
exports.getProvinces = getProvinces;
|
|
40
|
+
const getMaritalStatuses = async (response) => {
|
|
35
41
|
const objectMapped = {
|
|
36
42
|
values: response.statuses.map(a => ({
|
|
37
43
|
name: a.name,
|
|
@@ -40,7 +46,8 @@ export const getMaritalStatuses = async (response) => {
|
|
|
40
46
|
};
|
|
41
47
|
return objectMapped;
|
|
42
48
|
};
|
|
43
|
-
|
|
49
|
+
exports.getMaritalStatuses = getMaritalStatuses;
|
|
50
|
+
const getGenders = async (response) => {
|
|
44
51
|
const objectMapped = {
|
|
45
52
|
values: response.genders.map(a => ({
|
|
46
53
|
name: a.name,
|
|
@@ -49,19 +56,22 @@ export const getGenders = async (response) => {
|
|
|
49
56
|
};
|
|
50
57
|
return objectMapped;
|
|
51
58
|
};
|
|
52
|
-
|
|
59
|
+
exports.getGenders = getGenders;
|
|
60
|
+
const getProductsBySubsections_Request = (params) => {
|
|
53
61
|
return {
|
|
54
62
|
subsectionCode: null
|
|
55
63
|
};
|
|
56
64
|
};
|
|
57
|
-
|
|
65
|
+
exports.getProductsBySubsections_Request = getProductsBySubsections_Request;
|
|
66
|
+
const partySearchParams = (params) => {
|
|
58
67
|
return {
|
|
59
68
|
firstName: params.firstName || params.name || null,
|
|
60
69
|
lastName: params.lastName || null,
|
|
61
70
|
identification: params.identificationValue || null,
|
|
62
71
|
};
|
|
63
72
|
};
|
|
64
|
-
|
|
73
|
+
exports.partySearchParams = partySearchParams;
|
|
74
|
+
const partySearch = (res) => {
|
|
65
75
|
var _a;
|
|
66
76
|
const objectMapped = {
|
|
67
77
|
values: (_a = res === null || res === void 0 ? void 0 : res.parties) === null || _a === void 0 ? void 0 : _a.map(party => {
|
|
@@ -93,7 +103,8 @@ export const partySearch = (res) => {
|
|
|
93
103
|
};
|
|
94
104
|
return objectMapped;
|
|
95
105
|
};
|
|
96
|
-
|
|
106
|
+
exports.partySearch = partySearch;
|
|
107
|
+
const getCoverages = (p) => {
|
|
97
108
|
var _a;
|
|
98
109
|
const objectMapped = {
|
|
99
110
|
coverages: (_a = p.coverages) === null || _a === void 0 ? void 0 : _a.map(c => {
|
|
@@ -117,3 +128,4 @@ export const getCoverages = (p) => {
|
|
|
117
128
|
};
|
|
118
129
|
return objectMapped;
|
|
119
130
|
};
|
|
131
|
+
exports.getCoverages = getCoverages;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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.getPolicyCollection = exports.getPolicyDetail_Request = exports.getEndorsements_Request = exports.getPolicyCollection_Request = exports.getPolicyIndividualDetail_Request = exports.getPolicyCollectiveDetail_Request = exports.getPolicyCollectiveDetail_CNP = exports.getPolicyDetail_CNP = exports.getPolicies_CNP_Request = exports.getPolicies_CNP = exports.getEndorsements_CNP = exports.postInsureds_CNP = exports.getInsureds_CNP_Request = exports.getInsureds_CNP = void 0;
|
|
7
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
8
|
+
const customParseFormat_1 = __importDefault(require("dayjs/plugin/customParseFormat"));
|
|
9
|
+
dayjs_1.default.extend(customParseFormat_1.default);
|
|
4
10
|
const parseSafeDate = (dateString) => {
|
|
5
11
|
if (!dateString)
|
|
6
12
|
return null;
|
|
7
13
|
try {
|
|
8
14
|
// Parsear explícitamente con el formato DD/MM/YYYY
|
|
9
15
|
// El tercer parámetro 'true' activa el modo strict
|
|
10
|
-
const parsed =
|
|
16
|
+
const parsed = (0, dayjs_1.default)(dateString, 'DD/MM/YYYY', true);
|
|
11
17
|
// Verificar si la fecha es válida
|
|
12
18
|
if (!parsed.isValid()) {
|
|
13
19
|
console.warn(`Invalid date format: ${dateString}`);
|
|
@@ -55,12 +61,14 @@ const getInsureds_CNP = async (response) => {
|
|
|
55
61
|
};
|
|
56
62
|
return objectMapped;
|
|
57
63
|
};
|
|
64
|
+
exports.getInsureds_CNP = getInsureds_CNP;
|
|
58
65
|
const getInsureds_CNP_Request = (inputParams) => {
|
|
59
66
|
return {
|
|
60
67
|
code: inputParams.number || undefined,
|
|
61
68
|
name: inputParams.firstName || undefined,
|
|
62
69
|
};
|
|
63
70
|
};
|
|
71
|
+
exports.getInsureds_CNP_Request = getInsureds_CNP_Request;
|
|
64
72
|
const postInsureds_CNP = (payload) => {
|
|
65
73
|
const objectMapped = {
|
|
66
74
|
salary: typeof payload.salary === 'string' ? payload.salary : String(payload.salary),
|
|
@@ -68,6 +76,7 @@ const postInsureds_CNP = (payload) => {
|
|
|
68
76
|
};
|
|
69
77
|
return objectMapped;
|
|
70
78
|
};
|
|
79
|
+
exports.postInsureds_CNP = postInsureds_CNP;
|
|
71
80
|
const getEndorsements_CNP = async (response) => {
|
|
72
81
|
const objectMapped = {
|
|
73
82
|
values: response.endorsements.map((e) => ({
|
|
@@ -85,9 +94,11 @@ const getEndorsements_CNP = async (response) => {
|
|
|
85
94
|
};
|
|
86
95
|
return objectMapped;
|
|
87
96
|
};
|
|
97
|
+
exports.getEndorsements_CNP = getEndorsements_CNP;
|
|
88
98
|
const getEndorsements_Request = (inputParams) => {
|
|
89
99
|
return {};
|
|
90
100
|
};
|
|
101
|
+
exports.getEndorsements_Request = getEndorsements_Request;
|
|
91
102
|
const getPolicies_CNP = async (response) => {
|
|
92
103
|
if (!(response === null || response === void 0 ? void 0 : response.policies) || response.policies.length === 0) {
|
|
93
104
|
return {
|
|
@@ -142,6 +153,7 @@ const getPolicies_CNP = async (response) => {
|
|
|
142
153
|
};
|
|
143
154
|
return objectMapped;
|
|
144
155
|
};
|
|
156
|
+
exports.getPolicies_CNP = getPolicies_CNP;
|
|
145
157
|
const getPolicies_CNP_Request = (inputParams) => {
|
|
146
158
|
return {
|
|
147
159
|
sort: "TomadorCodigo",
|
|
@@ -154,6 +166,7 @@ const getPolicies_CNP_Request = (inputParams) => {
|
|
|
154
166
|
requestNumber: inputParams.requestNumber,
|
|
155
167
|
};
|
|
156
168
|
};
|
|
169
|
+
exports.getPolicies_CNP_Request = getPolicies_CNP_Request;
|
|
157
170
|
const getPolicyDetail_CNP = async (data) => {
|
|
158
171
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
159
172
|
const objectMapped = {
|
|
@@ -290,6 +303,7 @@ const getPolicyDetail_CNP = async (data) => {
|
|
|
290
303
|
};
|
|
291
304
|
return objectMapped;
|
|
292
305
|
};
|
|
306
|
+
exports.getPolicyDetail_CNP = getPolicyDetail_CNP;
|
|
293
307
|
const getPolicyCollection = async (data) => {
|
|
294
308
|
const objectMapped = {
|
|
295
309
|
billingForm: {},
|
|
@@ -305,6 +319,7 @@ const getPolicyCollection = async (data) => {
|
|
|
305
319
|
};
|
|
306
320
|
return objectMapped;
|
|
307
321
|
};
|
|
322
|
+
exports.getPolicyCollection = getPolicyCollection;
|
|
308
323
|
const getPolicyCollectiveDetail_CNP = async (response) => {
|
|
309
324
|
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, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16;
|
|
310
325
|
const objectMapped = {
|
|
@@ -558,16 +573,20 @@ const getPolicyCollectiveDetail_CNP = async (response) => {
|
|
|
558
573
|
};
|
|
559
574
|
return objectMapped;
|
|
560
575
|
};
|
|
576
|
+
exports.getPolicyCollectiveDetail_CNP = getPolicyCollectiveDetail_CNP;
|
|
561
577
|
const getPolicyDetail_Request = (inputParams) => {
|
|
562
578
|
return {};
|
|
563
579
|
};
|
|
580
|
+
exports.getPolicyDetail_Request = getPolicyDetail_Request;
|
|
564
581
|
const getPolicyCollection_Request = (inputParams) => {
|
|
565
582
|
return {};
|
|
566
583
|
};
|
|
584
|
+
exports.getPolicyCollection_Request = getPolicyCollection_Request;
|
|
567
585
|
const getPolicyCollectiveDetail_Request = (inputParams) => {
|
|
568
586
|
return {};
|
|
569
587
|
};
|
|
588
|
+
exports.getPolicyCollectiveDetail_Request = getPolicyCollectiveDetail_Request;
|
|
570
589
|
const getPolicyIndividualDetail_Request = (inputParams) => {
|
|
571
590
|
return {};
|
|
572
591
|
};
|
|
573
|
-
|
|
592
|
+
exports.getPolicyIndividualDetail_Request = getPolicyIndividualDetail_Request;
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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"));
|
|
3
9
|
const normalizeDateToYYYYMMDD = (date) => {
|
|
4
10
|
if (!date)
|
|
5
11
|
return null;
|
|
6
12
|
const formats = ['DD/MM/YYYY', 'YYYY/MM/DD'];
|
|
7
|
-
const parsed =
|
|
13
|
+
const parsed = (0, dayjs_1.default)(date, formats, true);
|
|
8
14
|
return parsed.isValid()
|
|
9
15
|
? parsed.format('YYYY/MM/DD')
|
|
10
16
|
: null;
|
|
11
17
|
};
|
|
12
|
-
|
|
18
|
+
const getQuotationsList = async (response) => {
|
|
13
19
|
const quotations = Array.isArray(response === null || response === void 0 ? void 0 : response.quotations)
|
|
14
20
|
? response.quotations.map(q => {
|
|
15
21
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
@@ -49,7 +55,8 @@ export const getQuotationsList = async (response) => {
|
|
|
49
55
|
total,
|
|
50
56
|
};
|
|
51
57
|
};
|
|
52
|
-
|
|
58
|
+
exports.getQuotationsList = getQuotationsList;
|
|
59
|
+
const getQuotationDetail = async (res) => {
|
|
53
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;
|
|
54
61
|
const quotation = {
|
|
55
62
|
areaCode: (res === null || res === void 0 ? void 0 : res.areaCode) || null,
|
|
@@ -210,7 +217,8 @@ export const getQuotationDetail = async (res) => {
|
|
|
210
217
|
};
|
|
211
218
|
return quotation;
|
|
212
219
|
};
|
|
213
|
-
|
|
220
|
+
exports.getQuotationDetail = getQuotationDetail;
|
|
221
|
+
const getQuotationByCode = async (response) => {
|
|
214
222
|
var _a, _b, _c;
|
|
215
223
|
const objectMapped = {
|
|
216
224
|
code: ((_a = response.quotationNumber) === null || _a === void 0 ? void 0 : _a.toString()) || null,
|
|
@@ -399,40 +407,45 @@ export const getQuotationByCode = async (response) => {
|
|
|
399
407
|
};
|
|
400
408
|
return objectMapped;
|
|
401
409
|
};
|
|
402
|
-
|
|
410
|
+
exports.getQuotationByCode = getQuotationByCode;
|
|
411
|
+
const getQuotationByCode_Request = (inputParams) => {
|
|
403
412
|
return {};
|
|
404
413
|
};
|
|
405
|
-
|
|
414
|
+
exports.getQuotationByCode_Request = getQuotationByCode_Request;
|
|
415
|
+
const getQuotations_Request = (inputParams) => {
|
|
406
416
|
return {
|
|
407
417
|
number: inputParams.quotationNumber || undefined,
|
|
408
418
|
from: inputParams.dateFrom || undefined,
|
|
409
419
|
to: inputParams.dateTo || undefined,
|
|
410
420
|
};
|
|
411
421
|
};
|
|
412
|
-
|
|
422
|
+
exports.getQuotations_Request = getQuotations_Request;
|
|
423
|
+
const quotationStandardPlanCreationMapped = (params) => {
|
|
413
424
|
if (!params)
|
|
414
425
|
return null;
|
|
415
426
|
return {
|
|
416
427
|
sectionCode: 17, // no recibe se asigna 17 por defecto
|
|
417
|
-
paymentTypeCode: mapPaymentFrequency(params.paymentFrequencyCode),
|
|
418
|
-
productCode: mapProductCode(params.productCode),
|
|
428
|
+
paymentTypeCode: (0, mappingHelpers_1.mapPaymentFrequency)(params.paymentFrequencyCode),
|
|
429
|
+
productCode: (0, mappingHelpers_1.mapProductCode)(params.productCode),
|
|
419
430
|
provinceCode: 1, // no recibe provincia, se asigna 1 por defecto
|
|
420
431
|
};
|
|
421
432
|
};
|
|
422
|
-
|
|
433
|
+
exports.quotationStandardPlanCreationMapped = quotationStandardPlanCreationMapped;
|
|
434
|
+
const quotationVariablePlanCreationMapped = (params) => {
|
|
423
435
|
var _a, _b, _c, _d;
|
|
424
436
|
if (!params)
|
|
425
437
|
return null;
|
|
426
438
|
return {
|
|
427
439
|
sectionCode: 17, // no recibe se asigna 17 por defecto
|
|
428
|
-
paymentTypeCode: mapPaymentFrequency(params.paymentFrequencyCode),
|
|
429
|
-
productCode: mapProductCode(params.productCode),
|
|
440
|
+
paymentTypeCode: (0, mappingHelpers_1.mapPaymentFrequency)(params.paymentFrequencyCode),
|
|
441
|
+
productCode: (0, mappingHelpers_1.mapProductCode)(params.productCode),
|
|
430
442
|
provinceCode: 1, // no recibe provincia, se asigna 1 por defecto
|
|
431
443
|
birthdate: (_a = params.risks[0]) === null || _a === void 0 ? void 0 : _a.birthDate,
|
|
432
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,
|
|
433
445
|
};
|
|
434
446
|
};
|
|
435
|
-
|
|
447
|
+
exports.quotationVariablePlanCreationMapped = quotationVariablePlanCreationMapped;
|
|
448
|
+
const getActivityList = async (response) => {
|
|
436
449
|
const objectMapped = {
|
|
437
450
|
values: response.activities.map(a => ({
|
|
438
451
|
code: a.code,
|
|
@@ -441,7 +454,8 @@ export const getActivityList = async (response) => {
|
|
|
441
454
|
};
|
|
442
455
|
return objectMapped;
|
|
443
456
|
};
|
|
444
|
-
|
|
457
|
+
exports.getActivityList = getActivityList;
|
|
458
|
+
const getProductsBySubsections = async (response) => {
|
|
445
459
|
const objectMapped = {
|
|
446
460
|
values: response.products.map(item => ({
|
|
447
461
|
name: item.name,
|
|
@@ -454,7 +468,8 @@ export const getProductsBySubsections = async (response) => {
|
|
|
454
468
|
};
|
|
455
469
|
return objectMapped;
|
|
456
470
|
};
|
|
457
|
-
|
|
471
|
+
exports.getProductsBySubsections = getProductsBySubsections;
|
|
472
|
+
const getProductParameters = async (item) => {
|
|
458
473
|
const objectMapped = {
|
|
459
474
|
name: item.name,
|
|
460
475
|
code: item.code,
|
|
@@ -465,7 +480,8 @@ export const getProductParameters = async (item) => {
|
|
|
465
480
|
};
|
|
466
481
|
return objectMapped;
|
|
467
482
|
};
|
|
468
|
-
|
|
483
|
+
exports.getProductParameters = getProductParameters;
|
|
484
|
+
const getPaymentFrecuencies = async (response) => {
|
|
469
485
|
const objectMapped = {
|
|
470
486
|
frequencies: response.frequencies.map(a => ({
|
|
471
487
|
name: a.name,
|
|
@@ -475,3 +491,4 @@ export const getPaymentFrecuencies = async (response) => {
|
|
|
475
491
|
};
|
|
476
492
|
return objectMapped;
|
|
477
493
|
};
|
|
494
|
+
exports.getPaymentFrecuencies = getPaymentFrecuencies;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRequestDetail = exports.getRequest_Params = void 0;
|
|
4
|
+
const getRequest_Params = (i) => {
|
|
2
5
|
return {
|
|
3
6
|
number: i.quotationNumber,
|
|
4
7
|
statusCode: i.status,
|
|
@@ -7,7 +10,8 @@ export const getRequest_Params = (i) => {
|
|
|
7
10
|
to: i.creationDateTo
|
|
8
11
|
};
|
|
9
12
|
};
|
|
10
|
-
|
|
13
|
+
exports.getRequest_Params = getRequest_Params;
|
|
14
|
+
const getRequestDetail = (data) => {
|
|
11
15
|
const mappedCoverages = data.coverages.map(cov => ({
|
|
12
16
|
code: cov.code || null,
|
|
13
17
|
name: cov.name || null,
|
|
@@ -58,3 +62,4 @@ export const getRequestDetail = (data) => {
|
|
|
58
62
|
};
|
|
59
63
|
return request;
|
|
60
64
|
};
|
|
65
|
+
exports.getRequestDetail = getRequestDetail;
|