Built motion from commit (unavailable).|2.5.22
[motion2.git] / server / api / openchannelInteraction / openchannelInteraction.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 _0xd101=['request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird'];(function(_0x36e70a,_0x4b182d){var _0xcbbc9a=function(_0xfcd070){while(--_0xfcd070){_0x36e70a['push'](_0x36e70a['shift']());}};_0xcbbc9a(++_0x4b182d);}(_0xd101,0xc1));var _0x1d10=function(_0x42c4be,_0x8ea715){_0x42c4be=_0x42c4be-0x0;var _0x174b3f=_0xd101[_0x42c4be];return _0x174b3f;};'use strict';var _=require(_0x1d10('0x0'));var util=require('util');var logger=require(_0x1d10('0x1'))(_0x1d10('0x2'));var moment=require(_0x1d10('0x3'));var BPromise=require(_0x1d10('0x4'));var rp=require(_0x1d10('0x5'));var fs=require('fs');var path=require(_0x1d10('0x6'));var rimraf=require(_0x1d10('0x7'));var config=require(_0x1d10('0x8'));var attributes=require('./openchannelInteraction.attributes');module[_0x1d10('0x9')]=function(_0x203072,_0x2a4e2d){return _0x203072[_0x1d10('0xa')](_0x1d10('0xb'),attributes,{'tableName':_0x1d10('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x6d6def,_0x43df2c,_0x3a15c8){if(_0x6d6def[_0x1d10('0xd')](_0x1d10('0xe'))){_0x6d6def[_0x1d10('0xf')]=moment()[_0x1d10('0x10')](_0x1d10('0x11'));}_0x3a15c8(null,_0x6d6def);}}});};