f844eb75e532eb7e1d10522c0a5a992fcfb1d45b
[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 _0x8066=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','../../config/environment','exports','ChatInteraction','changed','closed'];(function(_0x42dcbb,_0x3bab87){var _0x597f5d=function(_0x3c93c6){while(--_0x3c93c6){_0x42dcbb['push'](_0x42dcbb['shift']());}};_0x597f5d(++_0x3bab87);}(_0x8066,0xe5));var _0x6806=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x8066[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x6806('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6806('0x1'));var moment=require(_0x6806('0x2'));var BPromise=require(_0x6806('0x3'));var rp=require(_0x6806('0x4'));var fs=require('fs');var path=require(_0x6806('0x5'));var rimraf=require('rimraf');var config=require(_0x6806('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x6806('0x7')]=function(_0x43b08b,_0x3ed9c3){return _0x43b08b['define'](_0x6806('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2eba39,_0x4831de,_0x58edc8){if(_0x2eba39[_0x6806('0x9')](_0x6806('0xa'))){_0x2eba39[_0x6806('0xb')]=moment()[_0x6806('0xc')](_0x6806('0xd'));}_0x58edc8(null,_0x2eba39);}},'charset':_0x6806('0xe'),'collate':_0x6806('0xf')});};