d84e0ac18576fba0c575305a7f1477a68cebfa41
[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 _0x48ce=['rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x193b5e,_0x47526f){var _0x1442ba=function(_0x1be9cc){while(--_0x1be9cc){_0x193b5e['push'](_0x193b5e['shift']());}};_0x1442ba(++_0x47526f);}(_0x48ce,0xae));var _0xe48c=function(_0x3e80ff,_0x2a05e3){_0x3e80ff=_0x3e80ff-0x0;var _0x520ca9=_0x48ce[_0x3e80ff];return _0x520ca9;};'use strict';var _=require(_0xe48c('0x0'));var util=require(_0xe48c('0x1'));var logger=require(_0xe48c('0x2'))('api');var moment=require(_0xe48c('0x3'));var BPromise=require(_0xe48c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe48c('0x5'));var rimraf=require(_0xe48c('0x6'));var config=require('../../config/environment');var attributes=require(_0xe48c('0x7'));module[_0xe48c('0x8')]=function(_0x3c179b,_0x4b2799){return _0x3c179b[_0xe48c('0x9')](_0xe48c('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x35fbcb,_0x2600c2,_0x31222c){if(_0x35fbcb[_0xe48c('0xb')](_0xe48c('0xc'))){_0x35fbcb[_0xe48c('0xd')]=moment()[_0xe48c('0xe')](_0xe48c('0xf'));}_0x31222c(null,_0x35fbcb);}},'charset':_0xe48c('0x10'),'collate':_0xe48c('0x11')});};