sysone-api-mapper 1.0.121 → 1.0.122

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.121",
3
+ "version": "1.0.122",
4
4
  "description": "Paquete mapper para portal de productores",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -30,6 +30,7 @@ import {
30
30
  import {
31
31
  getActivityList,
32
32
  getPaymentFrecuencies,
33
+ getProductParameters,
33
34
  getProductsBySubsections,
34
35
  getQuotationByCode,
35
36
  getQuotationByCode_Request,
@@ -407,7 +408,7 @@ const productModule = {
407
408
  url: `party/v1/products/{0}`,
408
409
  method: methods.GET,
409
410
  requestMapper: request => ({ mappedParams: request }),
410
- responseMapper: (response) => response.data,
411
+ responseMapper: (response) => getProductParameters(response.data),
411
412
  }
412
413
  },
413
414
 
@@ -442,6 +442,20 @@ export const getProductsBySubsections = async (response) => {
442
442
  return objectMapped;
443
443
  };
444
444
 
445
+ export const getProductParameters = async (item) => {
446
+
447
+ const objectMapped = {
448
+ name: item.name,
449
+ code: item.code,
450
+ version: item.version,
451
+ subsection: item?.subsection || null,
452
+ fieldExclusions: item?.exclusions || null,
453
+ fields: item?.fields || null
454
+ }
455
+ return objectMapped;
456
+ }
457
+
458
+
445
459
  export const getPaymentFrecuencies = async (response) => {
446
460
  const objectMapped = {
447
461
  frequencies: response.frequencies.map(a => ({