8851241db41532b31a1ce1faa2dd877cdd78a2a2
[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 _0x5ea3=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1f96b9,_0x2b4cae){var _0x15f12d=function(_0xcd47ff){while(--_0xcd47ff){_0x1f96b9['push'](_0x1f96b9['shift']());}};_0x15f12d(++_0x2b4cae);}(_0x5ea3,0x88));var _0x35ea=function(_0x263ecd,_0x4caef2){_0x263ecd=_0x263ecd-0x0;var _0x44d823=_0x5ea3[_0x263ecd];return _0x44d823;};'use strict';var _=require('lodash');var util=require(_0x35ea('0x0'));var logger=require(_0x35ea('0x1'))(_0x35ea('0x2'));var moment=require(_0x35ea('0x3'));var BPromise=require(_0x35ea('0x4'));var rp=require(_0x35ea('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x35ea('0x6'));var config=require(_0x35ea('0x7'));var attributes=require('./chatInteraction.attributes');module[_0x35ea('0x8')]=function(_0x49dca9,_0x5789d9){return _0x49dca9[_0x35ea('0x9')](_0x35ea('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x370e60,_0x4c35be,_0x28de0d){if(_0x370e60['changed'](_0x35ea('0xb'))){_0x370e60[_0x35ea('0xc')]=moment()[_0x35ea('0xd')](_0x35ea('0xe'));}_0x28de0d(null,_0x370e60);}},'charset':_0x35ea('0xf'),'collate':_0x35ea('0x10')});};