Built motion from commit (unavailable).|2.5.2
[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 _0xc388=['moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x4791bf,_0x458c9e){var _0x11fcfe=function(_0x39fa1d){while(--_0x39fa1d){_0x4791bf['push'](_0x4791bf['shift']());}};_0x11fcfe(++_0x458c9e);}(_0xc388,0x164));var _0x8c38=function(_0x30defd,_0x1eaeca){_0x30defd=_0x30defd-0x0;var _0x21e81b=_0xc388[_0x30defd];return _0x21e81b;};'use strict';var _=require(_0x8c38('0x0'));var util=require(_0x8c38('0x1'));var logger=require(_0x8c38('0x2'))(_0x8c38('0x3'));var moment=require(_0x8c38('0x4'));var BPromise=require('bluebird');var rp=require(_0x8c38('0x5'));var fs=require('fs');var path=require(_0x8c38('0x6'));var rimraf=require(_0x8c38('0x7'));var config=require(_0x8c38('0x8'));var attributes=require(_0x8c38('0x9'));module[_0x8c38('0xa')]=function(_0x1f3017,_0x3a2a61){return _0x1f3017['define'](_0x8c38('0xb'),attributes,{'tableName':_0x8c38('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x49f7f2,_0x57b392,_0x29a956){if(_0x49f7f2[_0x8c38('0xd')]('closed')){_0x49f7f2[_0x8c38('0xe')]=moment()[_0x8c38('0xf')](_0x8c38('0x10'));}_0x29a956(null,_0x49f7f2);}},'charset':_0x8c38('0x11'),'collate':'utf8mb4_unicode_ci'});};