Built motion from commit 3d6333b4.|2.6.31
[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 _0x17ac=['chat_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction'];(function(_0x443a56,_0x530bfc){var _0x3cb3a5=function(_0x1ace41){while(--_0x1ace41){_0x443a56['push'](_0x443a56['shift']());}};_0x3cb3a5(++_0x530bfc);}(_0x17ac,0xb9));var _0xc17a=function(_0x105249,_0x26b76d){_0x105249=_0x105249-0x0;var _0x3397de=_0x17ac[_0x105249];return _0x3397de;};'use strict';var _=require(_0xc17a('0x0'));var util=require(_0xc17a('0x1'));var logger=require(_0xc17a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc17a('0x3'));var rp=require(_0xc17a('0x4'));var fs=require('fs');var path=require(_0xc17a('0x5'));var rimraf=require('rimraf');var config=require(_0xc17a('0x6'));var attributes=require(_0xc17a('0x7'));module[_0xc17a('0x8')]=function(_0x635e22,_0x55a1cf){return _0x635e22['define'](_0xc17a('0x9'),attributes,{'tableName':_0xc17a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x567f50,_0x328474,_0x4cedbd){if(_0x567f50['changed']('closed')){_0x567f50[_0xc17a('0xb')]=moment()[_0xc17a('0xc')](_0xc17a('0xd'));}_0x4cedbd(null,_0x567f50);}},'charset':_0xc17a('0xe'),'collate':'utf8mb4_unicode_ci'});};