58dbb23250e6e8046b07708b57fb9c8992904ceb
[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 _0xf179=['define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./openchannelInteraction.attributes','exports'];(function(_0x3c18b7,_0x21cb07){var _0x3d38b3=function(_0x16b659){while(--_0x16b659){_0x3c18b7['push'](_0x3c18b7['shift']());}};_0x3d38b3(++_0x21cb07);}(_0xf179,0x87));var _0x9f17=function(_0x18fd88,_0x484f5d){_0x18fd88=_0x18fd88-0x0;var _0x166b50=_0xf179[_0x18fd88];return _0x166b50;};'use strict';var _=require(_0x9f17('0x0'));var util=require(_0x9f17('0x1'));var logger=require(_0x9f17('0x2'))('api');var moment=require(_0x9f17('0x3'));var BPromise=require(_0x9f17('0x4'));var rp=require(_0x9f17('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f17('0x6'));var config=require('../../config/environment');var attributes=require(_0x9f17('0x7'));module[_0x9f17('0x8')]=function(_0x3f0c03,_0x294f76){return _0x3f0c03[_0x9f17('0x9')](_0x9f17('0xa'),attributes,{'tableName':_0x9f17('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9f17('0xc'),'collate':_0x9f17('0xd'),'hooks':{'beforeUpdate':function(_0x4822d1,_0x50ba76,_0x386dae){if(_0x4822d1[_0x9f17('0xe')](_0x9f17('0xf'))){_0x4822d1[_0x9f17('0x10')]=moment()[_0x9f17('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x386dae(null,_0x4822d1);}}});};