380ec2149abf493a2a24d60a9f4b3aae82bad4b4
[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 _0x4818=['exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./openchannelInteraction.attributes'];(function(_0x4f4621,_0x4902ce){var _0x43e2e4=function(_0x49d5db){while(--_0x49d5db){_0x4f4621['push'](_0x4f4621['shift']());}};_0x43e2e4(++_0x4902ce);}(_0x4818,0x158));var _0x8481=function(_0x4f37f7,_0x5de9db){_0x4f37f7=_0x4f37f7-0x0;var _0x459b87=_0x4818[_0x4f37f7];return _0x459b87;};'use strict';var _=require(_0x8481('0x0'));var util=require(_0x8481('0x1'));var logger=require(_0x8481('0x2'))('api');var moment=require(_0x8481('0x3'));var BPromise=require(_0x8481('0x4'));var rp=require(_0x8481('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8481('0x6'));var attributes=require(_0x8481('0x7'));module[_0x8481('0x8')]=function(_0x22ff04,_0x33d4f7){return _0x22ff04['define'](_0x8481('0x9'),attributes,{'tableName':_0x8481('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8481('0xb'),'collate':_0x8481('0xc'),'hooks':{'beforeUpdate':function(_0xd61670,_0x40f32c,_0x541fe5){if(_0xd61670[_0x8481('0xd')](_0x8481('0xe'))){_0xd61670['closedAt']=moment()[_0x8481('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x541fe5(null,_0xd61670);}}});};