103013be634d6077182f2ce2329df57c567eb499
[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 _0x7d9f=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','openchannel_interactions','closed','closedAt','lodash','util'];(function(_0x163d69,_0x15600c){var _0x471be9=function(_0x19dfdd){while(--_0x19dfdd){_0x163d69['push'](_0x163d69['shift']());}};_0x471be9(++_0x15600c);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x50f382,_0x32473c){_0x50f382=_0x50f382-0x0;var _0x16afda=_0x7d9f[_0x50f382];return _0x16afda;};'use strict';var _=require(_0xf7d9('0x0'));var util=require(_0xf7d9('0x1'));var logger=require(_0xf7d9('0x2'))(_0xf7d9('0x3'));var moment=require(_0xf7d9('0x4'));var BPromise=require('bluebird');var rp=require(_0xf7d9('0x5'));var fs=require('fs');var path=require(_0xf7d9('0x6'));var rimraf=require(_0xf7d9('0x7'));var config=require(_0xf7d9('0x8'));var attributes=require(_0xf7d9('0x9'));module['exports']=function(_0x4b50c7,_0x2eb0f1){return _0x4b50c7[_0xf7d9('0xa')]('OpenchannelInteraction',attributes,{'tableName':_0xf7d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1685a6,_0x5e4087,_0x572d51){if(_0x1685a6['changed'](_0xf7d9('0xc'))){_0x1685a6[_0xf7d9('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x572d51(null,_0x1685a6);}}});};