sysone-api-mapper 1.0.70 → 1.0.72

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.70",
3
+ "version": "1.0.72",
4
4
  "description": "Paquete mapper para portal de productores",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -21,13 +21,13 @@ const getApiMapperConfig = () => {
21
21
  };
22
22
 
23
23
  const getSalesAgent = () => {
24
- return localStorage.getItem("sales-channel") ||
24
+ return localStorage.getItem("sales-agent") ||
25
25
  window.__INTERMEDIARY_CODE__ ||
26
26
  null;
27
27
  };
28
28
 
29
29
  const getSalesChannel = () => {
30
- return localStorage.getItem("branch-code") ||
30
+ return localStorage.getItem("sales-channel") ||
31
31
  window.__INTERMEDIARY_CODE__ ||
32
32
  null;
33
33
  };
@@ -34,6 +34,7 @@ import {
34
34
  quotationStandardPlanCreationMapped,
35
35
  quotationVariablePlanCreationMapped
36
36
  } from "./modules/quotation";
37
+ import { getRequest_Params } from "./modules/request";
37
38
 
38
39
  export const methods = {
39
40
  GET: "GET",
@@ -648,6 +649,23 @@ const quotationModule = {
648
649
  // REQUEST MODULE
649
650
  // ============================================================================
650
651
  const requestModule = {
652
+ GET_REQUESTS_LOOKUP: {
653
+ default: {
654
+ url: 'request/v1/requests',
655
+ method: methods.GET,
656
+ source: 'https://apidoc.sysone.com/quotation/v1/open-api.html#/paths/~1v1~1quotations/get',
657
+ requestMapper: (request) => ({ mappedParams: request }),
658
+ responseMapper: (response) => response
659
+ },
660
+ cnp: {
661
+ url: 'request/v1/request/savings',
662
+ method: methods.GET,
663
+ requestMapper: request => ({ mappedParams: getRequest_Params(request) }),
664
+ responseMapper: (response) => response
665
+ }
666
+ },
667
+
668
+
651
669
  POST_SEND_REQUEST: {
652
670
  cnp: {
653
671
  url: '/request/v1/request/savings',
@@ -0,0 +1,11 @@
1
+
2
+
3
+ export const getRequest_Params = (i) => {
4
+ return {
5
+ number: i.quotationNumber,
6
+ statusCode: i.status,
7
+ productCode: i.productCode,
8
+ from: i.creationDateFrom,
9
+ to: i.creationDateTo
10
+ }
11
+ }