7185eec616eb17110f24e22f41d434f1f703439a
[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 _0xa157=['rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','path'];(function(_0x329d13,_0x1aff27){var _0x33efd9=function(_0x265b7d){while(--_0x265b7d){_0x329d13['push'](_0x329d13['shift']());}};_0x33efd9(++_0x1aff27);}(_0xa157,0x1c6));var _0x7a15=function(_0xf0403,_0xf15e47){_0xf0403=_0xf0403-0x0;var _0x30eae8=_0xa157[_0xf0403];return _0x30eae8;};'use strict';var _=require('lodash');var util=require(_0x7a15('0x0'));var logger=require(_0x7a15('0x1'))(_0x7a15('0x2'));var moment=require(_0x7a15('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a15('0x4'));var rimraf=require(_0x7a15('0x5'));var config=require(_0x7a15('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x7a15('0x7')]=function(_0x53f369,_0x50bc03){return _0x53f369[_0x7a15('0x8')](_0x7a15('0x9'),attributes,{'tableName':_0x7a15('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48a72e,_0x422771,_0x23e478){if(_0x48a72e[_0x7a15('0xb')](_0x7a15('0xc'))){_0x48a72e[_0x7a15('0xd')]=moment()[_0x7a15('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x23e478(null,_0x48a72e);}},'charset':_0x7a15('0xf'),'collate':_0x7a15('0x10')});};