2679c6f6fadf29541f827d25a6b82c7cadf582ed
[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 _0x003c=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','path','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format'];(function(_0x1c4b0f,_0xf620de){var _0x436ccb=function(_0x22d716){while(--_0x22d716){_0x1c4b0f['push'](_0x1c4b0f['shift']());}};_0x436ccb(++_0xf620de);}(_0x003c,0x161));var _0xc003=function(_0x359e3f,_0x308b08){_0x359e3f=_0x359e3f-0x0;var _0x34e948=_0x003c[_0x359e3f];return _0x34e948;};'use strict';var _=require(_0xc003('0x0'));var util=require(_0xc003('0x1'));var logger=require(_0xc003('0x2'))('api');var moment=require(_0xc003('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc003('0x4'));var rimraf=require('rimraf');var config=require(_0xc003('0x5'));var attributes=require(_0xc003('0x6'));module[_0xc003('0x7')]=function(_0x4ae3ea,_0x20eb1b){return _0x4ae3ea['define'](_0xc003('0x8'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc003('0x9'),'collate':_0xc003('0xa'),'hooks':{'beforeUpdate':function(_0x7ccf0,_0x4a28c6,_0x4703ad){if(_0x7ccf0[_0xc003('0xb')](_0xc003('0xc'))){_0x7ccf0[_0xc003('0xd')]=moment()[_0xc003('0xe')](_0xc003('0xf'));}_0x4703ad(null,_0x7ccf0);}}});};