ffe2c1fbdc3806e5ca75bacd80f5634a0c3da9e7
[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 _0x25c3=['chat_interactions','changed','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','ChatInteraction'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x25c3,0xab));var _0x325c=function(_0x5b23bc,_0x6d992c){_0x5b23bc=_0x5b23bc-0x0;var _0x26feac=_0x25c3[_0x5b23bc];return _0x26feac;};'use strict';var _=require(_0x325c('0x0'));var util=require(_0x325c('0x1'));var logger=require(_0x325c('0x2'))(_0x325c('0x3'));var moment=require('moment');var BPromise=require(_0x325c('0x4'));var rp=require(_0x325c('0x5'));var fs=require('fs');var path=require(_0x325c('0x6'));var rimraf=require(_0x325c('0x7'));var config=require(_0x325c('0x8'));var attributes=require(_0x325c('0x9'));module['exports']=function(_0x5277b0,_0x3ca615){return _0x5277b0['define'](_0x325c('0xa'),attributes,{'tableName':_0x325c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5196fb,_0x5b81e2,_0x2ca013){if(_0x5196fb[_0x325c('0xc')]('closed')){_0x5196fb['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x2ca013(null,_0x5196fb);}},'charset':_0x325c('0xd'),'collate':'utf8mb4_unicode_ci'});};