9075bef5cf608a867bd4a37f4c87633ec918a3a0
[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 _0xb4b1=['utf8mb4_unicode_ci','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0xb4b1,0x18a));var _0x1b4b=function(_0x1179f4,_0x2c1307){_0x1179f4=_0x1179f4-0x0;var _0x419ee0=_0xb4b1[_0x1179f4];return _0x419ee0;};'use strict';var _=require(_0x1b4b('0x0'));var util=require(_0x1b4b('0x1'));var logger=require('../../config/logger')(_0x1b4b('0x2'));var moment=require(_0x1b4b('0x3'));var BPromise=require(_0x1b4b('0x4'));var rp=require(_0x1b4b('0x5'));var fs=require('fs');var path=require(_0x1b4b('0x6'));var rimraf=require(_0x1b4b('0x7'));var config=require(_0x1b4b('0x8'));var attributes=require(_0x1b4b('0x9'));module[_0x1b4b('0xa')]=function(_0x2168ec,_0x20a742){return _0x2168ec[_0x1b4b('0xb')](_0x1b4b('0xc'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1b4b('0xd'),'collate':_0x1b4b('0xe'),'hooks':{'beforeUpdate':function(_0x4ba037,_0x513065,_0x1b70a9){if(_0x4ba037['changed']('closed')){_0x4ba037['closedAt']=moment()[_0x1b4b('0xf')](_0x1b4b('0x10'));}_0x1b70a9(null,_0x4ba037);}}});};