sysone-api-mapper 1.0.54 → 1.0.55

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