Built motion from commit 26159a51.|2.5.44
[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 _0x1296=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','request-promise','path','rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4c06a3,_0x1e6b6f){var _0x7ff53c=function(_0x559eff){while(--_0x559eff){_0x4c06a3['push'](_0x4c06a3['shift']());}};_0x7ff53c(++_0x1e6b6f);}(_0x1296,0x134));var _0x6129=function(_0x440a1f,_0x13e782){_0x440a1f=_0x440a1f-0x0;var _0x1ef57c=_0x1296[_0x440a1f];return _0x1ef57c;};'use strict';var _=require(_0x6129('0x0'));var util=require(_0x6129('0x1'));var logger=require('../../config/logger')(_0x6129('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6129('0x3'));var fs=require('fs');var path=require(_0x6129('0x4'));var rimraf=require(_0x6129('0x5'));var config=require('../../config/environment');var attributes=require(_0x6129('0x6'));module[_0x6129('0x7')]=function(_0x2ac1c1,_0x2b898b){return _0x2ac1c1[_0x6129('0x8')](_0x6129('0x9'),attributes,{'tableName':_0x6129('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x587ae5,_0x3c1851,_0x1f5f94){if(_0x587ae5[_0x6129('0xb')](_0x6129('0xc'))){_0x587ae5['closedAt']=moment()[_0x6129('0xd')](_0x6129('0xe'));}_0x1f5f94(null,_0x587ae5);}},'charset':_0x6129('0xf'),'collate':_0x6129('0x10')});};