ebf90674d22df438591993460b4f22adc66cae0c
[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 _0x8b7c=['path','rimraf','../../config/environment','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','bluebird','request-promise'];(function(_0x331890,_0x4a92ed){var _0xc228ef=function(_0x34f900){while(--_0x34f900){_0x331890['push'](_0x331890['shift']());}};_0xc228ef(++_0x4a92ed);}(_0x8b7c,0x1a4));var _0xc8b7=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x8b7c[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0xc8b7('0x0'));var util=require(_0xc8b7('0x1'));var logger=require('../../config/logger')(_0xc8b7('0x2'));var moment=require('moment');var BPromise=require(_0xc8b7('0x3'));var rp=require(_0xc8b7('0x4'));var fs=require('fs');var path=require(_0xc8b7('0x5'));var rimraf=require(_0xc8b7('0x6'));var config=require(_0xc8b7('0x7'));var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x5e3aa9,_0x3f0864){return _0x5e3aa9[_0xc8b7('0x8')](_0xc8b7('0x9'),attributes,{'tableName':_0xc8b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc8b7('0xb'),'collate':_0xc8b7('0xc'),'hooks':{'beforeUpdate':function(_0x29975a,_0x3a5176,_0x4a57d5){if(_0x29975a['changed'](_0xc8b7('0xd'))){_0x29975a[_0xc8b7('0xe')]=moment()[_0xc8b7('0xf')](_0xc8b7('0x10'));}_0x4a57d5(null,_0x29975a);}}});};