7234a7657f7b08b6613767a1eab784b0a373a6c4
[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 _0xbe5a=['define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','util','../../config/logger','api','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports'];(function(_0x2ee726,_0x149cdb){var _0x594e01=function(_0x38e487){while(--_0x38e487){_0x2ee726['push'](_0x2ee726['shift']());}};_0x594e01(++_0x149cdb);}(_0xbe5a,0xa8));var _0xabe5=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0xbe5a[_0x4bb145];return _0x4db596;};'use strict';var _=require('lodash');var util=require(_0xabe5('0x0'));var logger=require(_0xabe5('0x1'))(_0xabe5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xabe5('0x3'));var rimraf=require(_0xabe5('0x4'));var config=require(_0xabe5('0x5'));var attributes=require(_0xabe5('0x6'));module[_0xabe5('0x7')]=function(_0x33b8a8,_0x4a8846){return _0x33b8a8[_0xabe5('0x8')](_0xabe5('0x9'),attributes,{'tableName':_0xabe5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xabe5('0xb'),'collate':_0xabe5('0xc'),'hooks':{'beforeUpdate':function(_0x390f65,_0x569972,_0x13b879){if(_0x390f65[_0xabe5('0xd')]('closed')){_0x390f65[_0xabe5('0xe')]=moment()[_0xabe5('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x13b879(null,_0x390f65);}}});};