sysone-api-mapper 1.0.54 → 1.0.56

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,6 @@
1
1
  {
2
2
  "name": "sysone-api-mapper",
3
- "version": "1.0.54",
3
+ "version": "1.0.56",
4
4
  "description": "Paquete mapper para portal de productores",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,9 +1,39 @@
1
- // import { methods } from "./mapper";
1
+ // Import modules organized by functionality
2
2
  import { getClaims_CNP } from "./modules/claim";
3
3
  import { getModules, getModules_Request } from "./modules/general";
4
- import { getCountries, getGenders, getIdentificationTypes, getMaritalStatuses, getProductsBySubsections_Request, getProvinces } from "./modules/party";
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, getPaymentFrecuencies, getProductsBySubsections, getQuotationByCode, getQuotationByCode_Request, getQuotationDetail, getQuotations_Request, getQuotationsList, quotationStandardPlanCreationMapped, quotationVariablePlanCreationMapped } from "./modules/quotation";
4
+ import {
5
+ getCountries,
6
+ getGenders,
7
+ getIdentificationTypes,
8
+ getMaritalStatuses,
9
+ getProductsBySubsections_Request,
10
+ getProvinces
11
+ } from "./modules/party";
12
+ import {
13
+ getEndorsements_CNP,
14
+ getEndorsements_Request,
15
+ getInsureds_CNP,
16
+ getInsureds_CNP_Request,
17
+ getPolicies_CNP,
18
+ getPolicies_CNP_Request,
19
+ getPolicyCollectiveDetail_CNP,
20
+ getPolicyCollectiveDetail_Request,
21
+ getPolicyDetail_CNP,
22
+ getPolicyIndividualDetail_Request,
23
+ postInsureds_CNP
24
+ } from "./modules/policy";
25
+ import {
26
+ getActivityList,
27
+ getPaymentFrecuencies,
28
+ getProductsBySubsections,
29
+ getQuotationByCode,
30
+ getQuotationByCode_Request,
31
+ getQuotationDetail,
32
+ getQuotations_Request,
33
+ getQuotationsList,
34
+ quotationStandardPlanCreationMapped,
35
+ quotationVariablePlanCreationMapped
36
+ } from "./modules/quotation";
7
37
 
