1251b1aca3c1b22611de23912db2810d4ad6dbab
[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 _0x2cda=['exports','define','SmsInteraction','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x44ea28,_0x2d0d92){var _0x1b879a=function(_0x5e9f35){while(--_0x5e9f35){_0x44ea28['push'](_0x44ea28['shift']());}};_0x1b879a(++_0x2d0d92);}(_0x2cda,0x7d));var _0xa2cd=function(_0x231936,_0x58b0ca){_0x231936=_0x231936-0x0;var _0x4d5f54=_0x2cda[_0x231936];return _0x4d5f54;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa2cd('0x0'))(_0xa2cd('0x1'));var moment=require('moment');var BPromise=require(_0xa2cd('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2cd('0x3'));var rimraf=require('rimraf');var config=require(_0xa2cd('0x4'));var attributes=require('./smsInteraction.attributes');module[_0xa2cd('0x5')]=function(_0x30f792,_0x2959bf){return _0x30f792[_0xa2cd('0x6')](_0xa2cd('0x7'),attributes,{'tableName':_0xa2cd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x762940,_0x352197,_0x2a2185){if(_0x762940[_0xa2cd('0x9')]('closed')){_0x762940[_0xa2cd('0xa')]=moment()[_0xa2cd('0xb')](_0xa2cd('0xc'));}_0x2a2185(null,_0x762940);}}});};