sysone-api-mapper 1.0.148 → 1.0.149
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/{axiosInstance.js → dist/axiosInstance.js} +5 -7
- package/dist/index.d.ts +2 -2
- package/{index.ts → dist/index.js} +7 -20
- package/dist/services.js +92 -0
- package/dist/servicesData.js +996 -0
- package/dist/src/adapters/createApiAdapter.js +8 -0
- package/{src → dist/src}/adapters/financeAdapter.js +4 -5
- package/{src → dist/src}/adapters/locationAdapter.js +5 -6
- package/{src → dist/src}/adapters/partyAdapter.js +7 -8
- package/{src → dist/src}/components/notificationToast.js +35 -37
- package/dist/src/contexts/actionsContext.js +43 -0
- package/{src → dist/src}/contexts/apiContext.js +8 -9
- package/dist/src/contexts/translationContext.js +19 -0
- package/dist/src/mapper/Mapper.js +98 -0
- package/{src → dist/src}/mapper/endpointsConfig.js +821 -915
- package/{src → dist/src}/mapper/helpers/mappingHelpers.js +24 -26
- package/{src → dist/src}/mapper/modules/billing/index.js +128 -131
- package/{src → dist/src}/mapper/modules/claim/index.js +15 -17
- package/{src → dist/src}/mapper/modules/general/index.js +6 -7
- package/{src → dist/src}/mapper/modules/party/index.js +119 -128
- package/dist/src/mapper/modules/policy/index.js +573 -0
- package/dist/src/mapper/modules/quotation/index.js +477 -0
- package/{src → dist/src}/mapper/modules/request/index.js +60 -67
- package/dist/src/public/index.js +7 -0
- package/{src → dist/src}/server.js +18 -23
- package/package.json +3 -3
- package/.babelrc +0 -4
- package/.gitlab-ci.yml +0 -42
- package/config/dist/index.js +0 -307
- package/config/dist/index.js.LICENSE.txt +0 -1
- package/config/dist/index.ts +0 -319
- package/config/webpack.dev.js +0 -63
- package/config/webpack.prod.js +0 -63
- package/index.d.ts +0 -5
- package/services.js +0 -105
- package/servicesData.js +0 -1013
- package/src/adapters/createApiAdapter.ts +0 -29
- package/src/contexts/actionsContext.js +0 -54
- package/src/contexts/translationContext.js +0 -29
- package/src/mapper/Mapper.js +0 -141
- package/src/mapper/modules/policy/index.js +0 -613
- package/src/mapper/modules/quotation/index.js +0 -480
- package/src/public/index.html +0 -15
- package/src/public/index.js +0 -9
- package/test/script.js +0 -0
- package/tsconfig.json +0 -9
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
export const mapPaymentFrequency = (frequencyCode) => {
|
|
2
|
-
const mapping = {
|
|
3
|
-
'ANNUAL': 6,
|
|
4
|
-
'MONTHLY': 1,
|
|
5
|
-
'QUARTERLY': 3,
|
|
6
|
-
'SEMI_ANNUAL': 5
|
|
7
|
-
};
|
|
8
|
-
return mapping[frequencyCode] || 6;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return mapping[provinceCode] || 0
|
|
26
|
-
}
|
|
1
|
+
export const mapPaymentFrequency = (frequencyCode) => {
|
|
2
|
+
const mapping = {
|
|
3
|
+
'ANNUAL': 6,
|
|
4
|
+
'MONTHLY': 1,
|
|
5
|
+
'QUARTERLY': 3,
|
|
6
|
+
'SEMI_ANNUAL': 5
|
|
7
|
+
};
|
|
8
|
+
return mapping[frequencyCode] || 6;
|
|
9
|
+
};
|
|
10
|
+
export const mapProductCode = (productCode) => {
|
|
11
|
+
const mapping = {
|
|
12
|
+
'SC_SC': 534,
|
|
13
|
+
'VI_VI_VIDA_IND_1': 120,
|
|
14
|
+
'OTRO_CODIGO': 0,
|
|
15
|
+
};
|
|
16
|
+
return mapping[productCode] || 404;
|
|
17
|
+
};
|
|
18
|
+
export const mapProvinceCode = (provinceCode) => {
|
|
19
|
+
const mapping = {
|
|
20
|
+
'BS_AS': 1,
|
|
21
|
+
'CABA': 2,
|
|
22
|
+
};
|
|
23
|
+
return mapping[provinceCode] || 0;
|
|
24
|
+
};
|
|
@@ -1,131 +1,128 @@
|
|
|
1
|
-
export const getBillingsParams = (i) => {
|
|
2
|
-
return {}
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return {
|
|
42
|
-
values,
|
|
43
|
-
total: values.length
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
export const getDebtorsResponse = (data) => {
|
|
47
|
-
const values = data.paymentsEndorsement
|
|
48
|
-
.flatMap((endorsement, index) => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return endorsement.payments.map((payment, pIndex) => ({
|
|
93
|
-
code: `${index + 1}-${pIndex + 1}`,
|
|
94
|
-
amount: payment.amount,
|
|
95
|
-
applyAmount: payment.debt,
|
|
96
|
-
collectionDate: payment.paymentDate,
|
|
97
|
-
collectionNumber: payment.installmentNumber,
|
|
98
|
-
currency: {
|
|
99
|
-
name: "Peso Argentino",
|
|
100
|
-
code: "PESO_ARG",
|
|
101
|
-
mnemonic: "ARS",
|
|
102
|
-
symbol: "$"
|
|
103
|
-
},
|
|
104
|
-
name: "Sin nombre del pagador",
|
|
105
|
-
paymentType: null,
|
|
106
|
-
policy: {},
|
|
107
|
-
status: {},
|
|
108
|
-
invoiceBarcode: payment.invoiceBarcode || null,
|
|
109
|
-
rejectionReason: payment.rejectionReason || null,
|
|
110
|
-
expirationDate: payment.expirationDate || null,
|
|
111
|
-
}));
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
values
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
]
|
|
130
|
-
}
|
|
131
|
-
}
|
|
1
|
+
export const getBillingsParams = (i) => {
|
|
2
|
+
return {};
|
|
3
|
+
};
|
|
4
|
+
export const getBillingsResponse = (data) => {
|
|
5
|
+
const values = data.paymentsEndorsement.flatMap((endorsement, index) => {
|
|
6
|
+
return endorsement.payments.map((payment, pIndex) => {
|
|
7
|
+
var _a;
|
|
8
|
+
return ({
|
|
9
|
+
id: `${index + 1}-${pIndex + 1}`, // No tiene ID propio, uso el index + 1
|
|
10
|
+
code: `${index + 1}-${pIndex + 1}`, // No tiene código propio, uso el index + 1
|
|
11
|
+
billingNumber: payment.installmentNumber,
|
|
12
|
+
billingDate: payment.paymentDate,
|
|
13
|
+
billingExpirationDate: (_a = payment.expiration) !== null && _a !== void 0 ? _a : payment.expirationDate,
|
|
14
|
+
totalAmount: payment.amount,
|
|
15
|
+
remainingAmount: payment.debt,
|
|
16
|
+
paymentStatus: {
|
|
17
|
+
code: payment.amount < 0 ? "UNPAID" : "PAID", // ---- Si el monto es negativo esta pago???
|
|
18
|
+
name: payment.amount < 0 ? "Sin Pagar" : "Pagado" // ---- Si el monto es negativo esta pago???
|
|
19
|
+
},
|
|
20
|
+
status: {}, // ----- NO HAY STATUS
|
|
21
|
+
name: "Sin nombre del pagador", // ----- NO HAY NOMBRE DEL PAGADOR
|
|
22
|
+
policy: {}, // ----- NO HAY DATOS DE POLIZA
|
|
23
|
+
billingValuesGrouping: [
|
|
24
|
+
{
|
|
25
|
+
type: { name: "Prima", code: "PRIME" },
|
|
26
|
+
value: payment.amount // ----- SOLO LLEGA LA PRIMA
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
type: {
|
|
30
|
+
name: "Factura",
|
|
31
|
+
code: "INVOICE",
|
|
32
|
+
},
|
|
33
|
+
subtype: {},
|
|
34
|
+
exchangeRate: null,
|
|
35
|
+
billingDateFrom: "N/A",
|
|
36
|
+
billingDateTo: "N/A",
|
|
37
|
+
invoiceBarcode: payment.invoiceBarcode || null
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
values,
|
|
43
|
+
total: values.length
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export const getDebtorsResponse = (data) => {
|
|
47
|
+
const values = data.paymentsEndorsement
|
|
48
|
+
.flatMap((endorsement, index) => {
|
|
49
|
+
return endorsement.payments.map((payment, pIndex) => {
|
|
50
|
+
var _a;
|
|
51
|
+
return ({
|
|
52
|
+
id: `${index + 1}-${pIndex + 1}`,
|
|
53
|
+
code: `${index + 1}-${pIndex + 1}`,
|
|
54
|
+
billingNumber: payment.installmentNumber,
|
|
55
|
+
billingDate: payment.paymentDate,
|
|
56
|
+
billingExpirationDate: (_a = payment.expiration) !== null && _a !== void 0 ? _a : payment.expirationDate,
|
|
57
|
+
totalAmount: payment.amount,
|
|
58
|
+
remainingAmount: payment.debt,
|
|
59
|
+
paymentStatus: {
|
|
60
|
+
code: payment.debt < 0 ? "UNPAID" : "PAID",
|
|
61
|
+
name: payment.debt < 0 ? "Sin Pagar" : "Pagado"
|
|
62
|
+
},
|
|
63
|
+
status: {},
|
|
64
|
+
name: "Sin nombre del pagador",
|
|
65
|
+
policy: {},
|
|
66
|
+
billingValuesGrouping: [
|
|
67
|
+
{
|
|
68
|
+
type: { name: "Prima", code: "PRIME" },
|
|
69
|
+
value: payment.amount
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
type: {
|
|
73
|
+
name: "Factura",
|
|
74
|
+
code: "INVOICE",
|
|
75
|
+
},
|
|
76
|
+
subtype: {},
|
|
77
|
+
exchangeRate: null,
|
|
78
|
+
billingDateFrom: "N/A",
|
|
79
|
+
billingDateTo: "N/A",
|
|
80
|
+
invoiceBarcode: payment.invoiceBarcode || null
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
})
|
|
84
|
+
.filter(payment => (payment === null || payment === void 0 ? void 0 : payment.debt) > 0 || (payment === null || payment === void 0 ? void 0 : payment.remainingAmount) > 0);
|
|
85
|
+
return {
|
|
86
|
+
values,
|
|
87
|
+
total: values.length
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
export const getCollecionsResponse = (data) => {
|
|
91
|
+
const values = data.paymentsEndorsement.flatMap((endorsement, index) => {
|
|
92
|
+
return endorsement.payments.map((payment, pIndex) => ({
|
|
93
|
+
code: `${index + 1}-${pIndex + 1}`,
|
|
94
|
+
amount: payment.amount,
|
|
95
|
+
applyAmount: payment.debt,
|
|
96
|
+
collectionDate: payment.paymentDate,
|
|
97
|
+
collectionNumber: payment.installmentNumber,
|
|
98
|
+
currency: {
|
|
99
|
+
name: "Peso Argentino",
|
|
100
|
+
code: "PESO_ARG",
|
|
101
|
+
mnemonic: "ARS",
|
|
102
|
+
symbol: "$"
|
|
103
|
+
},
|
|
104
|
+
name: "Sin nombre del pagador",
|
|
105
|
+
paymentType: null,
|
|
106
|
+
policy: {},
|
|
107
|
+
status: {},
|
|
108
|
+
invoiceBarcode: payment.invoiceBarcode || null,
|
|
109
|
+
rejectionReason: payment.rejectionReason || null,
|
|
110
|
+
expirationDate: payment.expirationDate || null,
|
|
111
|
+
}));
|
|
112
|
+
});
|
|
113
|
+
return {
|
|
114
|
+
values,
|
|
115
|
+
total: values.length
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
export const getBillingTypeResponse = () => {
|
|
119
|
+
return {
|
|
120
|
+
types: [
|
|
121
|
+
{
|
|
122
|
+
name: "Factura",
|
|
123
|
+
code: "INVOICE",
|
|
124
|
+
operator: null
|
|
125
|
+
},
|
|
126
|
+
]
|
|
127
|
+
};
|
|
128
|
+
};
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const objectMapped = {
|
|
4
|
-
values: response
|
|
5
|
-
claimNumber: claim.claimNumber.toString(),
|
|
6
|
-
policyNumber: claim.policyNumber,
|
|
7
|
-
creationDate: claim.claimDate,
|
|
8
|
-
status: {
|
|
9
|
-
name: claim.status,
|
|
10
|
-
code: "N/A"
|
|
11
|
-
}
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return objectMapped;
|
|
17
|
-
}
|
|
1
|
+
export const getClaims_CNP = async (response) => {
|
|
2
|
+
var _a;
|
|
3
|
+
const objectMapped = {
|
|
4
|
+
values: (_a = response === null || response === void 0 ? void 0 : response.claims) === null || _a === void 0 ? void 0 : _a.map((claim) => ({
|
|
5
|
+
claimNumber: claim.claimNumber.toString(),
|
|
6
|
+
policyNumber: claim.policyNumber,
|
|
7
|
+
creationDate: claim.claimDate,
|
|
8
|
+
status: {
|
|
9
|
+
name: claim.status,
|
|
10
|
+
code: "N/A"
|
|
11
|
+
}
|
|
12
|
+
})),
|
|
13
|
+
};
|
|
14
|
+
return objectMapped;
|
|
15
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export const getModules = () => { }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
1
|
+
export const getModules = () => { };
|
|
2
|
+
export const getModules_Request = (params) => {
|
|
3
|
+
return {
|
|
4
|
+
roles: params.roles,
|
|
5
|
+
};
|
|
6
|
+
};
|
|
@@ -1,128 +1,119 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
deductibles: null,
|
|
121
|
-
requiredDeductible: null,
|
|
122
|
-
taxPlan: null,
|
|
123
|
-
wordings: []
|
|
124
|
-
}))
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return objectMapped;
|
|
128
|
-
}
|
|
1
|
+
export const getIdentificationTypes = async (response) => {
|
|
2
|
+
const objectMapped = {
|
|
3
|
+
values: response.types.map(a => ({
|
|
4
|
+
code: a.code,
|
|
5
|
+
name: a.name,
|
|
6
|
+
})),
|
|
7
|
+
};
|
|
8
|
+
return objectMapped;
|
|
9
|
+
};
|
|
10
|
+
export const getCountries = async (response) => {
|
|
11
|
+
const objectMapped = {
|
|
12
|
+
countries: response.countries.map(a => ({
|
|
13
|
+
code: a.code,
|
|
14
|
+
name: a.name,
|
|
15
|
+
areaCode: 'N/A'
|
|
16
|
+
})),
|
|
17
|
+
};
|
|
18
|
+
return objectMapped;
|
|
19
|
+
};
|
|
20
|
+
export const getProvinces = async (response) => {
|
|
21
|
+
const objectMapped = {
|
|
22
|
+
provinces: response.provinces.map(a => ({
|
|
23
|
+
name: a.name,
|
|
24
|
+
code: a.code,
|
|
25
|
+
country: {
|
|
26
|
+
code: a.country.code,
|
|
27
|
+
name: a.country.name,
|
|
28
|
+
areaCode: "N/A"
|
|
29
|
+
}
|
|
30
|
+
})),
|
|
31
|
+
};
|
|
32
|
+
return objectMapped;
|
|
33
|
+
};
|
|
34
|
+
export const getMaritalStatuses = async (response) => {
|
|
35
|
+
const objectMapped = {
|
|
36
|
+
values: response.statuses.map(a => ({
|
|
37
|
+
name: a.name,
|
|
38
|
+
code: a.code,
|
|
39
|
+
})),
|
|
40
|
+
};
|
|
41
|
+
return objectMapped;
|
|
42
|
+
};
|
|
43
|
+
export const getGenders = async (response) => {
|
|
44
|
+
const objectMapped = {
|
|
45
|
+
values: response.genders.map(a => ({
|
|
46
|
+
name: a.name,
|
|
47
|
+
code: a.code,
|
|
48
|
+
})),
|
|
49
|
+
};
|
|
50
|
+
return objectMapped;
|
|
51
|
+
};
|
|
52
|
+
export const getProductsBySubsections_Request = (params) => {
|
|
53
|
+
return {
|
|
54
|
+
subsectionCode: null
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export const partySearchParams = (params) => {
|
|
58
|
+
return {
|
|
59
|
+
firstName: params.firstName || params.name || null,
|
|
60
|
+
lastName: params.lastName || null,
|
|
61
|
+
identification: params.identificationValue || null,
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export const partySearch = (res) => {
|
|
65
|
+
var _a;
|
|
66
|
+
const objectMapped = {
|
|
67
|
+
values: (_a = res === null || res === void 0 ? void 0 : res.parties) === null || _a === void 0 ? void 0 : _a.map(party => {
|
|
68
|
+
var _a, _b, _c;
|
|
69
|
+
// Separación por doble espacio
|
|
70
|
+
const [lastNamePart, firstNamePart] = ((_a = party === null || party === void 0 ? void 0 : party.fullName) === null || _a === void 0 ? void 0 : _a.split(" ")) || [];
|
|
71
|
+
return {
|
|
72
|
+
activeDate: (party === null || party === void 0 ? void 0 : party.activeDate) || null,
|
|
73
|
+
partyCode: (party === null || party === void 0 ? void 0 : party.code) || null,
|
|
74
|
+
code: ((_b = party === null || party === void 0 ? void 0 : party.identification) === null || _b === void 0 ? void 0 : _b.value) || null,
|
|
75
|
+
firstName: firstNamePart || null,
|
|
76
|
+
lastName: lastNamePart || null,
|
|
77
|
+
identifications: {
|
|
78
|
+
values: [
|
|
79
|
+
{
|
|
80
|
+
default: true,
|
|
81
|
+
type: {
|
|
82
|
+
code: "",
|
|
83
|
+
name: "",
|
|
84
|
+
},
|
|
85
|
+
value: ((_c = party === null || party === void 0 ? void 0 : party.identification) === null || _c === void 0 ? void 0 : _c.value) || null,
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
birthDate: party === null || party === void 0 ? void 0 : party.birthDate,
|
|
90
|
+
insuredCode: party === null || party === void 0 ? void 0 : party.insuredCode
|
|
91
|
+
};
|
|
92
|
+
})
|
|
93
|
+
};
|
|
94
|
+
return objectMapped;
|
|
95
|
+
};
|
|
96
|
+
export const getCoverages = (p) => {
|
|
97
|
+
var _a;
|
|
98
|
+
const objectMapped = {
|
|
99
|
+
coverages: (_a = p.coverages) === null || _a === void 0 ? void 0 : _a.map(c => {
|
|
100
|
+
var _a, _b, _c;
|
|
101
|
+
return ({
|
|
102
|
+
calculatorTypes: [],
|
|
103
|
+
active: c.active,
|
|
104
|
+
coverage: {
|
|
105
|
+
code: (_a = c.coverage) === null || _a === void 0 ? void 0 : _a.code,
|
|
106
|
+
name: (_b = c.coverage) === null || _b === void 0 ? void 0 : _b.description,
|
|
107
|
+
description: (_c = c.coverage) === null || _c === void 0 ? void 0 : _c.name,
|
|
108
|
+
},
|
|
109
|
+
coverageValues: c.coverageValues,
|
|
110
|
+
type: c.type,
|
|
111
|
+
deductibles: null,
|
|
112
|
+
requiredDeductible: null,
|
|
113
|
+
taxPlan: null,
|
|
114
|
+
wordings: []
|
|
115
|
+
});
|
|
116
|
+
})
|
|
117
|
+
};
|
|
118
|
+
return objectMapped;
|
|
119
|
+
};
|