Built motion from commit ddca4d0d.|2.5.47
[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 _0xf060=['api','moment','request-promise','path','../../config/environment','exports','ChatInteraction','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x303bb7,_0x133a10){var _0x4bb939=function(_0xdf137){while(--_0xdf137){_0x303bb7['push'](_0x303bb7['shift']());}};_0x4bb939(++_0x133a10);}(_0xf060,0x1c8));var _0x0f06=function(_0x4fb570,_0x4236b4){_0x4fb570=_0x4fb570-0x0;var _0x5d9448=_0xf060[_0x4fb570];return _0x5d9448;};'use strict';var _=require(_0x0f06('0x0'));var util=require(_0x0f06('0x1'));var logger=require(_0x0f06('0x2'))(_0x0f06('0x3'));var moment=require(_0x0f06('0x4'));var BPromise=require('bluebird');var rp=require(_0x0f06('0x5'));var fs=require('fs');var path=require(_0x0f06('0x6'));var rimraf=require('rimraf');var config=require(_0x0f06('0x7'));var attributes=require('./chatInteraction.attributes');module[_0x0f06('0x8')]=function(_0x50ed43,_0x75b216){return _0x50ed43['define'](_0x0f06('0x9'),attributes,{'tableName':_0x0f06('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a97e1,_0x1e5a85,_0x4e7b45){if(_0x5a97e1[_0x0f06('0xb')](_0x0f06('0xc'))){_0x5a97e1[_0x0f06('0xd')]=moment()['format'](_0x0f06('0xe'));}_0x4e7b45(null,_0x5a97e1);}},'charset':_0x0f06('0xf'),'collate':_0x0f06('0x10')});};