Built motion from commit 192134f6.|2.6.25
[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 _0x6b6b=['path','../../config/environment','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closed','closedAt','format','lodash','api','moment','request-promise'];(function(_0x184266,_0x1b43dd){var _0x878ca3=function(_0x1f99b9){while(--_0x1f99b9){_0x184266['push'](_0x184266['shift']());}};_0x878ca3(++_0x1b43dd);}(_0x6b6b,0x1a0));var _0xb6b6=function(_0x55cceb,_0x486946){_0x55cceb=_0x55cceb-0x0;var _0x496515=_0x6b6b[_0x55cceb];return _0x496515;};'use strict';var _=require(_0xb6b6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb6b6('0x1'));var moment=require(_0xb6b6('0x2'));var BPromise=require('bluebird');var rp=require(_0xb6b6('0x3'));var fs=require('fs');var path=require(_0xb6b6('0x4'));var rimraf=require('rimraf');var config=require(_0xb6b6('0x5'));var attributes=require('./openchannelInteraction.attributes');module[_0xb6b6('0x6')]=function(_0x237a1d,_0x384861){return _0x237a1d[_0xb6b6('0x7')](_0xb6b6('0x8'),attributes,{'tableName':_0xb6b6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb6b6('0xa'),'collate':_0xb6b6('0xb'),'hooks':{'beforeUpdate':function(_0x2bd1f4,_0x29ee42,_0x2ac73b){if(_0x2bd1f4['changed'](_0xb6b6('0xc'))){_0x2bd1f4[_0xb6b6('0xd')]=moment()[_0xb6b6('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2ac73b(null,_0x2bd1f4);}}});};