Built motion from commit e1760111.|2.6.18
[motion2.git] / server / api / interval / interval.model.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xa7ba=['reduce','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','define','Interval','tools_intervals','rewrite','interval','string','getIntervals','then','all','ifTime'];(function(_0x482475,_0x180f67){var _0x2012ac=function(_0x1f59d9){while(--_0x1f59d9){_0x482475['push'](_0x482475['shift']());}};_0x2012ac(++_0x180f67);}(_0xa7ba,0x14b));var _0xaa7b=function(_0xf6baeb,_0x284a19){_0xf6baeb=_0xf6baeb-0x0;var _0x111bae=_0xa7ba[_0xf6baeb];return _0x111bae;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0xaa7b('0x0'));var iftime=require(_0xaa7b('0x1'))[_0xaa7b('0x2')];module[_0xaa7b('0x3')]=function(_0x2eb06b){return _0x2eb06b[_0xaa7b('0x4')](_0xaa7b('0x5'),attributes,{'tableName':_0xaa7b('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x14158c){extensions[_0xaa7b('0x7')](_0x2eb06b,_0x14158c);},'afterBulkCreate':function(_0x58a897,_0x59418d,_0x33387f){_0x33387f();extensions[_0xaa7b('0x7')](_0x2eb06b,_0x58a897[0x0]);},'afterUpdate':function(_0xc13d4){extensions[_0xaa7b('0x7')](_0x2eb06b,_0xc13d4);},'afterDestroy':function(_0x1730a1){extensions['rewrite'](_0x2eb06b,_0x1730a1);}},'instanceMethods':{'ifTime':function(_0x15ceba=undefined,_0x506568=new Date()){if(typeof this[_0xaa7b('0x8')]===_0xaa7b('0x9')){return iftime(this[_0xaa7b('0x8')],_0x15ceba,_0x506568);}else{return this[_0xaa7b('0xa')]()[_0xaa7b('0xb')](function(_0x3ae692){return Promise[_0xaa7b('0xc')](_0x3ae692['map'](function(_0x49425f){return _0x49425f[_0xaa7b('0xd')](_0x15ceba,_0x506568);}));})[_0xaa7b('0xb')](function(_0x14b61c){return _0x14b61c[_0xaa7b('0xe')](function(_0x3b8173,_0x1d3fec){return _0x3b8173||_0x1d3fec;},![]);});}}}});};