07e30e88b850f0b35e0eae3c1ba076838fcbafb6
[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 _0x6104=['request-promise','path','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird'];(function(_0x40c9fd,_0x44691d){var _0x78f1c2=function(_0x3db1c1){while(--_0x3db1c1){_0x40c9fd['push'](_0x40c9fd['shift']());}};_0x78f1c2(++_0x44691d);}(_0x6104,0x187));var _0x4610=function(_0x3a7fe5,_0x371426){_0x3a7fe5=_0x3a7fe5-0x0;var _0x18ed66=_0x6104[_0x3a7fe5];return _0x18ed66;};'use strict';var _=require('lodash');var util=require(_0x4610('0x0'));var logger=require(_0x4610('0x1'))(_0x4610('0x2'));var moment=require(_0x4610('0x3'));var BPromise=require(_0x4610('0x4'));var rp=require(_0x4610('0x5'));var fs=require('fs');var path=require(_0x4610('0x6'));var rimraf=require('rimraf');var config=require(_0x4610('0x7'));var attributes=require(_0x4610('0x8'));module[_0x4610('0x9')]=function(_0x2a7ec3,_0x4afb65){return _0x2a7ec3['define'](_0x4610('0xa'),attributes,{'tableName':_0x4610('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x427470,_0x153c28,_0x4af7f4){if(_0x427470[_0x4610('0xc')](_0x4610('0xd'))){_0x427470['closedAt']=moment()[_0x4610('0xe')](_0x4610('0xf'));}_0x4af7f4(null,_0x427470);}},'charset':_0x4610('0x10'),'collate':_0x4610('0x11')});};