b1d4875e96b8989b9bf927fba6642041874952b6
[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 _0xae24=['closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','closed'];(function(_0x249d8b,_0x1a02be){var _0x1da116=function(_0x1795de){while(--_0x1795de){_0x249d8b['push'](_0x249d8b['shift']());}};_0x1da116(++_0x1a02be);}(_0xae24,0x182));var _0x4ae2=function(_0xbaac31,_0x145f39){_0xbaac31=_0xbaac31-0x0;var _0x5d419c=_0xae24[_0xbaac31];return _0x5d419c;};'use strict';var _=require(_0x4ae2('0x0'));var util=require('util');var logger=require(_0x4ae2('0x1'))('api');var moment=require(_0x4ae2('0x2'));var BPromise=require(_0x4ae2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ae2('0x4'));var config=require('../../config/environment');var attributes=require(_0x4ae2('0x5'));module[_0x4ae2('0x6')]=function(_0x20c85c,_0x3e6055){return _0x20c85c[_0x4ae2('0x7')](_0x4ae2('0x8'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5f589a,_0x41cdf1,_0x4d3d8a){if(_0x5f589a['changed'](_0x4ae2('0x9'))){_0x5f589a[_0x4ae2('0xa')]=moment()['format'](_0x4ae2('0xb'));}_0x4d3d8a(null,_0x5f589a);}}});};