Built motion from commit 47436d59.|2.6.7
[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 _0xade0=['path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4d4955,_0x269ee9){var _0x25d0ed=function(_0x12b090){while(--_0x12b090){_0x4d4955['push'](_0x4d4955['shift']());}};_0x25d0ed(++_0x269ee9);}(_0xade0,0x162));var _0x0ade=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0xade0[_0x128bef];return _0x1ba862;};'use strict';var _=require(_0x0ade('0x0'));var util=require(_0x0ade('0x1'));var logger=require(_0x0ade('0x2'))(_0x0ade('0x3'));var moment=require(_0x0ade('0x4'));var BPromise=require('bluebird');var rp=require(_0x0ade('0x5'));var fs=require('fs');var path=require(_0x0ade('0x6'));var rimraf=require(_0x0ade('0x7'));var config=require(_0x0ade('0x8'));var attributes=require(_0x0ade('0x9'));module[_0x0ade('0xa')]=function(_0x11ef21,_0x3054db){return _0x11ef21[_0x0ade('0xb')](_0x0ade('0xc'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c4fd3,_0x448bee,_0x4fd3c6){if(_0x4c4fd3['changed']('closed')){_0x4c4fd3[_0x0ade('0xd')]=moment()[_0x0ade('0xe')](_0x0ade('0xf'));}_0x4fd3c6(null,_0x4c4fd3);}},'charset':_0x0ade('0x10'),'collate':_0x0ade('0x11')});};