Built motion from commit 449495f6.|2.6.27
[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 _0x36f3=['../../config/environment','exports','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5a0b5d,_0x573027){var _0x583ff7=function(_0x8b2a63){while(--_0x8b2a63){_0x5a0b5d['push'](_0x5a0b5d['shift']());}};_0x583ff7(++_0x573027);}(_0x36f3,0xe6));var _0x336f=function(_0x153afb,_0x2573a2){_0x153afb=_0x153afb-0x0;var _0x28a67e=_0x36f3[_0x153afb];return _0x28a67e;};'use strict';var _=require('lodash');var util=require(_0x336f('0x0'));var logger=require(_0x336f('0x1'))(_0x336f('0x2'));var moment=require(_0x336f('0x3'));var BPromise=require(_0x336f('0x4'));var rp=require(_0x336f('0x5'));var fs=require('fs');var path=require(_0x336f('0x6'));var rimraf=require(_0x336f('0x7'));var config=require(_0x336f('0x8'));var attributes=require('./openchannelInteraction.attributes');module[_0x336f('0x9')]=function(_0x267661,_0xf85f24){return _0x267661['define']('OpenchannelInteraction',attributes,{'tableName':_0x336f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x336f('0xb'),'collate':_0x336f('0xc'),'hooks':{'beforeUpdate':function(_0xf34284,_0x3c5f5a,_0x176178){if(_0xf34284[_0x336f('0xd')](_0x336f('0xe'))){_0xf34284['closedAt']=moment()[_0x336f('0xf')](_0x336f('0x10'));}_0x176178(null,_0xf34284);}}});};