50a55ed1625bde4d76f16a875bd67fe66540b5ea
[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 _0x09eb=['util','../../config/logger','moment','bluebird','path','rimraf','exports','SmsInteraction','sms_interactions','closed','closedAt','lodash'];(function(_0x39553b,_0x15d6ac){var _0x3cd31d=function(_0x2ea569){while(--_0x2ea569){_0x39553b['push'](_0x39553b['shift']());}};_0x3cd31d(++_0x15d6ac);}(_0x09eb,0x197));var _0xb09e=function(_0x2a8860,_0x2da926){_0x2a8860=_0x2a8860-0x0;var _0x2f47a4=_0x09eb[_0x2a8860];return _0x2f47a4;};'use strict';var _=require(_0xb09e('0x0'));var util=require(_0xb09e('0x1'));var logger=require(_0xb09e('0x2'))('api');var moment=require(_0xb09e('0x3'));var BPromise=require(_0xb09e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb09e('0x5'));var rimraf=require(_0xb09e('0x6'));var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module[_0xb09e('0x7')]=function(_0x5f4ce3,_0x3fd0e0){return _0x5f4ce3['define'](_0xb09e('0x8'),attributes,{'tableName':_0xb09e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xf2f73d,_0x525550,_0x2b62e8){if(_0xf2f73d['changed'](_0xb09e('0xa'))){_0xf2f73d[_0xb09e('0xb')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x2b62e8(null,_0xf2f73d);}}});};