sysone-api-mapper 1.0.122 → 1.0.123

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.122",
3
+ "version": "1.0.123",
4
4
  "description": "Paquete mapper para portal de productores",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -9,7 +9,8 @@ import {
9
9
  getIdentificationTypes,
10
10
  getMaritalStatuses,
11
11
  getProductsBySubsections_Request,
12
- getProvinces
12
+ getProvinces,
13
+ partySearchParams
13
14
  } from "./modules/party";
14
15
  import {
15
16
  getEndorsements_CNP,
@@ -338,6 +339,23 @@ const partyModule = {
338
339
  },
339
340
  },
340
341
 
342
+ GET_PARTIES: {
343
+ default: {
344
+ url: 'party/v1/individuals',
345
+ method: methods.GET,
346
+ source: "https://apidoc.sysone.com/party/v1/open-api.html#/paths/~1v1~1individuals/get",
347
+ requestMapper: (request) => ({ mappedParams: request }),
348
+ responseMapper: (response) => response.data,
349
+ },
350
+ cnp: {
351
+ url: 'party/v1/parties',
352
+ method: methods.GET,
353
+ source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-parties",
354
+ requestMapper: request => ({ mappedParams: partySearchParams(request) }),
355
+ responseMapper: (response) => response.data,
356
+ },
357
+ },
358
+
341
359
  POST_AGE: {
342
360
  default: {
343
361
  url: '',
@@ -62,7 +62,13 @@ export const getProductsBySubsections_Request = (params) => {
62
62
  }
63
63
  }
64
64
 
65
-
65
+ export const partySearchParams = (params) => {
66
+ return {
67
+ firstName: params.firstName || null,
68
+ lastName: params.lastName || null,
69
+ identification: params.identificationValue || null,
70
+ }
71
+ }
66
72
 
67
73
  export const getCoverages = (p) => {
68
74
  const objectMapped = {
@@ -136,9 +136,9 @@ const getPolicies_CNP_Request = (inputParams) => {
136
136
  pageSize: inputParams.pageSize || 10,
137
137
  allPolicies: null,
138
138
  policyNumber: inputParams.number,
139
- holderName: inputParams["name[firstName]"],
139
+ holderName: inputParams.holderName,
140
140
  holderIdentification: inputParams.holderIdentification,
141
- insuredName: inputParams.insuredName,
141
+ insuredName: inputParams["name[firstName]"],
142
142
  insuredIdentification: inputParams.insuredIdentification,
143
143
  requestNumber: inputParams.requestNumber,
144
144
  }