Built motion from commit 377f727e.|2.6.28
[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 _0x44c1=['rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x188078,_0x4b1305){var _0x50c445=function(_0x4176a9){while(--_0x4176a9){_0x188078['push'](_0x188078['shift']());}};_0x50c445(++_0x4b1305);}(_0x44c1,0x1ba));var _0x144c=function(_0x32e54a,_0x59fc0d){_0x32e54a=_0x32e54a-0x0;var _0x109af4=_0x44c1[_0x32e54a];return _0x109af4;};'use strict';var _=require(_0x144c('0x0'));var util=require(_0x144c('0x1'));var logger=require(_0x144c('0x2'))('api');var moment=require(_0x144c('0x3'));var BPromise=require(_0x144c('0x4'));var rp=require(_0x144c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x144c('0x6'));var config=require('../../config/environment');var attributes=require(_0x144c('0x7'));module[_0x144c('0x8')]=function(_0x36751d,_0xab5c7d){return _0x36751d[_0x144c('0x9')](_0x144c('0xa'),attributes,{'tableName':_0x144c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57e24d,_0x82ee7f,_0x39d245){if(_0x57e24d['changed']('closed')){_0x57e24d[_0x144c('0xc')]=moment()[_0x144c('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x39d245(null,_0x57e24d);}},'charset':_0x144c('0xe'),'collate':_0x144c('0xf')});};