b0a79c56c020fe3f6778f695e1eb7a033a9020cf
[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 _0xe4f6=['changed','closed','format','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions'];(function(_0x49309b,_0x4b048d){var _0x2e6d7e=function(_0x897b09){while(--_0x897b09){_0x49309b['push'](_0x49309b['shift']());}};_0x2e6d7e(++_0x4b048d);}(_0xe4f6,0xb4));var _0x6e4f=function(_0x3cfb9e,_0x103c95){_0x3cfb9e=_0x3cfb9e-0x0;var _0x446856=_0xe4f6[_0x3cfb9e];return _0x446856;};'use strict';var _=require(_0x6e4f('0x0'));var util=require('util');var logger=require(_0x6e4f('0x1'))(_0x6e4f('0x2'));var moment=require('moment');var BPromise=require(_0x6e4f('0x3'));var rp=require(_0x6e4f('0x4'));var fs=require('fs');var path=require(_0x6e4f('0x5'));var rimraf=require(_0x6e4f('0x6'));var config=require(_0x6e4f('0x7'));var attributes=require(_0x6e4f('0x8'));module['exports']=function(_0xdfb230,_0x33db06){return _0xdfb230[_0x6e4f('0x9')](_0x6e4f('0xa'),attributes,{'tableName':_0x6e4f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x32e3c2,_0x19cdc8,_0x4ac024){if(_0x32e3c2[_0x6e4f('0xc')](_0x6e4f('0xd'))){_0x32e3c2['closedAt']=moment()[_0x6e4f('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4ac024(null,_0x32e3c2);}},'charset':'utf8mb4','collate':_0x6e4f('0xf')});};