Built motion from commit e6806ed6.|2.6.0
[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 _0xd28f=['path','../../config/environment','./chatInteraction.attributes','exports','chat_interactions','closedAt','format','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise'];(function(_0x1b9b16,_0x2b1aa3){var _0x2b2cc7=function(_0x4e7029){while(--_0x4e7029){_0x1b9b16['push'](_0x1b9b16['shift']());}};_0x2b2cc7(++_0x2b1aa3);}(_0xd28f,0x79));var _0xfd28=function(_0xa68f53,_0x1feb64){_0xa68f53=_0xa68f53-0x0;var _0x6351d6=_0xd28f[_0xa68f53];return _0x6351d6;};'use strict';var _=require('lodash');var util=require(_0xfd28('0x0'));var logger=require('../../config/logger')(_0xfd28('0x1'));var moment=require(_0xfd28('0x2'));var BPromise=require(_0xfd28('0x3'));var rp=require(_0xfd28('0x4'));var fs=require('fs');var path=require(_0xfd28('0x5'));var rimraf=require('rimraf');var config=require(_0xfd28('0x6'));var attributes=require(_0xfd28('0x7'));module[_0xfd28('0x8')]=function(_0x5e90ba,_0x37065d){return _0x5e90ba['define']('ChatInteraction',attributes,{'tableName':_0xfd28('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x209563,_0x45da76,_0x3d7b82){if(_0x209563['changed']('closed')){_0x209563[_0xfd28('0xa')]=moment()[_0xfd28('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3d7b82(null,_0x209563);}},'charset':_0xfd28('0xc'),'collate':_0xfd28('0xd')});};