25b703e88caf7633248c95c5cfef5abd1dd5150d
[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 _0x4e16=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','api','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','chat_interactions','changed','closed','closedAt','format'];(function(_0x5d0687,_0x2954ec){var _0x42d57b=function(_0x1fca7f){while(--_0x1fca7f){_0x5d0687['push'](_0x5d0687['shift']());}};_0x42d57b(++_0x2954ec);}(_0x4e16,0x192));var _0x64e1=function(_0x2c8bc3,_0x2b1b0b){_0x2c8bc3=_0x2c8bc3-0x0;var _0x5be033=_0x4e16[_0x2c8bc3];return _0x5be033;};'use strict';var _=require(_0x64e1('0x0'));var util=require(_0x64e1('0x1'));var logger=require('../../config/logger')(_0x64e1('0x2'));var moment=require('moment');var BPromise=require(_0x64e1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64e1('0x4'));var rimraf=require(_0x64e1('0x5'));var config=require(_0x64e1('0x6'));var attributes=require(_0x64e1('0x7'));module[_0x64e1('0x8')]=function(_0x46e1c7,_0x1ccbe7){return _0x46e1c7['define']('ChatInteraction',attributes,{'tableName':_0x64e1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51e212,_0x233b25,_0x1d6fe5){if(_0x51e212[_0x64e1('0xa')](_0x64e1('0xb'))){_0x51e212[_0x64e1('0xc')]=moment()[_0x64e1('0xd')](_0x64e1('0xe'));}_0x1d6fe5(null,_0x51e212);}},'charset':_0x64e1('0xf'),'collate':'utf8mb4_unicode_ci'});};