{"action":"opened","issue":{"url":"https://api.github.com/repos/lucaslencinas/telefonia/issues/25","repository_url":"https://api.github.com/repos/lucaslencinas/telefonia","labels_url":"https://api.github.com/repos/lucaslencinas/telefonia/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/lucaslencinas/telefonia/issues/25/comments","events_url":"https://api.github.com/repos/lucaslencinas/telefonia/issues/25/events","html_url":"https://github.com/lucaslencinas/telefonia/issues/25","id":154100208,"number":25,"title":"commitear lo que hice en el laburo","user":{"login":"lucaslencinas","id":1664768,"avatar_url":"https://avatars.githubusercontent.com/u/1664768?v=3","gravatar_id":"","url":"https://api.github.com/users/lucaslencinas","html_url":"https://github.com/lucaslencinas","followers_url":"https://api.github.com/users/lucaslencinas/followers","following_url":"https://api.github.com/users/lucaslencinas/following{/other_user}","gists_url":"https://api.github.com/users/lucaslencinas/gists{/gist_id}","starred_url":"https://api.github.com/users/lucaslencinas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucaslencinas/subscriptions","organizations_url":"https://api.github.com/users/lucaslencinas/orgs","repos_url":"https://api.github.com/users/lucaslencinas/repos","events_url":"https://api.github.com/users/lucaslencinas/events{/privacy}","received_events_url":"https://api.github.com/users/lucaslencinas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-10T20:33:52Z","updated_at":"2016-05-10T20:33:52Z","closed_at":null,"body":"\r\nTODOs\r\n-----\r\n-Agregar fechas y horas de creacion de tickets, mandarlas al server y guardarlas en la base\r\n-Pensar en como se muestra la info adicional del ticket. Hay un log de cambios respecto al mismo? como se guarda en la base eso?\r\n\r\n\r\n\r\nEn altainterno.sql\r\n------------------\r\n`departamento` varchar(20) DEFAULT NULL,\r\nCONSTRAINT chk_estado CHECK (`estado` IN ('rechazado', 'pendienteGerente', 'pendienteTelefonia', 'aprobado'))\r\n\r\n\r\nEn db.js \r\n--------\r\nexports.buildGetServiciosDeUsuarioQueryString = function(tipoDeServicio, idUsuario){\r\n\tvar typesWhereClause = {\r\n\t\t\t\"aprobados\":\"AND estado = 'aprobado')\", \r\n\t\t\t\"pendientes\":\"AND (estado = 'pendienteTelefonia' OR estado = 'pendienteGerente'))\", \r\n\t\t\t\"rechazados\":\"AND estado = 'rechazado')\", \r\n\t\t\t\"todos\": \")\"\r\n\t\t};\r\n\r\n\tvar query = \"SELECT idIBM, nombre, apellido, pais, ticket, estado, fManager, sManager, edificio, piso, intReferencia, aparato, voicemail, justificacion \";\r\n  query += \"FROM  altainterno \";\r\n  query += \"WHERE (idIBM = '\" + idUsuario + \"' \";/*le falta el cierre del parentesis, lo agrega la linea de abajo*/\r\n\tquery += typesWhereClause[tipoDeServicio];\r\n\t\r\n  return query;\r\n};\r\n\r\n\r\nEn servicios.js\r\n----------------\r\n\r\n\r\nrouter.get('/:tipoDeServicio/:idUsuario', function(req, res, next) {\r\n  console.log('Adentro de GET /servicios/' + req.params.tipoDeServicio  + \"/\" + req.params.idUsuario );\r\n\r\n  db.getConnection(function(err, connection){\r\n    connection.query( db.buildGetServiciosDeUsuarioQueryString(req.params.tipoDeServicio, req.params.idUsuario), function(err, rows) {\r\n      if (err) {\r\n        throw err;\r\n      }\r\n      res.json(rows);\r\n\t\t\t/*rows tiene:\r\n\t\t\tidIBM, nombre, apellido, pais, ticket, estado, fManager, sManager, edificio, piso, intReferencia, aparato, voicemail, justificacion\r\n\t\t\t*/\r\n      connection.release();\r\n      // Don't use the connection here, it has been returned to the pool.\r\n    });\r\n\r\n  });\r\n\r\n  res.send('respond with a resource');\r\n});\r\n"}}