Built motion from commit b5413ace.|2.6.9
[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 _0x1204=['../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x1204,0x1d5));var _0x4120=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x1204[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x4120('0x0'));var util=require(_0x4120('0x1'));var logger=require(_0x4120('0x2'))(_0x4120('0x3'));var moment=require('moment');var BPromise=require(_0x4120('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4120('0x5'));var rimraf=require(_0x4120('0x6'));var config=require(_0x4120('0x7'));var attributes=require(_0x4120('0x8'));module[_0x4120('0x9')]=function(_0x27450c,_0x384476){return _0x27450c[_0x4120('0xa')](_0x4120('0xb'),attributes,{'tableName':_0x4120('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4120('0xd'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0xd0dfcb,_0x2bf8ff,_0xf5c79b){if(_0xd0dfcb['changed']('closed')){_0xd0dfcb[_0x4120('0xe')]=moment()[_0x4120('0xf')](_0x4120('0x10'));}_0xf5c79b(null,_0xd0dfcb);}}});};