eab49ddb0c73d1c0005af0da2975a39b94ec5779
[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 _0xb341=['../../config/logger','api','moment','request-promise','path','../../config/environment','exports','OpenchannelInteraction','openchannel_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0xe37c4d,_0x42e371){var _0x46d71a=function(_0xa1520e){while(--_0xa1520e){_0xe37c4d['push'](_0xe37c4d['shift']());}};_0x46d71a(++_0x42e371);}(_0xb341,0x99));var _0x1b34=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb341[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1b34('0x0'));var util=require('util');var logger=require(_0x1b34('0x1'))(_0x1b34('0x2'));var moment=require(_0x1b34('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b34('0x4'));var fs=require('fs');var path=require(_0x1b34('0x5'));var rimraf=require('rimraf');var config=require(_0x1b34('0x6'));var attributes=require('./openchannelInteraction.attributes');module[_0x1b34('0x7')]=function(_0x1e92b8,_0x58d180){return _0x1e92b8['define'](_0x1b34('0x8'),attributes,{'tableName':_0x1b34('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd2d31e,_0x5ae009,_0x57fc72){if(_0xd2d31e['changed'](_0x1b34('0xa'))){_0xd2d31e[_0x1b34('0xb')]=moment()[_0x1b34('0xc')](_0x1b34('0xd'));}_0x57fc72(null,_0xd2d31e);}}});};