e0541a7b9c9a7d32c8548d854a990954fdad92b6
[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 _0xffc9=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed'];(function(_0x5c4f8f,_0x3e68c7){var _0x1a2e41=function(_0x19af72){while(--_0x19af72){_0x5c4f8f['push'](_0x5c4f8f['shift']());}};_0x1a2e41(++_0x3e68c7);}(_0xffc9,0xc7));var _0x9ffc=function(_0x189a28,_0x496b3b){_0x189a28=_0x189a28-0x0;var _0x3fc4f0=_0xffc9[_0x189a28];return _0x3fc4f0;};'use strict';var _=require('lodash');var util=require(_0x9ffc('0x0'));var logger=require(_0x9ffc('0x1'))(_0x9ffc('0x2'));var moment=require(_0x9ffc('0x3'));var BPromise=require(_0x9ffc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ffc('0x5'));var attributes=require(_0x9ffc('0x6'));module[_0x9ffc('0x7')]=function(_0x4d5e10,_0x4f7a6a){return _0x4d5e10['define'](_0x9ffc('0x8'),attributes,{'tableName':_0x9ffc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x456869,_0x485959,_0x3845e3){if(_0x456869[_0x9ffc('0xa')]('closed')){_0x456869['closedAt']=moment()[_0x9ffc('0xb')](_0x9ffc('0xc'));}_0x3845e3(null,_0x456869);}},'charset':_0x9ffc('0xd'),'collate':_0x9ffc('0xe')});};