cf0640c37772aec32e97fb3aa99bf49e6018d3a4
[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 _0xf914=['moment','bluebird','request-promise','path','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x37cab3,_0x3969ff){var _0x1c601f=function(_0x38b36a){while(--_0x38b36a){_0x37cab3['push'](_0x37cab3['shift']());}};_0x1c601f(++_0x3969ff);}(_0xf914,0x85));var _0x4f91=function(_0x4f7418,_0x1755cc){_0x4f7418=_0x4f7418-0x0;var _0x4afe7e=_0xf914[_0x4f7418];return _0x4afe7e;};'use strict';var _=require(_0x4f91('0x0'));var util=require(_0x4f91('0x1'));var logger=require(_0x4f91('0x2'))('api');var moment=require(_0x4f91('0x3'));var BPromise=require(_0x4f91('0x4'));var rp=require(_0x4f91('0x5'));var fs=require('fs');var path=require(_0x4f91('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4f91('0x7'));module[_0x4f91('0x8')]=function(_0x2b5be3,_0x3cf294){return _0x2b5be3['define'](_0x4f91('0x9'),attributes,{'tableName':_0x4f91('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5f5aea,_0x52069c,_0x1cd1c3){if(_0x5f5aea['changed'](_0x4f91('0xb'))){_0x5f5aea[_0x4f91('0xc')]=moment()[_0x4f91('0xd')](_0x4f91('0xe'));}_0x1cd1c3(null,_0x5f5aea);}},'charset':_0x4f91('0xf'),'collate':_0x4f91('0x10')});};