d069fcaf1136506f57d9f57375681103467e82d3
[motion2.git] / server / api / smsInteraction / smsInteraction.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 _0x5f19=['api','moment','request-promise','path','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closed','closedAt','lodash','util'];(function(_0x5d1df9,_0x4a95bf){var _0x5d4feb=function(_0x37b443){while(--_0x37b443){_0x5d1df9['push'](_0x5d1df9['shift']());}};_0x5d4feb(++_0x4a95bf);}(_0x5f19,0x16a));var _0x95f1=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x5f19[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x95f1('0x0'));var util=require(_0x95f1('0x1'));var logger=require('../../config/logger')(_0x95f1('0x2'));var moment=require(_0x95f1('0x3'));var BPromise=require('bluebird');var rp=require(_0x95f1('0x4'));var fs=require('fs');var path=require(_0x95f1('0x5'));var rimraf=require('rimraf');var config=require(_0x95f1('0x6'));var attributes=require(_0x95f1('0x7'));module[_0x95f1('0x8')]=function(_0x30d779,_0x5dd739){return _0x30d779[_0x95f1('0x9')](_0x95f1('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4ff584,_0x840944,_0x22cf28){if(_0x4ff584[_0x95f1('0xb')](_0x95f1('0xc'))){_0x4ff584[_0x95f1('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x22cf28(null,_0x4ff584);}}});};