Built motion from commit 25580385.|2.6.2
[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 _0x376e=['moment','request-promise','path','../../config/environment','./openchannelInteraction.attributes','OpenchannelInteraction','utf8mb4','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x376e,0x123));var _0xe376=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x376e[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0xe376('0x0'));var util=require('util');var logger=require(_0xe376('0x1'))(_0xe376('0x2'));var moment=require(_0xe376('0x3'));var BPromise=require('bluebird');var rp=require(_0xe376('0x4'));var fs=require('fs');var path=require(_0xe376('0x5'));var rimraf=require('rimraf');var config=require(_0xe376('0x6'));var attributes=require(_0xe376('0x7'));module['exports']=function(_0x22d155,_0x3b60e8){return _0x22d155['define'](_0xe376('0x8'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe376('0x9'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x3faee3,_0x4eb012,_0x178219){if(_0x3faee3[_0xe376('0xa')]('closed')){_0x3faee3[_0xe376('0xb')]=moment()[_0xe376('0xc')](_0xe376('0xd'));}_0x178219(null,_0x3faee3);}}});};