Built motion from commit 19a84241.|2.5.34
[motion2.git] / server / api / chatInteraction / chatInteraction.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 _0xd90b=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed'];(function(_0x383d4b,_0x530b55){var _0x5cf4e0=function(_0x340876){while(--_0x340876){_0x383d4b['push'](_0x383d4b['shift']());}};_0x5cf4e0(++_0x530b55);}(_0xd90b,0x93));var _0xbd90=function(_0x4f976c,_0x3bd1cd){_0x4f976c=_0x4f976c-0x0;var _0x517f05=_0xd90b[_0x4f976c];return _0x517f05;};'use strict';var _=require(_0xbd90('0x0'));var util=require(_0xbd90('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbd90('0x2'));var BPromise=require(_0xbd90('0x3'));var rp=require(_0xbd90('0x4'));var fs=require('fs');var path=require(_0xbd90('0x5'));var rimraf=require('rimraf');var config=require(_0xbd90('0x6'));var attributes=require(_0xbd90('0x7'));module[_0xbd90('0x8')]=function(_0x27e247,_0x3bdf10){return _0x27e247[_0xbd90('0x9')](_0xbd90('0xa'),attributes,{'tableName':_0xbd90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x10d922,_0x28ade1,_0x755d9d){if(_0x10d922[_0xbd90('0xc')]('closed')){_0x10d922[_0xbd90('0xd')]=moment()[_0xbd90('0xe')](_0xbd90('0xf'));}_0x755d9d(null,_0x10d922);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};