Built motion from commit 85328c08.|2.5.50
[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 _0x1a89=['./squareProject.attributes','exports','define','SquareProject','changed','savedAt','format','production','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5bad8f,_0x3a51ef){var _0x2f643a=function(_0x23e4ed){while(--_0x23e4ed){_0x5bad8f['push'](_0x5bad8f['shift']());}};_0x2f643a(++_0x3a51ef);}(_0x1a89,0x171));var _0x91a8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1a89[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x91a8('0x0'));var util=require(_0x91a8('0x1'));var logger=require(_0x91a8('0x2'))(_0x91a8('0x3'));var moment=require(_0x91a8('0x4'));var BPromise=require(_0x91a8('0x5'));var rp=require(_0x91a8('0x6'));var fs=require('fs');var path=require(_0x91a8('0x7'));var rimraf=require('rimraf');var config=require(_0x91a8('0x8'));var attributes=require(_0x91a8('0x9'));module[_0x91a8('0xa')]=function(_0xa9392c,_0x40d086){return _0xa9392c[_0x91a8('0xb')](_0x91a8('0xc'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb39c,_0x85409b,_0x518b63){if(_0xb39c[_0x91a8('0xd')]('preproduction')){_0xb39c[_0x91a8('0xe')]=moment()[_0x91a8('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0xb39c[_0x91a8('0xd')](_0x91a8('0x10'))){_0xb39c['publishedAt']=moment()['format'](_0x91a8('0x11'));}_0x518b63(null,_0xb39c);}}});};