ff0dd5e8460839544eab00d474d312945c9f4f1c
[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 _0x6bcc=['format','util','api','bluebird','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closedAt'];(function(_0x3b6dff,_0x2031c8){var _0x274a55=function(_0x15647d){while(--_0x15647d){_0x3b6dff['push'](_0x3b6dff['shift']());}};_0x274a55(++_0x2031c8);}(_0x6bcc,0x17a));var _0xc6bc=function(_0x584bf4,_0x16c912){_0x584bf4=_0x584bf4-0x0;var _0x275380=_0x6bcc[_0x584bf4];return _0x275380;};'use strict';var _=require('lodash');var util=require(_0xc6bc('0x0'));var logger=require('../../config/logger')(_0xc6bc('0x1'));var moment=require('moment');var BPromise=require(_0xc6bc('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc6bc('0x3'));var config=require(_0xc6bc('0x4'));var attributes=require(_0xc6bc('0x5'));module[_0xc6bc('0x6')]=function(_0x266ebd,_0x5ec36f){return _0x266ebd[_0xc6bc('0x7')](_0xc6bc('0x8'),attributes,{'tableName':_0xc6bc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x16fdf2,_0x3d492b,_0x3c767e){if(_0x16fdf2[_0xc6bc('0xa')]('closed')){_0x16fdf2[_0xc6bc('0xb')]=moment()[_0xc6bc('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3c767e(null,_0x16fdf2);}}});};