Built motion from commit bab6f49e.|2.6.17
[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 _0x8c8a=['bluebird','path','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','api'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x8c8a,0x74));var _0xa8c8=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0x8c8a[_0x272638];return _0x19d027;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa8c8('0x0'));var moment=require('moment');var BPromise=require(_0xa8c8('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa8c8('0x2'));var rimraf=require('rimraf');var config=require(_0xa8c8('0x3'));var attributes=require(_0xa8c8('0x4'));module[_0xa8c8('0x5')]=function(_0x1bdf20,_0x29beb3){return _0x1bdf20['define'](_0xa8c8('0x6'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x22f476,_0x37725a,_0x4885b3){if(_0x22f476[_0xa8c8('0x7')](_0xa8c8('0x8'))){_0x22f476['closedAt']=moment()[_0xa8c8('0x9')](_0xa8c8('0xa'));}_0x4885b3(null,_0x22f476);}},'charset':_0xa8c8('0xb'),'collate':_0xa8c8('0xc')});};