0450ed0b36c6d905ba50963b20193982a71a0ab5
[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 _0xf166=['../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','path','rimraf'];(function(_0xb23e57,_0x5d73f6){var _0x43c8be=function(_0x4a0987){while(--_0x4a0987){_0xb23e57['push'](_0xb23e57['shift']());}};_0x43c8be(++_0x5d73f6);}(_0xf166,0x82));var _0x6f16=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf166[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x6f16('0x0'));var logger=require('../../config/logger')(_0x6f16('0x1'));var moment=require(_0x6f16('0x2'));var BPromise=require(_0x6f16('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f16('0x4'));var rimraf=require(_0x6f16('0x5'));var config=require(_0x6f16('0x6'));var attributes=require(_0x6f16('0x7'));module[_0x6f16('0x8')]=function(_0x3c44c3,_0x500433){return _0x3c44c3['define'](_0x6f16('0x9'),attributes,{'tableName':_0x6f16('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4f09a2,_0x3f1751,_0xc1407c){if(_0x4f09a2[_0x6f16('0xb')](_0x6f16('0xc'))){_0x4f09a2[_0x6f16('0xd')]=moment()[_0x6f16('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0xc1407c(null,_0x4f09a2);}},'charset':_0x6f16('0xf'),'collate':_0x6f16('0x10')});};