sysone-api-mapper 1.0.97 → 1.0.99
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
|
@@ -250,6 +250,15 @@ const partyModule = {
|
|
|
250
250
|
responseMapper: (response) => response.data,
|
|
251
251
|
},
|
|
252
252
|
},
|
|
253
|
+
GET_BRANCHES: {
|
|
254
|
+
cnp: {
|
|
255
|
+
url: 'party/v1/branches',
|
|
256
|
+
method: methods.GET,
|
|
257
|
+
source: "https://developers-test.cnp.com.ar/api-details#api=party-api&operation=get-v1-branches",
|
|
258
|
+
requestMapper: request => ({ mappedParams: request }),
|
|
259
|
+
responseMapper: (response) => response.data,
|
|
260
|
+
},
|
|
261
|
+
},
|
|
253
262
|
|
|
254
263
|
POST_AGE: {
|
|
255
264
|
default: {
|
|
@@ -78,6 +78,13 @@ const getEndorsements_Request = (inputParams) => {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
const getPolicies_CNP = async (response) => {
|
|
81
|
+
if (!response?.policies || response.policies.length === 0) {
|
|
82
|
+
return {
|
|
83
|
+
values: [],
|
|
84
|
+
total: 0
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
81
88
|
const objectMapped = {
|
|
82
89
|
values: response.policies.map((p) => ({
|
|
83
90
|
number: p.number,
|
|
@@ -102,7 +109,7 @@ const getPolicies_CNP = async (response) => {
|
|
|
102
109
|
code: "N/A",
|
|
103
110
|
alias: "N/A",
|
|
104
111
|
product: {
|
|
105
|
-
code: p.section?.code
|
|
112
|
+
code: p.section?.code?.toString() || null,
|
|
106
113
|
name: p.section?.name || null,
|
|
107
114
|
subsection: {
|
|
108
115
|
name: "N/A",
|
|
@@ -118,8 +125,9 @@ const getPolicies_CNP = async (response) => {
|
|
|
118
125
|
code: "N/A"
|
|
119
126
|
}
|
|
120
127
|
})),
|
|
121
|
-
total: response.totalRecord ||
|
|
128
|
+
total: response.totalRecord || 0,
|
|
122
129
|
};
|
|
130
|
+
|
|
123
131
|
return objectMapped;
|
|
124
132
|
}
|
|
125
133
|
|