Built motion from commit (unavailable).|2.5.14
[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 _0xf1df=['closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed'];(function(_0x5a5aca,_0x368fbb){var _0x1cb523=function(_0x43f690){while(--_0x43f690){_0x5a5aca['push'](_0x5a5aca['shift']());}};_0x1cb523(++_0x368fbb);}(_0xf1df,0x136));var _0xff1d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xf1df[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xff1d('0x0'));var util=require('util');var logger=require(_0xff1d('0x1'))(_0xff1d('0x2'));var moment=require(_0xff1d('0x3'));var BPromise=require(_0xff1d('0x4'));var rp=require(_0xff1d('0x5'));var fs=require('fs');var path=require(_0xff1d('0x6'));var rimraf=require(_0xff1d('0x7'));var config=require(_0xff1d('0x8'));var attributes=require('./chatInteraction.attributes');module[_0xff1d('0x9')]=function(_0x2dcf99,_0x13a293){return _0x2dcf99[_0xff1d('0xa')](_0xff1d('0xb'),attributes,{'tableName':_0xff1d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x150d0b,_0x50825e,_0x49823a){if(_0x150d0b[_0xff1d('0xd')]('closed')){_0x150d0b[_0xff1d('0xe')]=moment()['format'](_0xff1d('0xf'));}_0x49823a(null,_0x150d0b);}},'charset':_0xff1d('0x10'),'collate':_0xff1d('0x11')});};