Built motion from commit 85328c08.|2.5.50
[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 _0x7bb9=['OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','path','./openchannelInteraction.attributes','exports','define'];(function(_0x3e308a,_0x445fea){var _0x836ce6=function(_0x765f81){while(--_0x765f81){_0x3e308a['push'](_0x3e308a['shift']());}};_0x836ce6(++_0x445fea);}(_0x7bb9,0x158));var _0x97bb=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x7bb9[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0x97bb('0x0'));var util=require('util');var logger=require(_0x97bb('0x1'))(_0x97bb('0x2'));var moment=require('moment');var BPromise=require(_0x97bb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x97bb('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x97bb('0x5'));module[_0x97bb('0x6')]=function(_0xee1968,_0x4b71f4){return _0xee1968[_0x97bb('0x7')](_0x97bb('0x8'),attributes,{'tableName':_0x97bb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x97bb('0xa'),'collate':_0x97bb('0xb'),'hooks':{'beforeUpdate':function(_0x1ba081,_0x417e5e,_0x3285ff){if(_0x1ba081[_0x97bb('0xc')](_0x97bb('0xd'))){_0x1ba081['closedAt']=moment()[_0x97bb('0xe')](_0x97bb('0xf'));}_0x3285ff(null,_0x1ba081);}}});};