6cca56aece1328a70e41e2fe8057258c953cb309
[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 _0x0c10=['../../config/environment','./squareProject.attributes','exports','square_projects','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','moment','bluebird','request-promise','path','rimraf'];(function(_0x469361,_0x42f6ab){var _0x418e39=function(_0x3b519f){while(--_0x3b519f){_0x469361['push'](_0x469361['shift']());}};_0x418e39(++_0x42f6ab);}(_0x0c10,0xaf));var _0x00c1=function(_0x470a01,_0x1ef188){_0x470a01=_0x470a01-0x0;var _0x5df181=_0x0c10[_0x470a01];return _0x5df181;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x00c1('0x0'));var BPromise=require(_0x00c1('0x1'));var rp=require(_0x00c1('0x2'));var fs=require('fs');var path=require(_0x00c1('0x3'));var rimraf=require(_0x00c1('0x4'));var config=require(_0x00c1('0x5'));var attributes=require(_0x00c1('0x6'));module[_0x00c1('0x7')]=function(_0x684a05,_0x1cc960){return _0x684a05['define']('SquareProject',attributes,{'tableName':_0x00c1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f8616,_0x5c855e,_0x2240b0){if(_0x3f8616[_0x00c1('0x9')]('preproduction')){_0x3f8616[_0x00c1('0xa')]=moment()[_0x00c1('0xb')](_0x00c1('0xc'));}if(_0x3f8616[_0x00c1('0x9')](_0x00c1('0xd'))){_0x3f8616[_0x00c1('0xe')]=moment()[_0x00c1('0xb')](_0x00c1('0xc'));}_0x2240b0(null,_0x3f8616);}}});};