983901f0a242144a542be652058fba7a99ba7f25
[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 _0x34e7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','SquareProject','square_projects','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','lodash','util','../../config/logger','api'];(function(_0x162ee0,_0x291661){var _0x48fc5e=function(_0x297a35){while(--_0x297a35){_0x162ee0['push'](_0x162ee0['shift']());}};_0x48fc5e(++_0x291661);}(_0x34e7,0x164));var _0x734e=function(_0x455555,_0x2147fd){_0x455555=_0x455555-0x0;var _0x3cb183=_0x34e7[_0x455555];return _0x3cb183;};'use strict';var _=require(_0x734e('0x0'));var util=require(_0x734e('0x1'));var logger=require(_0x734e('0x2'))(_0x734e('0x3'));var moment=require(_0x734e('0x4'));var BPromise=require(_0x734e('0x5'));var rp=require(_0x734e('0x6'));var fs=require('fs');var path=require(_0x734e('0x7'));var rimraf=require(_0x734e('0x8'));var config=require(_0x734e('0x9'));var attributes=require(_0x734e('0xa'));module[_0x734e('0xb')]=function(_0x3405b1,_0x192562){return _0x3405b1['define'](_0x734e('0xc'),attributes,{'tableName':_0x734e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x444194,_0x4df479,_0x5c4e16){if(_0x444194['changed'](_0x734e('0xe'))){_0x444194[_0x734e('0xf')]=moment()[_0x734e('0x10')](_0x734e('0x11'));}if(_0x444194[_0x734e('0x12')](_0x734e('0x13'))){_0x444194['publishedAt']=moment()['format'](_0x734e('0x11'));}_0x5c4e16(null,_0x444194);}}});};