a983264b081f9970cc02bfbfe63905b5ba38e0e8
[motion2.git] / server / api / openchannelInteraction / openchannelInteraction.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 _0xf899=['path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','../../config/logger','moment','request-promise'];(function(_0x150903,_0x378aab){var _0x5bbc72=function(_0x17a385){while(--_0x17a385){_0x150903['push'](_0x150903['shift']());}};_0x5bbc72(++_0x378aab);}(_0xf899,0x19d));var _0x9f89=function(_0x2a56e4,_0x3fc413){_0x2a56e4=_0x2a56e4-0x0;var _0x39bc0e=_0xf899[_0x2a56e4];return _0x39bc0e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9f89('0x0'))('api');var moment=require(_0x9f89('0x1'));var BPromise=require('bluebird');var rp=require(_0x9f89('0x2'));var fs=require('fs');var path=require(_0x9f89('0x3'));var rimraf=require(_0x9f89('0x4'));var config=require(_0x9f89('0x5'));var attributes=require(_0x9f89('0x6'));module[_0x9f89('0x7')]=function(_0x56b324,_0x45349f){return _0x56b324[_0x9f89('0x8')](_0x9f89('0x9'),attributes,{'tableName':_0x9f89('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9f89('0xb'),'collate':_0x9f89('0xc'),'hooks':{'beforeUpdate':function(_0x44ba59,_0x1fbd3f,_0x167524){if(_0x44ba59[_0x9f89('0xd')](_0x9f89('0xe'))){_0x44ba59['closedAt']=moment()[_0x9f89('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x167524(null,_0x44ba59);}}});};