sysone-api-mapper 1.0.31 → 1.0.33
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,9 +1,9 @@
|
|
|
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, getProvinces } from "./modules/party";
|
|
4
|
+
import { getCountries, getIdentificationTypes, getMaritalStatuses, getProvinces } from "./modules/party";
|
|
5
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";
|
|
6
|
-
import { getActivityList, getQuotationByCode, getQuotationByCode_Request, getQuotations_Request, getQuotationsList, quotationStandardPlanCreationMapped, quotationVariablePlanCreationMapped } from "./modules/quotation";
|
|
6
|
+
import { getActivityList, getPaymentFrecuencies, getProductsBySubsections, getQuotationByCode, getQuotationByCode_Request, getQuotations_Request, getQuotationsList, quotationStandardPlanCreationMapped, quotationVariablePlanCreationMapped } from "./modules/quotation";
|
|
7
7
|
|
|
8
8
|
export const methods = {
|
|
9
9
|
GET: "GET",
|
|
@@ -35,7 +35,7 @@ export const tenantsConfig = {
|
|
|
35
35
|
|
|
36
36
|
GET_IDENTIFICATION_TYPES: {
|
|
37
37
|
default: {
|
|
38
|
-
url: 'party/v1/
|
|
38
|
+
url: 'party/v1/identification-types',
|
|
39
39
|
method: methods.GET,
|
|
40
40
|
source: 'https://apidoc.sysone.com/party/v1/open-api.html#/paths/~1v1~1identification-types/get',
|
|
41
41
|
requestMapper: (request) => ({ mappedParams: request }),
|
|
@@ -109,13 +109,82 @@ export const tenantsConfig = {
|
|
|
109
109
|
responseMapper: (response) => response,
|
|
110
110
|
},
|
|
111
111
|
cnp: {
|
|
112
|
-
url: '
|
|
112
|
+
url: 'party/v1/activities',
|
|
113
113
|
method: methods.GET,
|
|
114
114
|
source: "https://developers-test.cnp.com.ar/api-details#api=quotation-api&operation=get-v1-activity",
|
|
115
115
|
requestMapper: request => ({ mappedParams: request }),
|
|
116
116
|
responseMapper: (response) => getActivityList(response),
|
|
117
117
|
},
|
|
118
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
|
+
GET_PRODUCTS_BY_SUBSECTIONS: {
|
|
129
|
+
default: {
|
|
130
|
+
url: 'product/v1/subsections/{0}/products',
|
|
131
|
+
method: methods.GET,
|
|
132
|
+
source: 'https://apidoc.sysone.com/product/v1/open-api.html#/paths/~1v1~1subsections~1%7Bcode%7D~1products/get',
|
|
133
|
+
requestMapper: (request) => ({ mappedParams: request }),
|
|
134
|
+
responseMapper: (response) => response,
|
|
135
|
+
},
|
|
136
|
+
cnp: {
|
|
137
|
+
url: 'party/v1/subsections/{0}/products',
|
|
138
|
+
method: methods.GET,
|
|
139
|
+
source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-subsections-code-products",
|
|
140
|
+
requestMapper: request => ({ mappedParams: request }),
|
|
141
|
+
responseMapper: (response) => getProductsBySubsections(response),
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
GET_MONETARY_GOALS: {
|
|
145
|
+
cnp: {
|
|
146
|
+
url: 'party/v1/monetary-goals',
|
|
147
|
+
method: methods.GET,
|
|
148
|
+
source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-monetary-goals",
|
|
149
|
+
requestMapper: request => ({ mappedParams: request }),
|
|
150
|
+
responseMapper: (response) => response,
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
GET_PAYMENT_FRECUENCIES: {
|
|
154
|
+
default: {
|
|
155
|
+
url: 'quotation/v1/payment-frequencies',
|
|
156
|
+
method: methods.GET,
|
|
157
|
+
requestMapper: (request) => ({ mappedParams: request }),
|
|
158
|
+
responseMapper: (response) => response,
|
|
159
|
+
},
|
|
160
|
+
cnp: {
|
|
161
|
+
url: 'party/v1/payment-frequencies',
|
|
162
|
+
method: methods.GET,
|
|
163
|
+
source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-payment-frequencies",
|
|
164
|
+
requestMapper: request => ({ mappedParams: request }),
|
|
165
|
+
responseMapper: (response) => getPaymentFrecuencies(response),
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
GET_SAVINGS_DISTRIBUTION: {
|
|
169
|
+
cnp: {
|
|
170
|
+
url: 'party/v1/products/{0}/savings-distribution',
|
|
171
|
+
method: methods.GET,
|
|
172
|
+
source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-products-code-savings-distribution-goalcode-goalcode-goalamount-goala",
|
|
173
|
+
requestMapper: request => ({ mappedParams: request }),
|
|
174
|
+
responseMapper: (response) => response,
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
GET_SAVINGS_DISTRIBUTION: {
|
|
178
|
+
cnp: {
|
|
179
|
+
url: 'party/v1/quotation-benefits',
|
|
180
|
+
method: methods.GET,
|
|
181
|
+
source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-quotation-benefits",
|
|
182
|
+
requestMapper: request => ({ mappedParams: request }),
|
|
183
|
+
responseMapper: (response) => response,
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
//------------------------------------------------
|
|
119
188
|
GET_CLAIMS: {
|
|
120
189
|
default: {
|
|
121
190
|
url: 'claim/v1/claims',
|
|
@@ -335,6 +404,22 @@ export const tenantsConfig = {
|
|
|
335
404
|
responseMapper: (response) => response,
|
|
336
405
|
}
|
|
337
406
|
},
|
|
407
|
+
POST_AGE: {
|
|
408
|
+
default: {
|
|
409
|
+
url: '',
|
|
410
|
+
method: methods.POST,
|
|
411
|
+
source: '',
|
|
412
|
+
requestMapper: (params) => ({ mappedBody: params }),
|
|
413
|
+
responseMapper: (response) => response,
|
|
414
|
+
},
|
|
415
|
+
cnp: {
|
|
416
|
+
url: 'party/v1/age',
|
|
417
|
+
method: methods.POST,
|
|
418
|
+
source: 'https://developers-test.cnp.com.ar/api-details#api=party-api&operation=post-v1-age',
|
|
419
|
+
requestMapper: (params) => ({ mappedBody: params }),
|
|
420
|
+
responseMapper: (response) => response,
|
|
421
|
+
}
|
|
422
|
+
},
|
|
338
423
|
|
|
339
424
|
//------------- PUT ------------------------------
|
|
340
425
|
CREATE_INSURED: {
|
|
@@ -269,4 +269,27 @@ export const getActivityList = async (response) => {
|
|
|
269
269
|
})),
|
|
270
270
|
}
|
|
271
271
|
return objectMapped;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export const getProductsBySubsections = async (response) => {
|
|
275
|
+
const objectMapped = {
|
|
276
|
+
values: response.products.map(a => ({
|
|
277
|
+
name: a.name,
|
|
278
|
+
code: a.code,
|
|
279
|
+
version: a.version,
|
|
280
|
+
subsection: a?.subsection || null
|
|
281
|
+
})),
|
|
282
|
+
}
|
|
283
|
+
return objectMapped;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export const getPaymentFrecuencies = async (response) => {
|
|
287
|
+
const objectMapped = {
|
|
288
|
+
frequencies: response.frequencies.map(a => ({
|
|
289
|
+
name: a.name,
|
|
290
|
+
code: a.code,
|
|
291
|
+
months: a.months
|
|
292
|
+
})),
|
|
293
|
+
}
|
|
294
|
+
return objectMapped;
|
|
272
295
|
}
|