77e908048412473d0069e6eea33dc72a9bd98f44
[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 _0x4ec4=['utf8mb4','utf8mb4_unicode_ci','changed','closed','format','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelInteraction','openchannel_interactions'];(function(_0x5f036e,_0x5ef0da){var _0x593b9b=function(_0x45fb24){while(--_0x45fb24){_0x5f036e['push'](_0x5f036e['shift']());}};_0x593b9b(++_0x5ef0da);}(_0x4ec4,0x125));var _0x44ec=function(_0x53ddcb,_0xc1a547){_0x53ddcb=_0x53ddcb-0x0;var _0x48afdb=_0x4ec4[_0x53ddcb];return _0x48afdb;};'use strict';var _=require(_0x44ec('0x0'));var util=require(_0x44ec('0x1'));var logger=require(_0x44ec('0x2'))('api');var moment=require(_0x44ec('0x3'));var BPromise=require(_0x44ec('0x4'));var rp=require(_0x44ec('0x5'));var fs=require('fs');var path=require(_0x44ec('0x6'));var rimraf=require(_0x44ec('0x7'));var config=require(_0x44ec('0x8'));var attributes=require('./openchannelInteraction.attributes');module[_0x44ec('0x9')]=function(_0x16b97d,_0x525902){return _0x16b97d[_0x44ec('0xa')](_0x44ec('0xb'),attributes,{'tableName':_0x44ec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x44ec('0xd'),'collate':_0x44ec('0xe'),'hooks':{'beforeUpdate':function(_0x750cac,_0x11f248,_0x49beea){if(_0x750cac[_0x44ec('0xf')](_0x44ec('0x10'))){_0x750cac['closedAt']=moment()[_0x44ec('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x49beea(null,_0x750cac);}}});};