Built motion from commit (unavailable).|2.4.19
[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 _0x648e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x648e,0x18a));var _0xe648=function(_0xf4206b,_0x50853c){_0xf4206b=_0xf4206b-0x0;var _0x5b8397=_0x648e[_0xf4206b];return _0x5b8397;};'use strict';var _=require('lodash');var util=require(_0xe648('0x0'));var logger=require(_0xe648('0x1'))('api');var moment=require(_0xe648('0x2'));var BPromise=require(_0xe648('0x3'));var rp=require(_0xe648('0x4'));var fs=require('fs');var path=require(_0xe648('0x5'));var rimraf=require(_0xe648('0x6'));var config=require(_0xe648('0x7'));var attributes=require(_0xe648('0x8'));module[_0xe648('0x9')]=function(_0x4d25e9,_0x2ed88f){return _0x4d25e9[_0xe648('0xa')](_0xe648('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1e21ae,_0x34ca78,_0x24e4b7){if(_0x1e21ae[_0xe648('0xc')](_0xe648('0xd'))){_0x1e21ae['closedAt']=moment()[_0xe648('0xe')](_0xe648('0xf'));}_0x24e4b7(null,_0x1e21ae);}},'charset':_0xe648('0x10'),'collate':_0xe648('0x11')});};