Built motion from commit 4d4d9a88.|2.6.26
[motion2.git] / server / api / openchannelInteraction / openchannelInteraction.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 _0x0931=['closedAt','format','lodash','api','request-promise','path','rimraf','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','closed'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x0931,0x16e));var _0x1093=function(_0x1c6622,_0x13a4b6){_0x1c6622=_0x1c6622-0x0;var _0x1ec3bb=_0x0931[_0x1c6622];return _0x1ec3bb;};'use strict';var _=require(_0x1093('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1093('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1093('0x2'));var fs=require('fs');var path=require(_0x1093('0x3'));var rimraf=require(_0x1093('0x4'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0x1093('0x5')]=function(_0x1ba4b4,_0x68deeb){return _0x1ba4b4[_0x1093('0x6')](_0x1093('0x7'),attributes,{'tableName':_0x1093('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1093('0x9'),'hooks':{'beforeUpdate':function(_0x2f2a31,_0x9fddb5,_0x4936b7){if(_0x2f2a31['changed'](_0x1093('0xa'))){_0x2f2a31[_0x1093('0xb')]=moment()[_0x1093('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4936b7(null,_0x2f2a31);}}});};