7cbb3c6fa9e867ff113932351287342f170714a6
[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 _0x757a=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x414d77,_0x1f72bf){var _0x3fc41c=function(_0x32313e){while(--_0x32313e){_0x414d77['push'](_0x414d77['shift']());}};_0x3fc41c(++_0x1f72bf);}(_0x757a,0xde));var _0xa757=function(_0x57a3d8,_0x28197c){_0x57a3d8=_0x57a3d8-0x0;var _0x3e9a81=_0x757a[_0x57a3d8];return _0x3e9a81;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatInteraction',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f7793,_0x447344,_0x1a95ee){if(_0x2f7793[_0xa757('0xa')]('closed')){_0x2f7793[_0xa757('0xb')]=moment()[_0xa757('0xc')](_0xa757('0xd'));}_0x1a95ee(null,_0x2f7793);}},'charset':_0xa757('0xe'),'collate':_0xa757('0xf')});};