Built motion from commit (unavailable).|2.5.4
[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 _0xe015=['changed','closed','format','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','openchannel_interactions'];(function(_0x1c9c24,_0x2a517b){var _0x349c69=function(_0x259ff7){while(--_0x259ff7){_0x1c9c24['push'](_0x1c9c24['shift']());}};_0x349c69(++_0x2a517b);}(_0xe015,0x13b));var _0x5e01=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xe015[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var logger=require(_0x5e01('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5e01('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e01('0x4'));var rimraf=require(_0x5e01('0x5'));var config=require(_0x5e01('0x6'));var attributes=require(_0x5e01('0x7'));module['exports']=function(_0x1814cb,_0x3d2da2){return _0x1814cb['define']('OpenchannelInteraction',attributes,{'tableName':_0x5e01('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3aeaef,_0x1420c2,_0x40d31f){if(_0x3aeaef[_0x5e01('0x9')](_0x5e01('0xa'))){_0x3aeaef['closedAt']=moment()[_0x5e01('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x40d31f(null,_0x3aeaef);}}});};