c459c9eb513146eaa054795518c6de5a58211b10
[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 _0xbd44=['SmsInteraction','sms_interactions','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x7b5cdd,_0x8c88d8){var _0x3a29ae=function(_0x17859a){while(--_0x17859a){_0x7b5cdd['push'](_0x7b5cdd['shift']());}};_0x3a29ae(++_0x8c88d8);}(_0xbd44,0xdc));var _0x4bd4=function(_0x4be38f,_0x5eacec){_0x4be38f=_0x4be38f-0x0;var _0x2d3cd3=_0xbd44[_0x4be38f];return _0x2d3cd3;};'use strict';var _=require(_0x4bd4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4bd4('0x1'));var moment=require(_0x4bd4('0x2'));var BPromise=require(_0x4bd4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4bd4('0x4'));var rimraf=require(_0x4bd4('0x5'));var config=require(_0x4bd4('0x6'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x33f825,_0x4162bf){return _0x33f825[_0x4bd4('0x7')](_0x4bd4('0x8'),attributes,{'tableName':_0x4bd4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e0784,_0x31d572,_0x2d3517){if(_0x2e0784['changed']('closed')){_0x2e0784[_0x4bd4('0xa')]=moment()['format'](_0x4bd4('0xb'));}_0x2d3517(null,_0x2e0784);}}});};