Built motion from commit bbec7235.|2.6.20
[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 _0xe773=['./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3bee13,_0x29cae3){var _0x82c3cc=function(_0x41297c){while(--_0x41297c){_0x3bee13['push'](_0x3bee13['shift']());}};_0x82c3cc(++_0x29cae3);}(_0xe773,0xc4));var _0x3e77=function(_0x437ef0,_0x5e58f9){_0x437ef0=_0x437ef0-0x0;var _0x16056b=_0xe773[_0x437ef0];return _0x16056b;};'use strict';var _=require(_0x3e77('0x0'));var util=require(_0x3e77('0x1'));var logger=require(_0x3e77('0x2'))('api');var moment=require(_0x3e77('0x3'));var BPromise=require(_0x3e77('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e77('0x5'));var rimraf=require(_0x3e77('0x6'));var config=require(_0x3e77('0x7'));var attributes=require(_0x3e77('0x8'));module[_0x3e77('0x9')]=function(_0x1281f7,_0x35f2da){return _0x1281f7['define'](_0x3e77('0xa'),attributes,{'tableName':_0x3e77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a01a2,_0x9c4746,_0x53dea4){if(_0x3a01a2['changed']('closed')){_0x3a01a2[_0x3e77('0xc')]=moment()[_0x3e77('0xd')](_0x3e77('0xe'));}_0x53dea4(null,_0x3a01a2);}},'charset':_0x3e77('0xf'),'collate':_0x3e77('0x10')});};