Built motion from commit d5e4af8c.|2.6.23
[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 _0x8b7b=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','exports','define','ChatInteraction','chat_interactions'];(function(_0x2f5e81,_0x49c319){var _0x5e4f0e=function(_0x3343d8){while(--_0x3343d8){_0x2f5e81['push'](_0x2f5e81['shift']());}};_0x5e4f0e(++_0x49c319);}(_0x8b7b,0x95));var _0xb8b7=function(_0x36c396,_0x332431){_0x36c396=_0x36c396-0x0;var _0x201307=_0x8b7b[_0x36c396];return _0x201307;};'use strict';var _=require(_0xb8b7('0x0'));var util=require('util');var logger=require(_0xb8b7('0x1'))(_0xb8b7('0x2'));var moment=require(_0xb8b7('0x3'));var BPromise=require('bluebird');var rp=require(_0xb8b7('0x4'));var fs=require('fs');var path=require(_0xb8b7('0x5'));var rimraf=require(_0xb8b7('0x6'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0xb8b7('0x7')]=function(_0x19d25a,_0x2ff03d){return _0x19d25a[_0xb8b7('0x8')](_0xb8b7('0x9'),attributes,{'tableName':_0xb8b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57325f,_0x5ec27b,_0x14e43a){if(_0x57325f[_0xb8b7('0xb')]('closed')){_0x57325f[_0xb8b7('0xc')]=moment()[_0xb8b7('0xd')](_0xb8b7('0xe'));}_0x14e43a(null,_0x57325f);}},'charset':'utf8mb4','collate':_0xb8b7('0xf')});};