514048e687ce79e2bff9dc14f1cdb25144156254
[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 _0x8610=['utf8mb4_unicode_ci','changed','closed','format','lodash','util','../../config/logger','moment','bluebird','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4'];(function(_0x2e54d4,_0xe00383){var _0x4fd99e=function(_0x2e0fa8){while(--_0x2e0fa8){_0x2e54d4['push'](_0x2e54d4['shift']());}};_0x4fd99e(++_0xe00383);}(_0x8610,0x154));var _0x0861=function(_0x3f2ba3,_0x1452c4){_0x3f2ba3=_0x3f2ba3-0x0;var _0x486246=_0x8610[_0x3f2ba3];return _0x486246;};'use strict';var _=require(_0x0861('0x0'));var util=require(_0x0861('0x1'));var logger=require(_0x0861('0x2'))('api');var moment=require(_0x0861('0x3'));var BPromise=require(_0x0861('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0861('0x5'));var config=require('../../config/environment');var attributes=require(_0x0861('0x6'));module[_0x0861('0x7')]=function(_0x5b4426,_0x53612b){return _0x5b4426[_0x0861('0x8')](_0x0861('0x9'),attributes,{'tableName':_0x0861('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0861('0xb'),'collate':_0x0861('0xc'),'hooks':{'beforeUpdate':function(_0x5c9185,_0x5a4e4a,_0x2655d1){if(_0x5c9185[_0x0861('0xd')](_0x0861('0xe'))){_0x5c9185['closedAt']=moment()[_0x0861('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2655d1(null,_0x5c9185);}}});};