ffc8194078126abaf871f601b0d445e90e46dcac
[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 _0x2c12=['path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4','changed','closed','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xbbf68e,_0x39b9b4){var _0x26363c=function(_0xf637ae){while(--_0xf637ae){_0xbbf68e['push'](_0xbbf68e['shift']());}};_0x26363c(++_0x39b9b4);}(_0x2c12,0x1bb));var _0x22c1=function(_0x2e4cbf,_0x8763d3){_0x2e4cbf=_0x2e4cbf-0x0;var _0x52840f=_0x2c12[_0x2e4cbf];return _0x52840f;};'use strict';var _=require(_0x22c1('0x0'));var util=require(_0x22c1('0x1'));var logger=require(_0x22c1('0x2'))(_0x22c1('0x3'));var moment=require(_0x22c1('0x4'));var BPromise=require(_0x22c1('0x5'));var rp=require(_0x22c1('0x6'));var fs=require('fs');var path=require(_0x22c1('0x7'));var rimraf=require('rimraf');var config=require(_0x22c1('0x8'));var attributes=require(_0x22c1('0x9'));module[_0x22c1('0xa')]=function(_0x4d137f,_0x3e9d43){return _0x4d137f[_0x22c1('0xb')](_0x22c1('0xc'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x22c1('0xd'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0xa91abd,_0x402002,_0x31ed9c){if(_0xa91abd[_0x22c1('0xe')](_0x22c1('0xf'))){_0xa91abd[_0x22c1('0x10')]=moment()[_0x22c1('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x31ed9c(null,_0xa91abd);}}});};