configModel.findAllFull = function( ) {
return this.findAll().then(function(games:any):any {
return games.map(function(game:any):any {
return chestModel.findAll({
where: {
id: game.chestId
}
}).then(function(chests:any):any {
let items:any = [];
chests.map(function(chest:any):any {
items.push(chest.get({plain: true}));
});
game.chests = items;
return game;
});
});
});
};