8
38
  export const methods = {
9
39
  GET: "GET",
@@ -11,9 +41,11 @@ export const methods = {
11
41
  PUT: "PUT",
12
42
  DELETE: "DELETE",
13
43
  };
14
- export const tenantsConfig = {
15
- // ------------ GET ------------------------------
16
- //------------ CONFIGS ---------------------------
44
+
45
+ // ============================================================================
46
+ // CONFIGURATION MODULE
47
+ // ============================================================================
48
+ const configurationModule = {
17
49
  GET_MODULES: {
18
50
  default: {
19
51
  url: 'ui-configuration/v1/platforms/link-one/modules',
@@ -28,11 +60,43 @@ export const tenantsConfig = {
28
60
  responseMapper: (response) => response,
29
61
  },
30
62
  },
63
+ };
31
64
 
32
- //------------------------------------------------
33
-
34
- //------------ PARTY ---------------------------
65
+ // ============================================================================
66
+ // INTERMEDIARY MODULE
67
+ // ============================================================================
68
+ const intermediaryModule = {
69
+ GET_INTERMEDIARY_STRUCTURE: {
70
+ default: {
71
+ url: 'intermediary/v1/intermediary/{0}/commercial-structures',
72
+ method: methods.GET,
73
+ requestMapper: (request) => ({ mappedParams: request }),
74
+ responseMapper: (response) => response,
75
+ },
76
+ restrictedTenants: ['cnp']
77
+ },
78
+ GET_INTERMEDIARY_BY_CODE: {
79
+ default: {
80
+ url: 'intermediary/v1/intermediary/{0}',
81
+ method: methods.GET,
82
+ requestMapper: (request) => ({ mappedParams: request }),
83
+ responseMapper: (response) => response,
84
+ }
85
+ },
86
+ GET_COMMERCIAL_STRUCTURE: {
87
+ default: {
88
+ url: 'intermediary/v1/commercial-structures',
89
+ method: methods.GET,
90
+ requestMapper: (request) => ({ mappedParams: request }),
91
+ responseMapper: (response) => response,
92
+ }
93
+ }
94
+ };
35
95
 
96
+ // ============================================================================
97
+ // PARTY MODULE
98
+ // ============================================================================
99
+ const partyModule = {
36
100
  GET_CURRENCIES: {
37
101
  default: {
38
102
  url: 'finance/v1/currencies',
@@ -48,6 +112,7 @@ export const tenantsConfig = {
48
112
  responseMapper: (response) => response,
49
113
  },
50
114
  },
115
+
51
116
  GET_GENDERS: {
52
117
  default: {
53
118
  url: 'party/v1/genders',
@@ -63,24 +128,7 @@ export const tenantsConfig = {
63
128
  responseMapper: (response) => getGenders(response),
64
129
  },
65
130
  },
66
- GET_COVERAGES: {
67
- cnp: {
68
- url: 'party/v1/products/{0}/coverages',
69
- method: methods.GET,
70
- source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-products-code-coverages-currencycode-currencycode-smoker-smoker",
71
- requestMapper: request => ({ mappedParams: request }),
72
- responseMapper: (response) => response,
73
- },
74
- },
75
- GET_DISTRIBUTION_LIMITS: {
76
- cnp: {
77
- url: 'party/v1/products/{0}/savings-distribution',
78
- method: methods.GET,
79
- source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-products-code-coverages-currencycode-currencycode-smoker-smoker",
80
- requestMapper: request => ({ mappedParams: request }),
81
- responseMapper: (response) => response,
82
- },
83
- },
131
+
84
132
  GET_IDENTIFICATION_TYPES: {
85
133
  default: {
86
134
  url: 'party/v1/identification-types',
@@ -97,6 +145,7 @@ export const tenantsConfig = {
97
145
  responseMapper: (response) => getIdentificationTypes(response),
98
146
  },
99
147
  },
148
+
100
149
  GET_COUNTRIES: {
101
150
  default: {
102
151
  url: 'location/v1/countries',
@@ -164,6 +213,7 @@ export const tenantsConfig = {
164
213
  responseMapper: (response) => getActivityList(response),
165
214
  },
166
215
  },
216
+
167
217
  GET_BLOOD_PRESSURES: {
168
218
  cnp: {
169
219
  url: 'party/v1/blood-pressures',
@@ -173,46 +223,92 @@ export const tenantsConfig = {
173
223
  responseMapper: (response) => response
174
224
  },
175
225
  },
176
- GET_PRODUCTS_BY_SUBSECTIONS: {
226
+
227
+ GET_PAYMENT_FRECUENCIES: {
177
228
  default: {
178
- url: 'product/v1/products',
229
+ url: 'quotation/v1/payment-frequencies',
179
230
  method: methods.GET,
180
- source: 'https://apidoc.sysone.com/product/v1/open-api.html#/paths/~1v1~1products/get',
181
231
  requestMapper: (request) => ({ mappedParams: request }),
182
232
  responseMapper: (response) => response,
183
233
  },
184
234
  cnp: {
185
- url: 'party/v1/subsections/{0}/products',
235
+ url: 'party/v1/payment-frequencies',
186
236
  method: methods.GET,
187
- source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-subsections-code-products",
188
- requestMapper: request => ({ mappedParams: getProductsBySubsections_Request(request) }),
189
- responseMapper: (response) => getProductsBySubsections(response),
237
+ source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-payment-frequencies",
238
+ requestMapper: request => ({ mappedParams: request }),
239
+ responseMapper: (response) => getPaymentFrecuencies(response),
190
240
  },
191
241
  },
192
- GET_MONETARY_GOALS: {
242
+
243
+ POST_AGE: {
244
+ default: {
245
+ url: '',
246
+ method: methods.POST,
247
+ source: '',
248
+ requestMapper: (params) => ({ mappedBody: params }),
249
+ responseMapper: (response) => response,
250
+ },
193
251
  cnp: {
194
- url: 'party/v1/products/{0}/monetary-goals',
252
+ url: 'party/v1/age',
253
+ method: methods.POST,
254
+ source: 'https://developers-test.cnp.com.ar/api-details#api=party-api&operation=post-v1-age',
255
+ requestMapper: (params) => ({ mappedBody: params }),
256
+ responseMapper: (response) => response,
257
+ }
258
+ },
259
+ };
260
+
261
+ // ============================================================================
262
+ // PRODUCT MODULE
263
+ // ============================================================================
264
+ const productModule = {
265
+ GET_COVERAGES: {
266
+ cnp: {
267
+ url: 'party/v1/products/{0}/coverages',
195
268
  method: methods.GET,
196
- source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-monetary-goals",
269
+ source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-products-code-coverages-currencycode-currencycode-smoker-smoker",
197
270
  requestMapper: request => ({ mappedParams: request }),
198
271
  responseMapper: (response) => response,
199
272
  },
200
273
  },
201
- GET_PAYMENT_FRECUENCIES: {
274
+
275
+ GET_DISTRIBUTION_LIMITS: {
276
+ cnp: {
277
+ url: 'party/v1/products/{0}/savings-distribution',
278
+ method: methods.GET,
279
+ source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-products-code-coverages-currencycode-currencycode-smoker-smoker",
280
+ requestMapper: request => ({ mappedParams: request }),
281
+ responseMapper: (response) => response,
282
+ },
283
+ },
284
+
285
+ GET_PRODUCTS_BY_SUBSECTIONS: {
202
286
  default: {
203
- url: 'quotation/v1/payment-frequencies',
287
+ url: 'product/v1/products',
204
288
  method: methods.GET,
289
+ source: 'https://apidoc.sysone.com/product/v1/open-api.html#/paths/~1v1~1products/get',
205
290
  requestMapper: (request) => ({ mappedParams: request }),
206
291
  responseMapper: (response) => response,
207
292
  },
208
293
  cnp: {
209
- url: 'party/v1/payment-frequencies',
294
+ url: 'party/v1/subsections/{0}/products',
210
295
  method: methods.GET,
211
- source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-payment-frequencies",
296
+ source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-subsections-code-products",
297
+ requestMapper: request => ({ mappedParams: getProductsBySubsections_Request(request) }),
298
+ responseMapper: (response) => getProductsBySubsections(response),
299
+ },
300
+ },
301
+
302
+ GET_MONETARY_GOALS: {
303
+ cnp: {
304
+ url: 'party/v1/products/{0}/monetary-goals',
305
+ method: methods.GET,
306
+ source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-monetary-goals",
212
307
  requestMapper: request => ({ mappedParams: request }),
213
- responseMapper: (response) => getPaymentFrecuencies(response),
308
+ responseMapper: (response) => response,
214
309
  },
215
310
  },
311
+
216
312
  GET_SAVINGS_DISTRIBUTION: {
217
313
  cnp: {
218
314
  url: 'party/v1/products/{0}/savings-distribution',
@@ -222,6 +318,7 @@ export const tenantsConfig = {
222
318
  responseMapper: (response) => response,
223
319
  },
224
320
  },
321
+
225
322
  GET_QUOTATION_BENEFITS: {
226
323
  cnp: {
227
324
  url: 'party/v1/quotation-benefits',
@@ -231,24 +328,12 @@ export const tenantsConfig = {
231
328
  responseMapper: (response) => response,
232
329
  },
233
330
  },
331
+ };
234
332
 
235
- //------------------------------------------------
236
- GET_CLAIMS: {
237
- default: {
238
- url: 'claim/v1/claims',
239
- method: methods.GET,
240
- source: 'https://apidoc.sysone.com/claim/v1/open-api.html',
241
- requestMapper: (request) => ({ mappedParams: request }),
242
- responseMapper: (response) => response,
243
- },
244
- cnp: {
245
- url: 'claim/v1/claim',
246
- method: methods.GET,
247
- source: "https://developers-test.cnp.com.ar/api-details#api=claim-api&operation=get-v1-claim-pagenumber-pagenumber-pagesize-pagesize",
248
- requestMapper: null,
249
- responseMapper: (response) => getClaims_CNP(response),
250
- },
251
- },
333
+ // ============================================================================
334
+ // POLICY MODULE
335
+ // ============================================================================
336
+ const policyModule = {
252
337
  GET_ENDORSEMENTS: {
253
338
  default: {
254
339
  url: 'policy/v1/policies/{0}/endorsements',
@@ -265,6 +350,7 @@ export const tenantsConfig = {
265
350
  responseMapper: (response) => getEndorsements_CNP(response),
266
351
  },
267
352
  },
353
+
268
354
  GET_INSUREDS: {
269
355
  default: {
270
356
  url: 'policy-life/v1/policies/{0}/insureds',
@@ -281,6 +367,7 @@ export const tenantsConfig = {
281
367
  responseMapper: (response) => getInsureds_CNP(response),
282
368
  },
283
369
  },
370
+
284
371
  GET_POLICIES: {
285
372
  default: {
286
373
  url: 'policy/v1/policies',
@@ -297,6 +384,7 @@ export const tenantsConfig = {
297
384
  responseMapper: (response) => getPolicies_CNP(response),
298
385
  },
299
386
  },
387
+
300
388
  GET_POLICY_HOME_COLLECTIVE_DETAIL: {
301
389
  default: {
302
390
  url: 'policy-home/v1/policies/{0}/details',
@@ -313,6 +401,7 @@ export const tenantsConfig = {
313
401
  responseMapper: (response) => getPolicyCollectiveDetail_CNP(response),
314
402
  },
315
403
  },
404
+
316
405
  GET_POLICY_HOME_INDIVIDUAL_DETAIL: {
317
406
  default: {
318
407
  url: 'policy-home/v1/policies/{0}/details',
@@ -329,6 +418,7 @@ export const tenantsConfig = {
329
418
  responseMapper: (response) => getPolicyDetail_CNP(response),
330
419
  },
331
420
  },
421
+
332
422
  GET_POLICY_LIFE_COLLECTIVE_DETAIL: {
333
423
  default: {
334
424
  url: 'policy-life/v1/policies/{0}/details',
@@ -345,6 +435,7 @@ export const tenantsConfig = {
345
435
  responseMapper: (response) => getPolicyCollectiveDetail_CNP(response),
346
436
  },
347
437
  },
438
+
348
439
  GET_POLICY_LIFE_INDIVIDUAL_DETAIL: {
349
440
  default: {
350
441
  url: 'policy-life/v1/policies/{0}/details',
@@ -361,7 +452,60 @@ export const tenantsConfig = {
361
452
  responseMapper: (response) => getPolicyDetail_CNP(response),
362
453
  },
363
454
  },
364
- //--------------------------------------- QUOTATION ------------------------------------------------------
455
+
456
+ GET_POLICY_STATUSES: {
457
+ default: {
458
+ url: 'policy/v1/policy-statuses',
459
+ method: methods.GET,
460
+ requestMapper: (request) => ({ mappedParams: request }),
461
+ responseMapper: (response) => response,
462
+ },
463
+ },
464
+
465
+ POST_INSURED_UPDATE: {
466
+ default: {
467
+ url: 'policy-life/v1/policies/{0}/insureds',
468
+ method: methods.POST,
469
+ requestMapper: null,
470
+ source: 'https://apidoc.sysone.com/policy-life/v1/open-api.html#/paths/~1v1~1policies~1%7Bcode%7D~1insureds/post',
471
+ responseMapper: (response) => response,
472
+ },
473
+ cnp: {
474
+ url: 'v1/policy-collective/{0}/{1}/insureds',
475
+ method: methods.POST,
476
+ requestMapper: null,
477
+ source: 'https://developers-test.cnp.com.ar/api-details#api=policy-api&operation=post-v1-policy-collective-policy-number-section-code-insureds',
478
+ responseMapper: (response) => postInsureds_CNP(response),
479
+ },
480
+ },
481
+ };
482
+
483
+ // ============================================================================
484
+ // CLAIM MODULE
485
+ // ============================================================================
486
+ const claimModule = {
487
+ GET_CLAIMS: {
488
+ default: {
489
+ url: 'claim/v1/claims',
490
+ method: methods.GET,
491
+ source: 'https://apidoc.sysone.com/claim/v1/open-api.html',
492
+ requestMapper: (request) => ({ mappedParams: request }),
493
+ responseMapper: (response) => response,
494
+ },
495
+ cnp: {
496
+ url: 'claim/v1/claim',
497
+ method: methods.GET,
498
+ source: "https://developers-test.cnp.com.ar/api-details#api=claim-api&operation=get-v1-claim-pagenumber-pagenumber-pagesize-pagesize",
499
+ requestMapper: null,
500
+ responseMapper: (response) => getClaims_CNP(response),
501
+ },
502
+ },
503
+ };
504
+
505
+ // ============================================================================
506
+ // QUOTATION MODULE
507
+ // ============================================================================
508
+ const quotationModule = {
365
509
  GET_QUOTATION_BY_CODE: {
366
510
  default: {
367
511
  url: 'quotation/v1/quotations/{0}',
@@ -378,6 +522,7 @@ export const tenantsConfig = {
378
522
  responseMapper: (response) => getQuotationByCode(response)
379
523
  }
380
524
  },
525
+
381
526
  GET_QUOTATIONS: {
382
527
  default: {
383
528
  url: 'quotation/v1/quotations',
@@ -393,6 +538,7 @@ export const tenantsConfig = {
393
538
  responseMapper: (response) => getQuotationsList(response)
394
539
  }
395
540
  },
541
+
396
542
  GET_QUOTATION_DETAILS: {
397
543
  default: {
398
544
  url: '{0}/v1/quotations/{1}',
@@ -408,30 +554,13 @@ export const tenantsConfig = {
408
554
  }
409
555
  },
410
556
 
411
- //------------- POST -----------------------------
412
- POST_INSURED_UPDATE: {
413
- default: {
414
- url: 'policy-life/v1/policies/{0}/insureds',
415
- method: methods.POST,
416
- requestMapper: null,
417
- source: 'https://apidoc.sysone.com/policy-life/v1/open-api.html#/paths/~1v1~1policies~1%7Bcode%7D~1insureds/post',
418
- responseMapper: (response) => response,
419
- },
420
- cnp: {
421
- url: 'v1/policy-collective/{0}/{1}/insureds',
422
- method: methods.POST,
423
- requestMapper: null,
424
- source: 'https://developers-test.cnp.com.ar/api-details#api=policy-api&operation=post-v1-policy-collective-policy-number-section-code-insureds',
425
- responseMapper: (response) => postInsureds_CNP(response),
426
- },
427
- },
428
557
  POST_CREATE_QUOTATION_STANDARD_PLAN: {
429
558
  default: {
430
559
  url: 'quotation/v1/quotations',
431
560
  method: methods.POST,
432
561
  source: 'https://apidoc.sysone.com/quotation/v1/open-api.html#/paths/~1v1~1quotations/post',
433
562
  requestMapper: (params) => ({
434
- mappedBody: params // Mapeo directo para default
563
+ mappedBody: params
435
564
  }),
436
565
  responseMapper: (response) => response,
437
566
  },
@@ -445,6 +574,7 @@ export const tenantsConfig = {
445
574
  responseMapper: (response) => response,
446
575
  }
447
576
  },
577
+
448
578
  POST_CREATE_QUOTATION_VARIABLE_PLAN: {
449
579
  default: {
450
580
  url: 'quotation/v1/quotations',
@@ -465,22 +595,7 @@ export const tenantsConfig = {
465
595
  responseMapper: (response) => response,
466
596
  }
467
597
  },
468
- POST_AGE: {
469
- default: {
470
- url: '',
471
- method: methods.POST,
472
- source: '',
473
- requestMapper: (params) => ({ mappedBody: params }),
474
- responseMapper: (response) => response,
475
- },
476
- cnp: {
477
- url: 'party/v1/age',
478
- method: methods.POST,
479
- source: 'https://developers-test.cnp.com.ar/api-details#api=party-api&operation=post-v1-age',
480
- requestMapper: (params) => ({ mappedBody: params }),
481
- responseMapper: (response) => response,
482
- }
483
- },
598
+
484
599
  POST_CALCULATE_LS: {
485
600
  cnp: {
486
601
  url: 'quotation/v1/quotations/calculate',
@@ -498,10 +613,27 @@ export const tenantsConfig = {
498
613
  responseMapper: (response) => response,
499
614
  }
500
615
  },
616
+ };
501
617
 
502
- //------------- PUT ------------------------------
503
- CREATE_INSURED: {
504
618
 
505
- }
506
- }
619
+ // ============================================================================
620
+ // REQUEST MODULE
621
+ // ============================================================================
622
+ const requestModule = {
507
623
 
624
+ };
625
+
626
+
627
+ // ============================================================================
628
+ // MAIN CONFIGURATION EXPORT
629
+ // ============================================================================
630
+ export const tenantsConfig = {
631
+ ...configurationModule,
632
+ ...intermediaryModule,
633
+ ...partyModule,
634
+ ...productModule,
635
+ ...policyModule,
636
+ ...claimModule,
637
+ ...quotationModule,
638
+ ...requestModule,
639
+ };