Built motion from commit 3c2ce842.|2.6.31
[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 _0x2196=['YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','SquareProject','square_projects','changed','preproduction','format'];(function(_0x1ca8f1,_0x2eb0b2){var _0x3a036f=function(_0x5a5dac){while(--_0x5a5dac){_0x1ca8f1['push'](_0x1ca8f1['shift']());}};_0x3a036f(++_0x2eb0b2);}(_0x2196,0xb7));var _0x6219=function(_0x3261ed,_0x1f06ad){_0x3261ed=_0x3261ed-0x0;var _0xbea3c3=_0x2196[_0x3261ed];return _0xbea3c3;};'use strict';var _=require(_0x6219('0x0'));var util=require(_0x6219('0x1'));var logger=require(_0x6219('0x2'))(_0x6219('0x3'));var moment=require(_0x6219('0x4'));var BPromise=require(_0x6219('0x5'));var rp=require(_0x6219('0x6'));var fs=require('fs');var path=require(_0x6219('0x7'));var rimraf=require(_0x6219('0x8'));var config=require(_0x6219('0x9'));var attributes=require(_0x6219('0xa'));module[_0x6219('0xb')]=function(_0x28291e,_0x5ca123){return _0x28291e['define'](_0x6219('0xc'),attributes,{'tableName':_0x6219('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b12eb,_0x50cb06,_0x5d9ca9){if(_0x2b12eb[_0x6219('0xe')](_0x6219('0xf'))){_0x2b12eb['savedAt']=moment()[_0x6219('0x10')](_0x6219('0x11'));}if(_0x2b12eb[_0x6219('0xe')](_0x6219('0x12'))){_0x2b12eb[_0x6219('0x13')]=moment()[_0x6219('0x10')](_0x6219('0x11'));}_0x5d9ca9(null,_0x2b12eb);}}});};