Built motion from commit 87cd5f02.|2.5.48
[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 _0xdf69=['chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatInteraction'];(function(_0x93cb67,_0x5b33dc){var _0x404c70=function(_0x508a73){while(--_0x508a73){_0x93cb67['push'](_0x93cb67['shift']());}};_0x404c70(++_0x5b33dc);}(_0xdf69,0xd2));var _0x9df6=function(_0x202b68,_0x437c7b){_0x202b68=_0x202b68-0x0;var _0x119ced=_0xdf69[_0x202b68];return _0x119ced;};'use strict';var _=require(_0x9df6('0x0'));var util=require(_0x9df6('0x1'));var logger=require('../../config/logger')(_0x9df6('0x2'));var moment=require(_0x9df6('0x3'));var BPromise=require(_0x9df6('0x4'));var rp=require(_0x9df6('0x5'));var fs=require('fs');var path=require(_0x9df6('0x6'));var rimraf=require(_0x9df6('0x7'));var config=require(_0x9df6('0x8'));var attributes=require('./chatInteraction.attributes');module[_0x9df6('0x9')]=function(_0x5da932,_0x46585d){return _0x5da932['define'](_0x9df6('0xa'),attributes,{'tableName':_0x9df6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x463c8f,_0x49ab2e,_0x22cbd2){if(_0x463c8f[_0x9df6('0xc')]('closed')){_0x463c8f[_0x9df6('0xd')]=moment()[_0x9df6('0xe')](_0x9df6('0xf'));}_0x22cbd2(null,_0x463c8f);}},'charset':'utf8mb4','collate':_0x9df6('0x10')});};