caa769846f302a51b1ef8bab011abe4301ebcec9
[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 _0x85cb=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x33fd2d,_0x3a1843){var _0x20bfc5=function(_0x2dcd10){while(--_0x2dcd10){_0x33fd2d['push'](_0x33fd2d['shift']());}};_0x20bfc5(++_0x3a1843);}(_0x85cb,0x164));var _0xb85c=function(_0x544b7c,_0x306ded){_0x544b7c=_0x544b7c-0x0;var _0x5b0f0a=_0x85cb[_0x544b7c];return _0x5b0f0a;};'use strict';var _=require(_0xb85c('0x0'));var util=require(_0xb85c('0x1'));var logger=require(_0xb85c('0x2'))(_0xb85c('0x3'));var moment=require(_0xb85c('0x4'));var BPromise=require(_0xb85c('0x5'));var rp=require(_0xb85c('0x6'));var fs=require('fs');var path=require(_0xb85c('0x7'));var rimraf=require(_0xb85c('0x8'));var config=require(_0xb85c('0x9'));var attributes=require('./chatInteraction.attributes');module[_0xb85c('0xa')]=function(_0x21614e,_0x1013c1){return _0x21614e[_0xb85c('0xb')](_0xb85c('0xc'),attributes,{'tableName':_0xb85c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5b9d28,_0xcad977,_0x26a69a){if(_0x5b9d28[_0xb85c('0xe')](_0xb85c('0xf'))){_0x5b9d28[_0xb85c('0x10')]=moment()[_0xb85c('0x11')](_0xb85c('0x12'));}_0x26a69a(null,_0x5b9d28);}},'charset':_0xb85c('0x13'),'collate':_0xb85c('0x14')});};