38a0b7209ab738ec6c478780a4eab9682be82213
[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 _0x7c5d=['path','rimraf','../../config/environment','exports','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7c5d,0x17b));var _0xd7c5=function(_0x50221b,_0x957894){_0x50221b=_0x50221b-0x0;var _0x10a2cc=_0x7c5d[_0x50221b];return _0x10a2cc;};'use strict';var _=require(_0xd7c5('0x0'));var util=require('util');var logger=require(_0xd7c5('0x1'))(_0xd7c5('0x2'));var moment=require('moment');var BPromise=require(_0xd7c5('0x3'));var rp=require(_0xd7c5('0x4'));var fs=require('fs');var path=require(_0xd7c5('0x5'));var rimraf=require(_0xd7c5('0x6'));var config=require(_0xd7c5('0x7'));var attributes=require('./smsInteraction.attributes');module[_0xd7c5('0x8')]=function(_0x4ebbf9,_0x73880e){return _0x4ebbf9['define']('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3aa2b7,_0x7f4053,_0x5e7304){if(_0x3aa2b7['changed'](_0xd7c5('0x9'))){_0x3aa2b7[_0xd7c5('0xa')]=moment()['format'](_0xd7c5('0xb'));}_0x5e7304(null,_0x3aa2b7);}}});};