b948a29bbb5115a5a6349eea564bc006a3f40daf
[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 _0x33e8=['request-promise','path','rimraf','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed','format','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2c6fc0,_0xfa0618){var _0x4fe6cd=function(_0x2c0843){while(--_0x2c0843){_0x2c6fc0['push'](_0x2c6fc0['shift']());}};_0x4fe6cd(++_0xfa0618);}(_0x33e8,0x15b));var _0x833e=function(_0x372c27,_0x49984c){_0x372c27=_0x372c27-0x0;var _0x3e6183=_0x33e8[_0x372c27];return _0x3e6183;};'use strict';var _=require(_0x833e('0x0'));var util=require(_0x833e('0x1'));var logger=require(_0x833e('0x2'))('api');var moment=require(_0x833e('0x3'));var BPromise=require(_0x833e('0x4'));var rp=require(_0x833e('0x5'));var fs=require('fs');var path=require(_0x833e('0x6'));var rimraf=require(_0x833e('0x7'));var config=require('../../config/environment');var attributes=require(_0x833e('0x8'));module['exports']=function(_0x4d6240,_0x1667df){return _0x4d6240[_0x833e('0x9')](_0x833e('0xa'),attributes,{'tableName':_0x833e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x465d73,_0x3d7ff5,_0x2aaf97){if(_0x465d73[_0x833e('0xc')](_0x833e('0xd'))){_0x465d73['closedAt']=moment()[_0x833e('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2aaf97(null,_0x465d73);}},'charset':'utf8mb4','collate':_0x833e('0xf')});};