Built motion from commit 9e1399f3.|2.5.37
[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 _0xefaa=['api','moment','bluebird','request-promise','path','./squareProject.attributes','exports','define','SquareProject','square_projects','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','../../config/logger'];(function(_0x635bc2,_0x1c3ad9){var _0x59372c=function(_0x4e0f2b){while(--_0x4e0f2b){_0x635bc2['push'](_0x635bc2['shift']());}};_0x59372c(++_0x1c3ad9);}(_0xefaa,0x10c));var _0xaefa=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xefaa[_0x24237f];return _0x48298e;};'use strict';var _=require(_0xaefa('0x0'));var util=require('util');var logger=require(_0xaefa('0x1'))(_0xaefa('0x2'));var moment=require(_0xaefa('0x3'));var BPromise=require(_0xaefa('0x4'));var rp=require(_0xaefa('0x5'));var fs=require('fs');var path=require(_0xaefa('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaefa('0x7'));module[_0xaefa('0x8')]=function(_0x2a886d,_0x11d31d){return _0x2a886d[_0xaefa('0x9')](_0xaefa('0xa'),attributes,{'tableName':_0xaefa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a167a,_0x13941b,_0x5d29b3){if(_0x2a167a['changed'](_0xaefa('0xc'))){_0x2a167a[_0xaefa('0xd')]=moment()[_0xaefa('0xe')](_0xaefa('0xf'));}if(_0x2a167a['changed'](_0xaefa('0x10'))){_0x2a167a[_0xaefa('0x11')]=moment()[_0xaefa('0xe')](_0xaefa('0xf'));}_0x5d29b3(null,_0x2a167a);}}});};