sysone-api-mapper 1.0.115 → 1.0.116
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,5 +1,5 @@
|
|
|
1
1
|
// Import modules organized by functionality
|
|
2
|
-
import { getBillingsParams, getBillingsResponse } from "./modules/billing";
|
|
2
|
+
import { getBillingsParams, getBillingsResponse, getBillingTypeResponse } from "./modules/billing";
|
|
3
3
|
import { getClaims_CNP } from "./modules/claim";
|
|
4
4
|
import { getModules, getModules_Request } from "./modules/general";
|
|
5
5
|
import {
|
|
@@ -104,7 +104,12 @@ const billingModule = {
|
|
|
104
104
|
requestMapper: (request) => ({ mappedParams: request }),
|
|
105
105
|
responseMapper: (response) => response.data,
|
|
106
106
|
},
|
|
107
|
-
cnp:
|
|
107
|
+
cnp: {
|
|
108
|
+
url: 'billing/v1/billing-types',
|
|
109
|
+
method: methods.GET,
|
|
110
|
+
requestMapper: request => ({ mappedParams: request }),
|
|
111
|
+
responseMapper: (response) => getBillingTypeResponse(response.data),
|
|
112
|
+
},
|
|
108
113
|
},
|
|
109
114
|
};
|
|
110
115
|
|
|
@@ -3,7 +3,7 @@ export const getBillingsParams = (i) => {
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
export const getBillingsResponse = (data) => {
|
|
6
|
-
const values = data.paymentsEndorsement.
|
|
6
|
+
const values = data.paymentsEndorsement.flatMap((endorsement, index) => {
|
|
7
7
|
|
|
8
8
|
return endorsement.payments.map((payment, pIndex) => ({
|
|
9
9
|
id: `${index + 1}-${pIndex + 1}`, // No tiene ID propio, uso el index + 1
|
|
@@ -41,3 +41,15 @@ export const getBillingsResponse = (data) => {
|
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
+
|
|
45
|
+
export const getBillingTypeResponse = (data) => {
|
|
46
|
+
return {
|
|
47
|
+
types: [
|
|
48
|
+
{
|
|
49
|
+
name: "Factura",
|
|
50
|
+
code: "INVOICE",
|
|
51
|
+
operator: null
|
|
52
|
+
},
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
}
|