bdf9d6562dec3b148081fda5bb9d1fef93e95f00
[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 _0xc000=['rimraf','./openchannelInteraction.attributes','define','openchannel_interactions','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','bluebird','request-promise','path'];(function(_0x2eaf86,_0x3b5598){var _0x163af7=function(_0x3b17eb){while(--_0x3b17eb){_0x2eaf86['push'](_0x2eaf86['shift']());}};_0x163af7(++_0x3b5598);}(_0xc000,0x1cb));var _0x0c00=function(_0x5172f6,_0x158bfc){_0x5172f6=_0x5172f6-0x0;var _0x49a099=_0xc000[_0x5172f6];return _0x49a099;};'use strict';var _=require(_0x0c00('0x0'));var util=require(_0x0c00('0x1'));var logger=require('../../config/logger')(_0x0c00('0x2'));var moment=require('moment');var BPromise=require(_0x0c00('0x3'));var rp=require(_0x0c00('0x4'));var fs=require('fs');var path=require(_0x0c00('0x5'));var rimraf=require(_0x0c00('0x6'));var config=require('../../config/environment');var attributes=require(_0x0c00('0x7'));module['exports']=function(_0x3e1c46,_0x227d5a){return _0x3e1c46[_0x0c00('0x8')]('OpenchannelInteraction',attributes,{'tableName':_0x0c00('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0c00('0xa'),'hooks':{'beforeUpdate':function(_0x3f3d37,_0x289c45,_0x4b3781){if(_0x3f3d37[_0x0c00('0xb')]('closed')){_0x3f3d37[_0x0c00('0xc')]=moment()[_0x0c00('0xd')](_0x0c00('0xe'));}_0x4b3781(null,_0x3f3d37);}}});};