Built motion from commit 10af8726.|2.6.34
[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 _0x41f4=['format','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closedAt'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0x41f4,0xe2));var _0x441f=function(_0x3d9139,_0x20c159){_0x3d9139=_0x3d9139-0x0;var _0x1f4b4f=_0x41f4[_0x3d9139];return _0x1f4b4f;};'use strict';var _=require(_0x441f('0x0'));var util=require('util');var logger=require(_0x441f('0x1'))(_0x441f('0x2'));var moment=require('moment');var BPromise=require(_0x441f('0x3'));var rp=require(_0x441f('0x4'));var fs=require('fs');var path=require(_0x441f('0x5'));var rimraf=require('rimraf');var config=require(_0x441f('0x6'));var attributes=require(_0x441f('0x7'));module[_0x441f('0x8')]=function(_0x488e7e,_0x4ab4c5){return _0x488e7e[_0x441f('0x9')](_0x441f('0xa'),attributes,{'tableName':_0x441f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd237c1,_0x11f1e1,_0x250fd0){if(_0xd237c1[_0x441f('0xc')]('closed')){_0xd237c1[_0x441f('0xd')]=moment()[_0x441f('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x250fd0(null,_0xd237c1);}},'charset':'utf8mb4','collate':_0x441f('0xf')});};