Built motion from commit (unavailable).|2.4.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 _0x6f8a=['format','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','path','rimraf','../../config/environment','changed','closed','closedAt'];(function(_0x195729,_0xe3522a){var _0xe315f9=function(_0x4987b4){while(--_0x4987b4){_0x195729['push'](_0x195729['shift']());}};_0xe315f9(++_0xe3522a);}(_0x6f8a,0x1b0));var _0xa6f8=function(_0x546264,_0x32b3a7){_0x546264=_0x546264-0x0;var _0x1c5fed=_0x6f8a[_0x546264];return _0x1c5fed;};'use strict';var _=require('lodash');var util=require(_0xa6f8('0x0'));var logger=require(_0xa6f8('0x1'))(_0xa6f8('0x2'));var moment=require(_0xa6f8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6f8('0x4'));var rimraf=require(_0xa6f8('0x5'));var config=require(_0xa6f8('0x6'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x64dbb1,_0x4e877d){return _0x64dbb1['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x213526,_0x4da9cc,_0xcd1d11){if(_0x213526[_0xa6f8('0x7')](_0xa6f8('0x8'))){_0x213526[_0xa6f8('0x9')]=moment()[_0xa6f8('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0xcd1d11(null,_0x213526);}},'charset':_0xa6f8('0xb'),'collate':_0xa6f8('0xc')});};