b1fe874a8cd6f862601d757a57c66204efd7988a
[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 _0x830f=['OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define'];(function(_0x5b6e79,_0x49c798){var _0xd9b5c4=function(_0xa49305){while(--_0xa49305){_0x5b6e79['push'](_0x5b6e79['shift']());}};_0xd9b5c4(++_0x49c798);}(_0x830f,0x1a0));var _0xf830=function(_0x1eb530,_0x31c251){_0x1eb530=_0x1eb530-0x0;var _0xd0cc83=_0x830f[_0x1eb530];return _0xd0cc83;};'use strict';var _=require(_0xf830('0x0'));var util=require(_0xf830('0x1'));var logger=require(_0xf830('0x2'))(_0xf830('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf830('0x4'));var config=require(_0xf830('0x5'));var attributes=require(_0xf830('0x6'));module[_0xf830('0x7')]=function(_0x28b3a0,_0x2bfaf9){return _0x28b3a0[_0xf830('0x8')](_0xf830('0x9'),attributes,{'tableName':_0xf830('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf830('0xb'),'collate':_0xf830('0xc'),'hooks':{'beforeUpdate':function(_0xd443c4,_0xb43918,_0x5b8516){if(_0xd443c4[_0xf830('0xd')]('closed')){_0xd443c4[_0xf830('0xe')]=moment()[_0xf830('0xf')](_0xf830('0x10'));}_0x5b8516(null,_0xd443c4);}}});};