Built motion from commit fe909640.|2.6.8
[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 _0xd263=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0xe1d496,_0x5f4c37){var _0xd47519=function(_0x15c2bd){while(--_0x15c2bd){_0xe1d496['push'](_0xe1d496['shift']());}};_0xd47519(++_0x5f4c37);}(_0xd263,0xb3));var _0x3d26=function(_0x5f04b0,_0x190598){_0x5f04b0=_0x5f04b0-0x0;var _0x168eb3=_0xd263[_0x5f04b0];return _0x168eb3;};'use strict';var _=require(_0x3d26('0x0'));var util=require(_0x3d26('0x1'));var logger=require(_0x3d26('0x2'))(_0x3d26('0x3'));var moment=require(_0x3d26('0x4'));var BPromise=require('bluebird');var rp=require(_0x3d26('0x5'));var fs=require('fs');var path=require(_0x3d26('0x6'));var rimraf=require(_0x3d26('0x7'));var config=require(_0x3d26('0x8'));var attributes=require(_0x3d26('0x9'));module[_0x3d26('0xa')]=function(_0x4a6baf,_0x5495f9){return _0x4a6baf['define'](_0x3d26('0xb'),attributes,{'tableName':_0x3d26('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3d26('0xd'),'hooks':{'beforeUpdate':function(_0x38e918,_0x2a5938,_0x535a8a){if(_0x38e918[_0x3d26('0xe')]('closed')){_0x38e918[_0x3d26('0xf')]=moment()[_0x3d26('0x10')](_0x3d26('0x11'));}_0x535a8a(null,_0x38e918);}}});};