41aa698ecec46369b107fe3eeb33e959e7fa7a9f
[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 _0x73fc=['request-promise','path','exports','SmsInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x359ae4,_0x564ef1){var _0x523e22=function(_0x296cca){while(--_0x296cca){_0x359ae4['push'](_0x359ae4['shift']());}};_0x523e22(++_0x564ef1);}(_0x73fc,0x6a));var _0xc73f=function(_0x1a3f54,_0x5838ee){_0x1a3f54=_0x1a3f54-0x0;var _0x52a600=_0x73fc[_0x1a3f54];return _0x52a600;};'use strict';var _=require(_0xc73f('0x0'));var util=require(_0xc73f('0x1'));var logger=require(_0xc73f('0x2'))(_0xc73f('0x3'));var moment=require(_0xc73f('0x4'));var BPromise=require(_0xc73f('0x5'));var rp=require(_0xc73f('0x6'));var fs=require('fs');var path=require(_0xc73f('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module[_0xc73f('0x8')]=function(_0xfab9f5,_0x42a0e0){return _0xfab9f5['define'](_0xc73f('0x9'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46eef9,_0x3fe55b,_0x4aebf1){if(_0x46eef9[_0xc73f('0xa')]('closed')){_0x46eef9[_0xc73f('0xb')]=moment()[_0xc73f('0xc')](_0xc73f('0xd'));}_0x4aebf1(null,_0x46eef9);}}});};