sysone-api-mapper 1.0.30 → 1.0.32
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/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// import { methods } from "./mapper";
|
|
2
2
|
import { getClaims_CNP } from "./modules/claim";
|
|
3
3
|
import { getModules, getModules_Request } from "./modules/general";
|
|
4
|
+
import { getCountries, getIdentificationTypes, getMaritalStatuses, getProvinces } from "./modules/party";
|
|
4
5
|
import { getEndorsements_CNP, getEndorsements_Request, getInsureds_CNP, getInsureds_CNP_Request, getPolicies_CNP, getPolicies_CNP_Request, getPolicyCollectiveDetail_CNP, getPolicyCollectiveDetail_Request, getPolicyDetail_CNP, getPolicyIndividualDetail_Request, postInsureds_CNP } from "./modules/policy";
|
|
5
6
|
import { getActivityList, getQuotationByCode, getQuotationByCode_Request, getQuotations_Request, getQuotationsList, quotationStandardPlanCreationMapped, quotationVariablePlanCreationMapped } from "./modules/quotation";
|
|
6
7
|
|
|
@@ -29,6 +30,76 @@ export const tenantsConfig = {
|
|
|
29
30
|
},
|
|
30
31
|
|
|
31
32
|
//------------------------------------------------
|
|
33
|
+
|
|
34
|
+
//------------ PARTY ---------------------------
|
|
35
|
+
|
|
36
|
+
GET_IDENTIFICATION_TYPES: {
|
|
37
|
+
default: {
|
|
38
|
+
url: 'party/v1/identification-types',
|
|
39
|
+
method: methods.GET,
|
|
40
|
+
source: 'https://apidoc.sysone.com/party/v1/open-api.html#/paths/~1v1~1identification-types/get',
|
|
41
|
+
requestMapper: (request) => ({ mappedParams: request }),
|
|
42
|
+
responseMapper: (response) => response,
|
|
43
|
+
},
|
|
44
|
+
cnp: {
|
|
45
|
+
url: 'party/v1/identification-types',
|
|
46
|
+
method: methods.GET,
|
|
47
|
+
source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-identification-types",
|
|
48
|
+
requestMapper: request => ({ mappedParams: request }),
|
|
49
|
+
responseMapper: (response) => getIdentificationTypes(response),
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
GET_COUNTRIES: {
|
|
53
|
+
default: {
|
|
54
|
+
url: 'location/v1/countries',
|
|
55
|
+
method: methods.GET,
|
|
56
|
+
source: 'https://apidoc.sysone.com/location/v1/open-api.html#/paths/~1v1~1countries/get',
|
|
57
|
+
requestMapper: (request) => ({ mappedParams: request }),
|
|
58
|
+
responseMapper: (response) => response,
|
|
59
|
+
},
|
|
60
|
+
cnp: {
|
|
61
|
+
url: 'party/v1/countries',
|
|
62
|
+
method: methods.GET,
|
|
63
|
+
source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-countries",
|
|
64
|
+
requestMapper: request => ({ mappedParams: request }),
|
|
65
|
+
responseMapper: (response) => getCountries(response),
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
GET_PROVINCES: {
|
|
70
|
+
default: {
|
|
71
|
+
url: 'location/v1/countries/{0}/provinces',
|
|
72
|
+
method: methods.GET,
|
|
73
|
+
source: 'https://apidoc.sysone.com/location/v1/open-api.html#/paths/~1v1~1countries/get',
|
|
74
|
+
requestMapper: (request) => ({ mappedParams: request }),
|
|
75
|
+
responseMapper: (response) => response,
|
|
76
|
+
},
|
|
77
|
+
cnp: {
|
|
78
|
+
url: 'party/v1/countries/{0}/provinces',
|
|
79
|
+
method: methods.GET,
|
|
80
|
+
source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-countries",
|
|
81
|
+
requestMapper: request => ({ mappedParams: request }),
|
|
82
|
+
responseMapper: (response) => getProvinces(response),
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
GET_MARITAL_STATUS: {
|
|
87
|
+
default: {
|
|
88
|
+
url: 'party/v1/marital-statuses',
|
|
89
|
+
method: methods.GET,
|
|
90
|
+
source: 'https://apidoc.sysone.com/party/v1/open-api.html#/paths/~1v1~1marital-statuses/get',
|
|
91
|
+
requestMapper: (request) => ({ mappedParams: request }),
|
|
92
|
+
responseMapper: (response) => response,
|
|
93
|
+
},
|
|
94
|
+
cnp: {
|
|
95
|
+
url: 'party/v1/marital-statuses',
|
|
96
|
+
method: methods.GET,
|
|
97
|
+
source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-marital-statuses",
|
|
98
|
+
requestMapper: request => ({ mappedParams: request }),
|
|
99
|
+
responseMapper: (response) => getMaritalStatuses(response),
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
|
|
32
103
|
GET_ACTIVITY: {
|
|
33
104
|
default: {
|
|
34
105
|
url: 'party/v1/sectors',
|
|
@@ -38,13 +109,24 @@ export const tenantsConfig = {
|
|
|
38
109
|
responseMapper: (response) => response,
|
|
39
110
|
},
|
|
40
111
|
cnp: {
|
|
41
|
-
url: '
|
|
112
|
+
url: 'party/v1/activities',
|
|
42
113
|
method: methods.GET,
|
|
43
114
|
source: "https://developers-test.cnp.com.ar/api-details#api=quotation-api&operation=get-v1-activity",
|
|
44
115
|
requestMapper: request => ({ mappedParams: request }),
|
|
45
116
|
responseMapper: (response) => getActivityList(response),
|
|
46
117
|
},
|
|
47
118
|
},
|
|
119
|
+
GET_BLOOD_PRESSURES: {
|
|
120
|
+
cnp: {
|
|
121
|
+
url: 'party/v1/blood-pressures',
|
|
122
|
+
method: methods.GET,
|
|
123
|
+
source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-blood-pressures",
|
|
124
|
+
requestMapper: request => ({ mappedParams: request }),
|
|
125
|
+
responseMapper: (response) => response
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
//------------------------------------------------
|
|
48
130
|
GET_CLAIMS: {
|
|
49
131
|
default: {
|
|
50
132
|
url: 'claim/v1/claims',
|
|
@@ -264,6 +346,22 @@ export const tenantsConfig = {
|
|
|
264
346
|
responseMapper: (response) => response,
|
|
265
347
|
}
|
|
266
348
|
},
|
|
349
|
+
POST_AGE: {
|
|
350
|
+
default: {
|
|
351
|
+
url: '',
|
|
352
|
+
method: methods.POST,
|
|
353
|
+
source: '',
|
|
354
|
+
requestMapper: (params) => ({ mappedBody: params }),
|
|
355
|
+
responseMapper: (response) => response,
|
|
356
|
+
},
|
|
357
|
+
cnp: {
|
|
358
|
+
url: 'party/v1/age',
|
|
359
|
+
method: methods.POST,
|
|
360
|
+
source: 'https://developers-test.cnp.com.ar/api-details#api=party-api&operation=post-v1-age',
|
|
361
|
+
requestMapper: (params) => ({ mappedBody: params }),
|
|
362
|
+
responseMapper: (response) => response,
|
|
363
|
+
}
|
|
364
|
+
},
|
|
267
365
|
|
|
268
366
|
//------------- PUT ------------------------------
|
|
269
367
|
CREATE_INSURED: {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export const getIdentificationTypes = async (response) => {
|
|
4
|
+
const objectMapped = {
|
|
5
|
+
values: response.types.map(a => ({
|
|
6
|
+
code: a.code,
|
|
7
|
+
name: a.name,
|
|
8
|
+
})),
|
|
9
|
+
}
|
|
10
|
+
return objectMapped;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const getCountries = async (response) => {
|
|
14
|
+
const objectMapped = {
|
|
15
|
+
countries: response.countries.map(a => ({
|
|
16
|
+
code: a.code,
|
|
17
|
+
name: a.name,
|
|
18
|
+
areaCode: 'N/A'
|
|
19
|
+
})),
|
|
20
|
+
}
|
|
21
|
+
return objectMapped;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const getProvinces = async (response) => {
|
|
25
|
+
const objectMapped = {
|
|
26
|
+
provinces: response.provinces.map(a => ({
|
|
27
|
+
name: a.name,
|
|
28
|
+
code: a.code,
|
|
29
|
+
country: {
|
|
30
|
+
code: a.country.code,
|
|
31
|
+
name: a.country.name,
|
|
32
|
+
areaCode: "N/A"
|
|
33
|
+
}
|
|
34
|
+
})),
|
|
35
|
+
}
|
|
36
|
+
return objectMapped;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const getMaritalStatuses = async (response) => {
|
|
40
|
+
const objectMapped = {
|
|
41
|
+
values: response.statuses.map(a => ({
|
|
42
|
+
name: a.name,
|
|
43
|
+
code: a.code,
|
|
44
|
+
})),
|
|
45
|
+
}
|
|
46
|
+
return objectMapped;
|
|
47
|
+
}
|