Built motion from commit b0a9a629.|2.6.33
[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 _0x17bf=['api','moment','bluebird','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x3ee1a1,_0x28152b){var _0x166cb1=function(_0x3d6c9e){while(--_0x3d6c9e){_0x3ee1a1['push'](_0x3ee1a1['shift']());}};_0x166cb1(++_0x28152b);}(_0x17bf,0x11d));var _0xf17b=function(_0x5ce650,_0x5c377a){_0x5ce650=_0x5ce650-0x0;var _0x1eadbd=_0x17bf[_0x5ce650];return _0x1eadbd;};'use strict';var _=require(_0xf17b('0x0'));var util=require(_0xf17b('0x1'));var logger=require(_0xf17b('0x2'))(_0xf17b('0x3'));var moment=require(_0xf17b('0x4'));var BPromise=require(_0xf17b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf17b('0x6'));var config=require(_0xf17b('0x7'));var attributes=require(_0xf17b('0x8'));module[_0xf17b('0x9')]=function(_0x209017,_0x4635f7){return _0x209017['define'](_0xf17b('0xa'),attributes,{'tableName':_0xf17b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf17b('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x25b76c,_0x4d8de2,_0xa953c1){if(_0x25b76c['changed'](_0xf17b('0xd'))){_0x25b76c['closedAt']=moment()[_0xf17b('0xe')](_0xf17b('0xf'));}_0xa953c1(null,_0x25b76c);}}});};