tableName: 'report_queue',
indexes: [{
fields: ['uniqueid']
- }]
+ }],
+ associate: function(models) {
+ // SCOPES MANAGEMENT
+ ReportQueue
+ .addScope('agent', function(queues) {
+ return {
+ where: {
+ queue: {
+ $in: queues
+ }
+ }
+ }
+ });
+
+ ReportQueue
+ .addScope('waiting', {
+ where: {
+ queuecallerleaveAt: null
+ }
+ });
+ }
});
return ReportQueue;