0491a07510caee3cdc5608f3098be03279f531c0
[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 _0x42f0=['request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x540e12,_0x4a993f){var _0x5e4e6b=function(_0xbc100d){while(--_0xbc100d){_0x540e12['push'](_0x540e12['shift']());}};_0x5e4e6b(++_0x4a993f);}(_0x42f0,0x1b4));var _0x042f=function(_0x54cdb6,_0x5ddf3e){_0x54cdb6=_0x54cdb6-0x0;var _0xeace0e=_0x42f0[_0x54cdb6];return _0xeace0e;};'use strict';var _=require(_0x042f('0x0'));var util=require(_0x042f('0x1'));var logger=require(_0x042f('0x2'))(_0x042f('0x3'));var moment=require(_0x042f('0x4'));var BPromise=require(_0x042f('0x5'));var rp=require(_0x042f('0x6'));var fs=require('fs');var path=require(_0x042f('0x7'));var rimraf=require('rimraf');var config=require(_0x042f('0x8'));var attributes=require(_0x042f('0x9'));module[_0x042f('0xa')]=function(_0x225e13,_0x38a588){return _0x225e13[_0x042f('0xb')](_0x042f('0xc'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x042f('0xd'),'collate':_0x042f('0xe'),'hooks':{'beforeUpdate':function(_0x5b2485,_0x5e9e66,_0x3939de){if(_0x5b2485['changed'](_0x042f('0xf'))){_0x5b2485['closedAt']=moment()['format'](_0x042f('0x10'));}_0x3939de(null,_0x5b2485);}}});};