sysone-api-mapper 1.0.120 → 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.120",
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,
@@ -402,6 +403,16 @@ const productModule = {
402
403
  },
403
404
  },
404
405
 
406
+ GET_PRODUCT_PARAMETERS: {
407
+ cnp: {
408
+ url: `party/v1/products/{0}`,
409
+ method: methods.GET,
410
+ requestMapper: request => ({ mappedParams: request }),
411
+ responseMapper: (response) => getProductParameters(response.data),
412
+ }
413
+ },
414
+
415
+
405
416
  GET_MONETARY_GOALS: {
406
417
  cnp: {
407
418
  url: 'party/v1/products/{0}/monetary-goals',
@@ -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 => ({