Built motion from commit (unavailable).|2.4.17
[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 _0xa751=['openchannel_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','OpenchannelInteraction'];(function(_0x38b050,_0x16eca3){var _0x133895=function(_0x20693a){while(--_0x20693a){_0x38b050['push'](_0x38b050['shift']());}};_0x133895(++_0x16eca3);}(_0xa751,0x175));var _0x1a75=function(_0x4ee97d,_0x1b3853){_0x4ee97d=_0x4ee97d-0x0;var _0xe291ea=_0xa751[_0x4ee97d];return _0xe291ea;};'use strict';var _=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var logger=require(_0x1a75('0x2'))(_0x1a75('0x3'));var moment=require('moment');var BPromise=require(_0x1a75('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a75('0x5'));var rimraf=require(_0x1a75('0x6'));var config=require(_0x1a75('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0x1a75('0x8')]=function(_0x220b14,_0x1719c1){return _0x220b14[_0x1a75('0x9')](_0x1a75('0xa'),attributes,{'tableName':_0x1a75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4537f6,_0x5d6faa,_0x4c7f62){if(_0x4537f6['changed'](_0x1a75('0xc'))){_0x4537f6[_0x1a75('0xd')]=moment()[_0x1a75('0xe')](_0x1a75('0xf'));}_0x4c7f62(null,_0x4537f6);}}});};