Built motion from commit 9d1906d1.|2.5.40
[motion2.git] / server / api / squareProject / squareProject.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 _0x694e=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash'];(function(_0x3e0a20,_0x6c3534){var _0x1b14a4=function(_0x332a01){while(--_0x332a01){_0x3e0a20['push'](_0x3e0a20['shift']());}};_0x1b14a4(++_0x6c3534);}(_0x694e,0x155));var _0xe694=function(_0x36765a,_0x58dfb5){_0x36765a=_0x36765a-0x0;var _0x4c4dbd=_0x694e[_0x36765a];return _0x4c4dbd;};'use strict';var _=require(_0xe694('0x0'));var util=require(_0xe694('0x1'));var logger=require(_0xe694('0x2'))(_0xe694('0x3'));var moment=require('moment');var BPromise=require(_0xe694('0x4'));var rp=require(_0xe694('0x5'));var fs=require('fs');var path=require(_0xe694('0x6'));var rimraf=require(_0xe694('0x7'));var config=require('../../config/environment');var attributes=require(_0xe694('0x8'));module[_0xe694('0x9')]=function(_0x45bb37,_0x194c9f){return _0x45bb37[_0xe694('0xa')](_0xe694('0xb'),attributes,{'tableName':_0xe694('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f05c8,_0x4ba69e,_0x12883a){if(_0x2f05c8[_0xe694('0xd')](_0xe694('0xe'))){_0x2f05c8['savedAt']=moment()[_0xe694('0xf')](_0xe694('0x10'));}if(_0x2f05c8[_0xe694('0xd')](_0xe694('0x11'))){_0x2f05c8[_0xe694('0x12')]=moment()[_0xe694('0xf')](_0xe694('0x10'));}_0x12883a(null,_0x2f05c8);}}});};