282c306e0bc7b86838d61f63ea115720ed7a165d
[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 _0xa4ae=['../../config/logger','request-promise','path','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','format','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x578a42,_0x5bb6cf){var _0x38d532=function(_0x5e97e3){while(--_0x5e97e3){_0x578a42['push'](_0x578a42['shift']());}};_0x38d532(++_0x5bb6cf);}(_0xa4ae,0x16a));var _0xea4a=function(_0x420f2a,_0x2cc58d){_0x420f2a=_0x420f2a-0x0;var _0x28f802=_0xa4ae[_0x420f2a];return _0x28f802;};'use strict';var _=require(_0xea4a('0x0'));var util=require(_0xea4a('0x1'));var logger=require(_0xea4a('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xea4a('0x3'));var fs=require('fs');var path=require(_0xea4a('0x4'));var rimraf=require('rimraf');var config=require(_0xea4a('0x5'));var attributes=require(_0xea4a('0x6'));module['exports']=function(_0x57f62c,_0x205a4c){return _0x57f62c[_0xea4a('0x7')](_0xea4a('0x8'),attributes,{'tableName':_0xea4a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x22b9d4,_0x5625c1,_0x12771c){if(_0x22b9d4[_0xea4a('0xa')]('closed')){_0x22b9d4['closedAt']=moment()[_0xea4a('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x12771c(null,_0x22b9d4);}},'charset':_0xea4a('0xc'),'collate':_0xea4a('0xd')});};