This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Query { | |
me: User | |
} | |
type User { | |
id: ID | |
name: String | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(SELECT ek_vend_comp.nome as nome_vend, | |
ek_vend_comp.cod_vend_comp, | |
coalesce(ek_vend_comp.perc_comissao,0) as perc_comissao, | |
ek_financeiro_receber.valor_pago | |
FROM ek_vend_comp | |
inner join ek_pedido_cli | |
inner join ek_financeiro_receber on ek_pedido_cli.seq_pedido_cli = ek_financeiro_receber.seq_pedido | |
on ek_vend_comp.cod_vend_comp = ek_pedido_cli.cod_vend_comp | |
WHERE (case when 0 = 1 then (CASE WHEN 0 <> 0 THEN ek_vend_comp.cod_vend_comp = 0 ELSE 1=1 END) else | |
ek_vend_comp.cod_vend_comp < 0 end) and ek_vend_comp.cod_vend_comp in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios') | |
const env = require('./.env') | |
const cron = require('node-cron') | |
require('./config/database') | |
const accessToken = require('./api').accessToken | |
const userValidate = require('./api').userValidate | |
const getOrders = require('./api').getOrders | |
const getSetup = require('./api').getSetup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('should verify a valid certificate against a jwt google', (done) => { | |
nock('http://localhost:3000/oapi/v1/tests') | |
.defaultReplyHeaders({ | |
'Content-Type': 'application/json' | |
}) | |
.post('/google', { | |
email: '[email protected]' | |
}) | |
.reply(200, (uri, req, cb) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const models = require('../../loading/loading'); | |
const Promise = require('bluebird'); | |
module.exports = Promise.method(function userExists(userAttributes) { | |
return models.User | |
.findOne({ | |
where: { | |
email: userAttributes.email | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function processExpense(data) { | |
return new Promise((resolve, reject) => { | |
model.Despesa.findAll({ | |
where: { | |
$and: [ | |
model.Despesa.sequelize.where(model.sequelize.literal('extract(YEAR FROM data_lancamento)'), data.year), | |
{ num_filial: data.unit } | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.update = function(req, res){ | |
var dados = req.body.data; | |
processRequests(dados) | |
.then(function(data){ | |
res.send(data) | |
}) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model.Receita.findAll({ | |
where: { | |
id: filter.id | |
}, | |
include: [ | |
{ model: model.Pessoa } | |
], | |
order: 'seq_receita' | |
}).then((data) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(sequelize, DataTypes){ | |
var Rece = sequelize.define('Receita', { | |
id: { | |
type : DataTypes.INTEGER, | |
primaryKey: true, | |
autoIncrement: true, | |
field: 'seq_receita' | |
}, | |
cod_pessoa: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
constructor(public params: NavParams){ | |
// userParams é um objeto que temos em nossos parâmetros nav | |
this.params.get('userParams'); | |
} |