Built motion from commit b5996064.|2.6.21
[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 _0xebdd=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','./chatInteraction.attributes','exports','define','chat_interactions','closedAt'];(function(_0x42d1f8,_0x22e529){var _0x40d234=function(_0xd59b57){while(--_0xd59b57){_0x42d1f8['push'](_0x42d1f8['shift']());}};_0x40d234(++_0x22e529);}(_0xebdd,0xc4));var _0xdebd=function(_0x5bc5fe,_0x2afaef){_0x5bc5fe=_0x5bc5fe-0x0;var _0x298ea7=_0xebdd[_0x5bc5fe];return _0x298ea7;};'use strict';var _=require(_0xdebd('0x0'));var util=require(_0xdebd('0x1'));var logger=require(_0xdebd('0x2'))(_0xdebd('0x3'));var moment=require('moment');var BPromise=require(_0xdebd('0x4'));var rp=require(_0xdebd('0x5'));var fs=require('fs');var path=require(_0xdebd('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdebd('0x7'));module[_0xdebd('0x8')]=function(_0x13f5ae,_0x52abc5){return _0x13f5ae[_0xdebd('0x9')]('ChatInteraction',attributes,{'tableName':_0xdebd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5d7f15,_0x50a731,_0x37b332){if(_0x5d7f15['changed']('closed')){_0x5d7f15[_0xdebd('0xb')]=moment()[_0xdebd('0xc')](_0xdebd('0xd'));}_0x37b332(null,_0x5d7f15);}},'charset':_0xdebd('0xe'),'collate':_0xdebd('0xf')});};