sysone-api-mapper 1.0.102 → 1.0.103

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.102",
3
+ "version": "1.0.103",
4
4
  "description": "Paquete mapper para portal de productores",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -22,7 +22,8 @@ import {
22
22
  getPolicyDetail_CNP,
23
23
  getPolicyIndividualDetail_Request,
24
24
  getPolicyDetail_Request,
25
- postInsureds_CNP
25
+ postInsureds_CNP,
26
+ getPolicyCollection_Request
26
27
  } from "./modules/policy";
27
28
  import {
28
29
  getActivityList,
@@ -427,6 +428,21 @@ const policyModule = {
427
428
  },
428
429
  },
429
430
 
431
+ GET_COLLECTIONS: {
432
+ default: {
433
+ url: '/policy/v1/policies/{0}/collections',
434
+ method: methods.GET,
435
+ requestMapper: (request) => ({ mappedParams: request }),
436
+ responseMapper: (response) => response.data,
437
+ },
438
+ cnp: {
439
+ url: 'policy/v1/policy-individual/{0}/{1}/detail',
440
+ method: methods.GET,
441
+ requestMapper: request => ({ mappedParams: getPolicyCollection_Request(request) }),
442
+ responseMapper: (response) => getPolicyCollection(response.data)
443
+ },
444
+ },
445
+
430
446
  GET_POLICY_HOME_COLLECTIVE_DETAIL: {
431
447
  default: {
432
448
  url: 'policy-home/v1/policies/{0}/details',
@@ -182,7 +182,6 @@ const getPolicyDetail_CNP = async (data) => {
182
182
  ]
183
183
  },
184
184
  collectionData: {
185
- paymentFrequency: '',
186
185
  paymentMethodData: {
187
186
  simpleMethodData: {
188
187
  number: data.paymentMethod.number,
@@ -275,6 +274,23 @@ const getPolicyDetail_CNP = async (data) => {
275
274
  return objectMapped;
276
275
  }
277
276
 
277
+ const getPolicyCollection = async (data) => {
278
+ const objectMapped = {
279
+ billingForm: {},
280
+ holderDistribution: null,
281
+ insuredDistribution: null,
282
+ paymentFrecuency: data.paymentMethod.periodicity,
283
+ paymentMethodData: {
284
+ simpleMethodData: {
285
+ number: data.paymentMethod.number,
286
+ type: data.paymentMethod.type,
287
+ }
288
+ },
289
+
290
+ }
291
+ return objectMapped;
292
+ }
293
+
278
294
  const getPolicyCollectiveDetail_CNP = async (response) => {
279
295
  const objectMapped = {
280
296
  policyData: {
@@ -533,6 +549,10 @@ const getPolicyDetail_Request = (inputParams) => {
533
549
  return {
534
550
  }
535
551
  }
552
+ const getPolicyCollection_Request = (inputParams) => {
553
+ return {
554
+ }
555
+ }
536
556
  const getPolicyCollectiveDetail_Request = (inputParams) => {
537
557
  return {
538
558
  }
@@ -555,6 +575,8 @@ export {
555
575
  getPolicyCollectiveDetail_CNP,
556
576
  getPolicyCollectiveDetail_Request,
557
577
  getPolicyIndividualDetail_Request,
578
+ getPolicyCollection_Request,
558
579
  getEndorsements_Request,
559
- getPolicyDetail_Request
580
+ getPolicyDetail_Request,
581
+ getPolicyCollection
560
582
  }