<commit_before>//const util = require('./util');
const {Models} = require('../db');

module.exports = router => {
    //util.abml(router, 'pedidos');

    router.post('/pedidos', (req, res) => {
        const param = {
            where: req.body,
            include: [
                {
                    model: Models.usuarios
                }, {
                    model: Models.grupoDeMesas
                }, {
                    model: Models.pedidoEstado
                }, {
                    model: Models.comandas,
                    include: [
                        {
                            model: Models.productosPorComandas
                        }, {
                            model: Models.platosPorComandas
                        }, {
                            model: Models.promosPorComandas
                        }
                    ]
                }
            ]
        };

        Models.pedidos.findOrCreate(param).then(result => res.json(result[0]));

    });
<commit_msg>adicion de comandas++ al recuperar un pedido<commit_after>//const util = require('./util');
const {Models} = require('../db');

module.exports = router => {
    //util.abml(router, 'pedidos');

    router.post('/pedidos', (req, res) => {
        const param = {
            where: req.body,
            include: [
                {
                    model: Models.usuarios
                }, {
                    model: Models.grupoDeMesas
                }, {
                    model: Models.pedidoEstado
                }, {
                    model: Models.comandas,
                    include: [
                        {
                            model: Models.productosPorComandas,
                            include: {
                                model: Models.productos
                            }
                        }, {
                            model: Models.platosPorComandas,
                            include: {
                                model: Models.platos
                            }
                        }, {
                            model: Models.promosPorComandas,
                            include: {
                                model: Models.promos
                            }
                        }
                    ]
                }
            ]
        };

        Models.pedidos.findOrCreate(param).then(result => res.json(result[0]));

    });

{'fraction_non_alphanumeric': 0.10199918400652795, 'fraction_numerical': 0.0008159934720522236, 'mean_word_length': 0.775524981897176, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3059664', 'n_tokens_mistral': 617, 'n_tokens_neox': 553, 'n_words': 85}