bd6adba9abafe253c058377e69bfb0c22d30e6b5
[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 _0x08af=['changed','closedAt','lodash','util','api','bluebird','request-promise','path','rimraf','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x08af,0x1c2));var _0xf08a=function(_0x548483,_0x5e53ab){_0x548483=_0x548483-0x0;var _0x53afbd=_0x08af[_0x548483];return _0x53afbd;};'use strict';var _=require(_0xf08a('0x0'));var util=require(_0xf08a('0x1'));var logger=require('../../config/logger')(_0xf08a('0x2'));var moment=require('moment');var BPromise=require(_0xf08a('0x3'));var rp=require(_0xf08a('0x4'));var fs=require('fs');var path=require(_0xf08a('0x5'));var rimraf=require(_0xf08a('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x14ab52,_0x1671bc){return _0x14ab52[_0xf08a('0x7')](_0xf08a('0x8'),attributes,{'tableName':_0xf08a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf08a('0xa'),'collate':_0xf08a('0xb'),'hooks':{'beforeUpdate':function(_0x50d443,_0x7aaf98,_0xeb1e64){if(_0x50d443[_0xf08a('0xc')]('closed')){_0x50d443[_0xf08a('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0xeb1e64(null,_0x50d443);}}});};