62c38ac60374ab1da7344200773538aff51a52b2
[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 _0x788c=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction'];(function(_0x20b014,_0x41f545){var _0x312e25=function(_0x4e3498){while(--_0x4e3498){_0x20b014['push'](_0x20b014['shift']());}};_0x312e25(++_0x41f545);}(_0x788c,0x1c6));var _0xc788=function(_0x407a99,_0x2b07a2){_0x407a99=_0x407a99-0x0;var _0x16326e=_0x788c[_0x407a99];return _0x16326e;};'use strict';var _=require('lodash');var util=require(_0xc788('0x0'));var logger=require(_0xc788('0x1'))(_0xc788('0x2'));var moment=require(_0xc788('0x3'));var BPromise=require('bluebird');var rp=require(_0xc788('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc788('0x5'));var config=require(_0xc788('0x6'));var attributes=require(_0xc788('0x7'));module[_0xc788('0x8')]=function(_0x91313,_0x31ba05){return _0x91313[_0xc788('0x9')](_0xc788('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x58f72d,_0x3b821b,_0x26b93f){if(_0x58f72d[_0xc788('0xb')]('closed')){_0x58f72d[_0xc788('0xc')]=moment()[_0xc788('0xd')](_0xc788('0xe'));}_0x26b93f(null,_0x58f72d);}}});};