b38d2a5a61ff00736b46dc476454847acbf98a90
[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 _0x41a4=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41a4,0x1e2));var _0x441a=function(_0x2adc09,_0x4ec164){_0x2adc09=_0x2adc09-0x0;var _0x4c0033=_0x41a4[_0x2adc09];return _0x4c0033;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x441a('0x0'));var moment=require(_0x441a('0x1'));var BPromise=require(_0x441a('0x2'));var rp=require(_0x441a('0x3'));var fs=require('fs');var path=require(_0x441a('0x4'));var rimraf=require(_0x441a('0x5'));var config=require(_0x441a('0x6'));var attributes=require(_0x441a('0x7'));module['exports']=function(_0x5a1ba5,_0x3630c2){return _0x5a1ba5[_0x441a('0x8')](_0x441a('0x9'),attributes,{'tableName':_0x441a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d9702,_0x247eeb,_0x590819){if(_0x4d9702[_0x441a('0xb')](_0x441a('0xc'))){_0x4d9702['closedAt']=moment()['format'](_0x441a('0xd'));}_0x590819(null,_0x4d9702);}},'charset':'utf8mb4','collate':_0x441a('0xe')});};