sysone-api-mapper 1.0.113 → 1.0.115

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.113",
3
+ "version": "1.0.115",
4
4
  "description": "Paquete mapper para portal de productores",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -113,6 +113,12 @@ export const apiMapper = async (
113
113
  throw new Error(`Endpoint no configurado: ${endpointCode}`);
114
114
 
115
115
  const endpointData = configData[tenant] ?? configData.default;
116
+
117
+ if (endpointData === null) {
118
+ console.warn(`⚠️ No hay configuración para el endpoint ${endpointCode} y tenant ${tenant}, y no existe configuración por defecto.`);
119
+ throw new Error(`No hay configuración para el endpoint ${endpointCode} y tenant ${tenant}`);
120
+ }
121
+
116
122
  let config;
117
123
 
118
124
  if (!configs) {
@@ -1,5 +1,5 @@
1
1
  // Import modules organized by functionality
2
- import { getBillingsParams } from "./modules/billing";
2
+ import { getBillingsParams, getBillingsResponse } from "./modules/billing";
3
3
  import { getClaims_CNP } from "./modules/claim";
4
4
  import { getModules, getModules_Request } from "./modules/general";
5
5
  import {
@@ -93,10 +93,20 @@ const billingModule = {
93
93
  url: 'policy/v1/policy/{0}/{1}/payments',
94
94
  method: methods.GET,
95
95
  requestMapper: request => ({ mappedParams: getBillingsParams(request) }),
96
+ responseMapper: (response) => getBillingsResponse(response.data),
97
+ },
98
+ },
99
+
100
+ GET_BILLING_TYPE: {
101
+ default: {
102
+ url: 'billing/v1/billing-types',
103
+ method: methods.GET,
104
+ requestMapper: (request) => ({ mappedParams: request }),
96
105
  responseMapper: (response) => response.data,
97
106
  },
107
+ cnp: null
98
108
  },
99
- }
109
+ };
100
110
 
101
111
  // ============================================================================
102
112
  // INTERMEDIARY MODULE
@@ -435,7 +435,7 @@ export const getProductsBySubsections = async (response) => {
435
435
  code: item.code,
436
436
  version: item.version,
437
437
  subsection: item?.subsection || null,
438
- fieldExclusions: item?.fieldExclusions || null,
438
+ fieldExclusions: item?.exclusions || null,
439
439
  fields: item?.fieldValues || item?.fields || null
440
440
  })),
441
441
  };