2018-01-23 07:05:16 +01:00
|
|
|
const logger = require('winston');
|
2018-04-17 23:54:10 +02:00
|
|
|
const db = require('../models');
|
2018-01-23 07:05:16 +01:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
getRecentClaims () {
|
|
|
|
logger.debug('retrieving most recent claims');
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
// get the raw requests data
|
|
|
|
db.File.getRecentClaims()
|
|
|
|
.then(results => {
|
|
|
|
resolve(results);
|
|
|
|
})
|
|
|
|
.catch(error => {
|
|
|
|
logger.error('sequelize error', error);
|
|
|
|
reject(error);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
};
|