cde1b0c2323211dac4bd59e0925d38b2819b231d
[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 _0x2bf9=['ChatInteraction','chat_interactions','changed','closed','format','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','rimraf','exports','define'];(function(_0x25f37c,_0x21094a){var _0x1aa082=function(_0x1ec569){while(--_0x1ec569){_0x25f37c['push'](_0x25f37c['shift']());}};_0x1aa082(++_0x21094a);}(_0x2bf9,0x1c1));var _0x92bf=function(_0x46f3f8,_0x12c74b){_0x46f3f8=_0x46f3f8-0x0;var _0xbc57cd=_0x2bf9[_0x46f3f8];return _0xbc57cd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x92bf('0x0'))('api');var moment=require(_0x92bf('0x1'));var BPromise=require(_0x92bf('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x92bf('0x3'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x92bf('0x4')]=function(_0x262f11,_0x280891){return _0x262f11[_0x92bf('0x5')](_0x92bf('0x6'),attributes,{'tableName':_0x92bf('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f2d1f,_0x5357ab,_0x25d05c){if(_0x1f2d1f[_0x92bf('0x8')](_0x92bf('0x9'))){_0x1f2d1f['closedAt']=moment()[_0x92bf('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x25d05c(null,_0x1f2d1f);}},'charset':_0x92bf('0xb'),'collate':_0x92bf('0xc')});};