8938b8c80ca40989a6f24a2ecd4cb0428d804c11
[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 _0xa7ad=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format'];(function(_0x495dd9,_0x569333){var _0x862e68=function(_0x317469){while(--_0x317469){_0x495dd9['push'](_0x495dd9['shift']());}};_0x862e68(++_0x569333);}(_0xa7ad,0x1e1));var _0xda7a=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xa7ad[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0xda7a('0x0'));var util=require(_0xda7a('0x1'));var logger=require(_0xda7a('0x2'))(_0xda7a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xda7a('0x4'));var fs=require('fs');var path=require(_0xda7a('0x5'));var rimraf=require('rimraf');var config=require(_0xda7a('0x6'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x3dd380,_0xda4bf){return _0x3dd380[_0xda7a('0x7')](_0xda7a('0x8'),attributes,{'tableName':_0xda7a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3c7a5c,_0xfd8b08,_0x235d96){if(_0x3c7a5c[_0xda7a('0xa')](_0xda7a('0xb'))){_0x3c7a5c[_0xda7a('0xc')]=moment()[_0xda7a('0xd')](_0xda7a('0xe'));}_0x235d96(null,_0x3c7a5c);}}});};