{
  "info": {
    "_postman_id": "db499c42-0452-4805-b9b2-46f863c2194e",
    "name": "trabajar con querys en Service Layer",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_exporter_id": "14619611"
  },
  "item": [
    {
      "name": "Login",
      "request": {
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\r\n    \"CompanyDB\": \"SBO_IBERO_FARMACOS\",\r\n    \"Password\": \"123456\",\r\n    \"UserName\": \"INTEGRACION\"\r\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{rootPath}}/Login",
          "host": [
            "{{rootPath}}"
          ],
          "path": [
            "Login"
          ]
        }
      },
      "response": []
    },
    {
      "name": "LogOut",
      "request": {
        "method": "POST",
        "header": [],
        "url": {
          "raw": "{{rootPath}}/Logout",
          "host": [
            "{{rootPath}}"
          ],
          "path": [
            "Logout"
          ]
        }
      },
      "response": []
    },
    {
      "name": "create Sql Queries with params",
      "request": {
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\r\n  \"SqlCode\": \"prom_resumen_ds2\",\r\n  \"SqlName\": \"ConsolidadoFacturasElegiblesPromocion\",\r\n  \"SqlText\": \"SELECT T0.[U_CodEmpleado] AS [CodigoVendedor], T0.[U_NombreEmpleado] AS [NombreVendedor], T2.[CardCode] AS [CodigoCliente], T2.[CardName] AS [NombreCliente], T2.[U_Ruta] AS [Ruta], T2.[U_Zona] AS [Zona], T0.[DocNum] AS [NumeroFactura], T0.[DocDate] AS [FechaFactura], T1.[ItemCode] AS [CodigoArticulo], T1.[Dscription] AS [DescripcionArticulo], T1.[Quantity] AS [CantidadVendida], MAX(T3.[Price]) AS [ValorPromocionUnitario] FROM [OINV] T0 INNER JOIN [INV1] T1 ON T0.[DocEntry] = T1.[DocEntry] INNER JOIN [OCRD] T2 ON T0.[CardCode] = T2.[CardCode] LEFT JOIN [INV1] T3 ON T3.[DocEntry] = T1.[DocEntry] AND T3.[ItemCode] = T1.[ItemCode] AND T3.[Price] > 0 AND T3.[U_IsOfferItem] <> 'Y' WHERE T0.[CANCELED] = 'N' AND T1.[U_IsOfferItem] = 'Y' AND T0.[TaxDate] >= :FechaInicio AND T0.[TaxDate] <= :FechaFin GROUP BY T0.[U_CodEmpleado], T0.[U_NombreEmpleado], T2.[CardCode], T2.[CardName], T2.[U_Ruta], T2.[U_Zona], T0.[DocNum], T0.[DocDate], T1.[ItemCode], T1.[Dscription], T1.[Quantity]\"\r\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{rootPath}}/SQLQueries",
          "host": [
            "{{rootPath}}"
          ],
          "path": [
            "SQLQueries"
          ]
        }
      },
      "response": []
    },
    {
      "name": "get Sql Queries",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{rootPath}}/SQLQueries",
          "host": [
            "{{rootPath}}"
          ],
          "path": [
            "SQLQueries"
          ]
        }
      },
      "response": []
    },
    {
      "name": "get Sql Queries by code",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{rootPath}}/SQLQueries('prom_resumen_ds2')",
          "host": [
            "{{rootPath}}"
          ],
          "path": [
            "SQLQueries('prom_resumen_ds2')"
          ]
        }
      },
      "response": []
    },
    {
      "name": "execute sql query with params",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{rootPath}}/SQLQueries('prom_resumen_ds2')/List?FechaInicio='20260101'&FechaFin='20260505'",
          "host": [
            "{{rootPath}}"
          ],
          "path": [
            "SQLQueries('prom_resumen_ds2')",
            "List"
          ],
          "query": [
            {
              "key": "FechaInicio",
              "value": "'20260101'"
            },
            {
              "key": "FechaFin",
              "value": "'20260505'"
            }
          ]
        }
      },
      "response": []
    }
  ],
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "packages": {},
        "requests": {},
        "exec": [
          ""
        ]
      }
    },
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "packages": {},
        "requests": {},
        "exec": [
          ""
        ]
      }
    }
  ],
  "variable": [
    {
      "key": "rootPath",
      "value": "https://localhost:50000/b1s/v2"
    }
  ]
}