a9dd38a8a161b514843b7b22c57201804de22050
[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 _0x29cb=['path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise'];(function(_0x522664,_0x571bc2){var _0x4285f5=function(_0xfb923c){while(--_0xfb923c){_0x522664['push'](_0x522664['shift']());}};_0x4285f5(++_0x571bc2);}(_0x29cb,0x186));var _0xb29c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x29cb[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xb29c('0x0'));var util=require(_0xb29c('0x1'));var logger=require('../../config/logger')(_0xb29c('0x2'));var moment=require(_0xb29c('0x3'));var BPromise=require(_0xb29c('0x4'));var rp=require(_0xb29c('0x5'));var fs=require('fs');var path=require(_0xb29c('0x6'));var rimraf=require(_0xb29c('0x7'));var config=require(_0xb29c('0x8'));var attributes=require(_0xb29c('0x9'));module[_0xb29c('0xa')]=function(_0x2ce4b9,_0x54f7a7){return _0x2ce4b9[_0xb29c('0xb')](_0xb29c('0xc'),attributes,{'tableName':_0xb29c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x30774d,_0x46017a,_0x27d71c){if(_0x30774d[_0xb29c('0xe')](_0xb29c('0xf'))){_0x30774d[_0xb29c('0x10')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x27d71c(null,_0x30774d);}},'charset':'utf8mb4','collate':_0xb29c('0x11')});};