Built motion from commit (unavailable).|2.3.2
[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 _0x3b02=['OpenchannelInteraction','openchannel_interactions','changed','closedAt','format','lodash','util','../../config/logger','api','bluebird','exports','define'];(function(_0x228ac9,_0x42f065){var _0x69fe02=function(_0x210551){while(--_0x210551){_0x228ac9['push'](_0x228ac9['shift']());}};_0x69fe02(++_0x42f065);}(_0x3b02,0xb9));var _0x23b0=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x3b02[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x23b0('0x0'));var util=require(_0x23b0('0x1'));var logger=require(_0x23b0('0x2'))(_0x23b0('0x3'));var moment=require('moment');var BPromise=require(_0x23b0('0x4'));var rp=require('request-promise');var attributes=require('./openchannelInteraction.attributes');module[_0x23b0('0x5')]=function(_0x8c193b,_0x3f138b){return _0x8c193b[_0x23b0('0x6')](_0x23b0('0x7'),attributes,{'tableName':_0x23b0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x21b902,_0x5c7c47,_0x3b59b4){if(_0x21b902[_0x23b0('0x9')]('closed')){_0x21b902[_0x23b0('0xa')]=moment()[_0x23b0('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3b59b4(null,_0x21b902);}}});};