41b30d5fb2aa4719de958d9dfe4e90de88164a76
[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 _0xf066=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','square_projects','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash'];(function(_0x5bda2c,_0x1cf31d){var _0x16b2bb=function(_0x34e0a9){while(--_0x34e0a9){_0x5bda2c['push'](_0x5bda2c['shift']());}};_0x16b2bb(++_0x1cf31d);}(_0xf066,0x98));var _0x6f06=function(_0x5ec454,_0xfcd77e){_0x5ec454=_0x5ec454-0x0;var _0x5ebf50=_0xf066[_0x5ec454];return _0x5ebf50;};'use strict';var _=require(_0x6f06('0x0'));var util=require(_0x6f06('0x1'));var logger=require(_0x6f06('0x2'))(_0x6f06('0x3'));var moment=require('moment');var BPromise=require(_0x6f06('0x4'));var rp=require(_0x6f06('0x5'));var fs=require('fs');var path=require(_0x6f06('0x6'));var rimraf=require(_0x6f06('0x7'));var config=require(_0x6f06('0x8'));var attributes=require(_0x6f06('0x9'));module['exports']=function(_0x443541,_0x2745ee){return _0x443541['define']('SquareProject',attributes,{'tableName':_0x6f06('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x369be9,_0x137ee7,_0x435c50){if(_0x369be9[_0x6f06('0xb')]('preproduction')){_0x369be9[_0x6f06('0xc')]=moment()[_0x6f06('0xd')](_0x6f06('0xe'));}if(_0x369be9[_0x6f06('0xb')](_0x6f06('0xf'))){_0x369be9[_0x6f06('0x10')]=moment()[_0x6f06('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x435c50(null,_0x369be9);}}});};