4cdce45cf113b17592ef8ec7efa3e7af4a0d8280
[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 _0xe862=['moment','request-promise','path','rimraf','../../config/environment','./interval.attributes','exports','define','tools_intervals','rewrite','../../config/logger','api'];(function(_0x5f259c,_0x26127d){var _0xddcf04=function(_0x5ea71f){while(--_0x5ea71f){_0x5f259c['push'](_0x5f259c['shift']());}};_0xddcf04(++_0x26127d);}(_0xe862,0x76));var _0x2e86=function(_0x2560a0,_0x463859){_0x2560a0=_0x2560a0-0x0;var _0x32fef8=_0xe862[_0x2560a0];return _0x32fef8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2e86('0x0'))(_0x2e86('0x1'));var moment=require(_0x2e86('0x2'));var BPromise=require('bluebird');var rp=require(_0x2e86('0x3'));var fs=require('fs');var path=require(_0x2e86('0x4'));var rimraf=require(_0x2e86('0x5'));var config=require(_0x2e86('0x6'));var attributes=require(_0x2e86('0x7'));var extensions=require('../../components/extensions/rewrite');module[_0x2e86('0x8')]=function(_0x191d4c,_0x139bac){return _0x191d4c[_0x2e86('0x9')]('Interval',attributes,{'tableName':_0x2e86('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xafcdca,_0x43b966){extensions['rewrite'](_0x191d4c,_0xafcdca);},'afterBulkCreate':function(_0x2886ed,_0x395c46,_0x585763){_0x585763();extensions[_0x2e86('0xb')](_0x191d4c,_0x2886ed[0x0]);},'afterUpdate':function(_0x5292e1,_0x27f319){extensions[_0x2e86('0xb')](_0x191d4c,_0x5292e1);},'afterDestroy':function(_0x469001,_0x559efa){extensions['rewrite'](_0x191d4c,_0x469001);}}});};