ad1d8110373e0debb98aa3fb97dc78392d76c556
[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 _0x1f28=['ChatInteraction','chat_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5742d0,_0x2496b3){var _0x5265fc=function(_0x1f8144){while(--_0x1f8144){_0x5742d0['push'](_0x5742d0['shift']());}};_0x5265fc(++_0x2496b3);}(_0x1f28,0x1af));var _0x81f2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1f28[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x81f2('0x0'));var logger=require(_0x81f2('0x1'))(_0x81f2('0x2'));var moment=require(_0x81f2('0x3'));var BPromise=require(_0x81f2('0x4'));var rp=require(_0x81f2('0x5'));var fs=require('fs');var path=require(_0x81f2('0x6'));var rimraf=require(_0x81f2('0x7'));var config=require(_0x81f2('0x8'));var attributes=require('./chatInteraction.attributes');module[_0x81f2('0x9')]=function(_0x2612fd,_0x363619){return _0x2612fd[_0x81f2('0xa')](_0x81f2('0xb'),attributes,{'tableName':_0x81f2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x10fbf2,_0xa8f0b7,_0x306385){if(_0x10fbf2[_0x81f2('0xd')](_0x81f2('0xe'))){_0x10fbf2['closedAt']=moment()['format'](_0x81f2('0xf'));}_0x306385(null,_0x10fbf2);}},'charset':_0x81f2('0x10'),'collate':'utf8mb4_unicode_ci'});};