a32e0c596a0f0a06e90eec4d63d029fe5b05f9dc
[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 _0xdff3=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x355d06,_0x3c9512){var _0x13b6d0=function(_0x1c845d){while(--_0x1c845d){_0x355d06['push'](_0x355d06['shift']());}};_0x13b6d0(++_0x3c9512);}(_0xdff3,0x1f0));var _0x3dff=function(_0x370ea3,_0x19bb47){_0x370ea3=_0x370ea3-0x0;var _0x21b2f6=_0xdff3[_0x370ea3];return _0x21b2f6;};'use strict';var _=require(_0x3dff('0x0'));var util=require(_0x3dff('0x1'));var logger=require(_0x3dff('0x2'))(_0x3dff('0x3'));var moment=require(_0x3dff('0x4'));var BPromise=require(_0x3dff('0x5'));var rp=require(_0x3dff('0x6'));var fs=require('fs');var path=require(_0x3dff('0x7'));var rimraf=require('rimraf');var config=require(_0x3dff('0x8'));var attributes=require('./chatInteraction.attributes');module[_0x3dff('0x9')]=function(_0xf7aff2,_0x209123){return _0xf7aff2[_0x3dff('0xa')](_0x3dff('0xb'),attributes,{'tableName':_0x3dff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e163e,_0x4efa8d,_0x3808df){if(_0x4e163e[_0x3dff('0xd')](_0x3dff('0xe'))){_0x4e163e['closedAt']=moment()[_0x3dff('0xf')](_0x3dff('0x10'));}_0x3808df(null,_0x4e163e);}},'charset':_0x3dff('0x11'),'collate':_0x3dff('0x12')});};