Built motion from commit 9d1906d1.|2.5.40
[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 _0x45aa=['request-promise','path','rimraf','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','moment','bluebird'];(function(_0x43474e,_0x483faa){var _0x3db1d4=function(_0x47fbc0){while(--_0x47fbc0){_0x43474e['push'](_0x43474e['shift']());}};_0x3db1d4(++_0x483faa);}(_0x45aa,0x9b));var _0xa45a=function(_0x6181a4,_0x3df1e7){_0x6181a4=_0x6181a4-0x0;var _0x263199=_0x45aa[_0x6181a4];return _0x263199;};'use strict';var _=require(_0xa45a('0x0'));var util=require(_0xa45a('0x1'));var logger=require(_0xa45a('0x2'))('api');var moment=require(_0xa45a('0x3'));var BPromise=require(_0xa45a('0x4'));var rp=require(_0xa45a('0x5'));var fs=require('fs');var path=require(_0xa45a('0x6'));var rimraf=require(_0xa45a('0x7'));var config=require('../../config/environment');var attributes=require(_0xa45a('0x8'));module['exports']=function(_0x20c0e4,_0xc3e35c){return _0x20c0e4[_0xa45a('0x9')](_0xa45a('0xa'),attributes,{'tableName':_0xa45a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1fba5f,_0x21e48b,_0x43a78f){if(_0x1fba5f[_0xa45a('0xc')]('closed')){_0x1fba5f['closedAt']=moment()[_0xa45a('0xd')](_0xa45a('0xe'));}_0x43a78f(null,_0x1fba5f);}},'charset':_0xa45a('0xf'),'collate':'utf8mb4_unicode_ci'});};