Built motion from commit (unavailable).|2.5.23
[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 _0x2263=['moment','bluebird','request-promise','path','../../config/environment','./squareProject.attributes','exports','SquareProject','square_projects','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x2263,0x6e));var _0x3226=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x2263[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x3226('0x0'));var util=require(_0x3226('0x1'));var logger=require(_0x3226('0x2'))(_0x3226('0x3'));var moment=require(_0x3226('0x4'));var BPromise=require(_0x3226('0x5'));var rp=require(_0x3226('0x6'));var fs=require('fs');var path=require(_0x3226('0x7'));var rimraf=require('rimraf');var config=require(_0x3226('0x8'));var attributes=require(_0x3226('0x9'));module[_0x3226('0xa')]=function(_0x34c47c,_0x31b59b){return _0x34c47c['define'](_0x3226('0xb'),attributes,{'tableName':_0x3226('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5d235b,_0x5a0667,_0x408912){if(_0x5d235b[_0x3226('0xd')]('preproduction')){_0x5d235b[_0x3226('0xe')]=moment()[_0x3226('0xf')](_0x3226('0x10'));}if(_0x5d235b[_0x3226('0xd')](_0x3226('0x11'))){_0x5d235b[_0x3226('0x12')]=moment()[_0x3226('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x408912(null,_0x5d235b);}}});};