4176ec859645ca980ea2cf5f9b8df1c41f6a0d97
[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 _0xd080=['bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x22cbb1,_0x1ecb14){var _0x20f484=function(_0x4c8a94){while(--_0x4c8a94){_0x22cbb1['push'](_0x22cbb1['shift']());}};_0x20f484(++_0x1ecb14);}(_0xd080,0xb9));var _0x0d08=function(_0x3bf91a,_0x2a3bc3){_0x3bf91a=_0x3bf91a-0x0;var _0x3cbdff=_0xd080[_0x3bf91a];return _0x3cbdff;};'use strict';var _=require(_0x0d08('0x0'));var util=require(_0x0d08('0x1'));var logger=require(_0x0d08('0x2'))(_0x0d08('0x3'));var moment=require(_0x0d08('0x4'));var BPromise=require(_0x0d08('0x5'));var rp=require(_0x0d08('0x6'));var fs=require('fs');var path=require(_0x0d08('0x7'));var rimraf=require('rimraf');var config=require(_0x0d08('0x8'));var attributes=require(_0x0d08('0x9'));module[_0x0d08('0xa')]=function(_0x3250ce,_0x10dfef){return _0x3250ce[_0x0d08('0xb')](_0x0d08('0xc'),attributes,{'tableName':_0x0d08('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x37e66f,_0x1aeb70,_0x48bdde){if(_0x37e66f[_0x0d08('0xe')](_0x0d08('0xf'))){_0x37e66f['closedAt']=moment()[_0x0d08('0x10')](_0x0d08('0x11'));}_0x48bdde(null,_0x37e66f);}},'charset':_0x0d08('0x12'),'collate':'utf8mb4_unicode_ci'});};