'use strict'

const event_names = ['register', 'call', 'activate', 'close', 'processing', 'book', 'postpone'];

let inHistory = (ticket, event) => ~_.findIndex(ticket.history, ['event_name', event]);

let TicketFilter = {};


_.forEach(event_names, event => TicketFilter['hasEvent' + _.upperFirst(event)] = (ticket) => inHistory(ticket, event));
//@NOTE: "not" functions
_.forEach(event_names, event => TicketFilter['!hasEvent' + _.upperFirst(event)] = (ticket) => !(inHistory(ticket, event)));


module.exports = TicketFilter;

@@ -101,16 +101,26 @@
 ostpone'
+, 'expire'
 %5D;%0A%0Alet 

expire filter