Built motion from commit 9d0783e6.|2.6.13
[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 _0x35d3=['Interval','tools_intervals','rewrite','interval','string','getIntervals','then','all','map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','define'];(function(_0x443894,_0x4f080b){var _0x3c05c6=function(_0x4ce5d4){while(--_0x4ce5d4){_0x443894['push'](_0x443894['shift']());}};_0x3c05c6(++_0x4f080b);}(_0x35d3,0x11b));var _0x335d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x35d3[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0x335d('0x0'));var extensions=require(_0x335d('0x1'));var iftime=require(_0x335d('0x2'))[_0x335d('0x3')];module[_0x335d('0x4')]=function(_0x429dc9){return _0x429dc9[_0x335d('0x5')](_0x335d('0x6'),attributes,{'tableName':_0x335d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xccf037){extensions['rewrite'](_0x429dc9,_0xccf037);},'afterBulkCreate':function(_0x51a06d,_0x5b1268,_0x147ebd){_0x147ebd();extensions[_0x335d('0x8')](_0x429dc9,_0x51a06d[0x0]);},'afterUpdate':function(_0x4214c5){extensions[_0x335d('0x8')](_0x429dc9,_0x4214c5);},'afterDestroy':function(_0x56824c){extensions['rewrite'](_0x429dc9,_0x56824c);}},'instanceMethods':{'ifTime':function(_0x9d0234=undefined,_0x130578=new Date()){if(typeof this[_0x335d('0x9')]===_0x335d('0xa')){return iftime(this[_0x335d('0x9')],_0x9d0234,_0x130578);}else{return this[_0x335d('0xb')]()[_0x335d('0xc')](function(_0xcbc9cc){return Promise[_0x335d('0xd')](_0xcbc9cc[_0x335d('0xe')](function(_0x37909a){return _0x37909a[_0x335d('0xf')](_0x9d0234,_0x130578);}));})[_0x335d('0xc')](function(_0x265a1b){return _0x265a1b[_0x335d('0x10')](function(_0x21178b,_0x356abe){return _0x21178b||_0x356abe;},![]);});}}}});};