Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / api / chatInteraction / chatInteraction.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 _0xc64f=['changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions'];(function(_0xa44f92,_0x4e78f2){var _0x452e6=function(_0x47f9eb){while(--_0x47f9eb){_0xa44f92['push'](_0xa44f92['shift']());}};_0x452e6(++_0x4e78f2);}(_0xc64f,0x75));var _0xfc64=function(_0xc26f0e,_0x536747){_0xc26f0e=_0xc26f0e-0x0;var _0x2b4dbe=_0xc64f[_0xc26f0e];return _0x2b4dbe;};'use strict';var _=require(_0xfc64('0x0'));var util=require(_0xfc64('0x1'));var logger=require(_0xfc64('0x2'))(_0xfc64('0x3'));var moment=require(_0xfc64('0x4'));var BPromise=require('bluebird');var rp=require(_0xfc64('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfc64('0x6'));var attributes=require(_0xfc64('0x7'));module[_0xfc64('0x8')]=function(_0x437399,_0x4c3d2a){return _0x437399[_0xfc64('0x9')]('ChatInteraction',attributes,{'tableName':_0xfc64('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5f0ac2,_0x275434,_0x3ae0e5){if(_0x5f0ac2[_0xfc64('0xb')]('closed')){_0x5f0ac2[_0xfc64('0xc')]=moment()['format'](_0xfc64('0xd'));}_0x3ae0e5(null,_0x5f0ac2);}},'charset':_0xfc64('0xe'),'collate':_0xfc64('0xf')});};