58087dbf0f1eb728da8dcf3972199d0f96057308
[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 _0x31c2=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./openchannelInteraction.attributes','exports','OpenchannelInteraction','closed','closedAt','format'];(function(_0x570d43,_0x411696){var _0x42be1e=function(_0x19db9c){while(--_0x19db9c){_0x570d43['push'](_0x570d43['shift']());}};_0x42be1e(++_0x411696);}(_0x31c2,0x1e1));var _0x231c=function(_0x4c7010,_0x2eb016){_0x4c7010=_0x4c7010-0x0;var _0x2be234=_0x31c2[_0x4c7010];return _0x2be234;};'use strict';var _=require(_0x231c('0x0'));var util=require(_0x231c('0x1'));var logger=require(_0x231c('0x2'))(_0x231c('0x3'));var moment=require(_0x231c('0x4'));var BPromise=require(_0x231c('0x5'));var rp=require(_0x231c('0x6'));var fs=require('fs');var path=require(_0x231c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x231c('0x8'));module[_0x231c('0x9')]=function(_0x1f3f7d,_0x219c3f){return _0x1f3f7d['define'](_0x231c('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x439df8,_0x38b3b9,_0x1000c9){if(_0x439df8['changed'](_0x231c('0xb'))){_0x439df8[_0x231c('0xc')]=moment()[_0x231c('0xd')](_0x231c('0xe'));}_0x1000c9(null,_0x439df8);}}});};