742680958394645106df29f6dd1d9301138d977d
[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 _0x5b66=['../../config/logger','api','moment','bluebird','request-promise','path','exports','define','tools_intervals','rewrite','util'];(function(_0x2619d9,_0x4405cf){var _0x369f37=function(_0x2f6751){while(--_0x2f6751){_0x2619d9['push'](_0x2619d9['shift']());}};_0x369f37(++_0x4405cf);}(_0x5b66,0x6d));var _0x65b6=function(_0x5021e6,_0x1f7f63){_0x5021e6=_0x5021e6-0x0;var _0x1a2470=_0x5b66[_0x5021e6];return _0x1a2470;};'use strict';var _=require('lodash');var util=require(_0x65b6('0x0'));var logger=require(_0x65b6('0x1'))(_0x65b6('0x2'));var moment=require(_0x65b6('0x3'));var BPromise=require(_0x65b6('0x4'));var rp=require(_0x65b6('0x5'));var fs=require('fs');var path=require(_0x65b6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module[_0x65b6('0x7')]=function(_0x105c86,_0x7277bd){return _0x105c86[_0x65b6('0x8')]('Interval',attributes,{'tableName':_0x65b6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x165211,_0x1cc55c){extensions['rewrite'](_0x105c86,_0x165211);},'afterBulkCreate':function(_0x92670f,_0x1f088e,_0xe5882e){_0xe5882e();extensions[_0x65b6('0xa')](_0x105c86,_0x92670f[0x0]);},'afterUpdate':function(_0x4a823f,_0xae5199){extensions[_0x65b6('0xa')](_0x105c86,_0x4a823f);},'afterDestroy':function(_0xe60b7b,_0x12a5e3){extensions[_0x65b6('0xa')](_0x105c86,_0xe60b7b);}}});};