Built motion from commit 9d0783e6.|2.6.13
[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 _0x8722=['YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','preproduction','savedAt','format'];(function(_0x5f3b9c,_0x416312){var _0x86064b=function(_0x5d2484){while(--_0x5d2484){_0x5f3b9c['push'](_0x5f3b9c['shift']());}};_0x86064b(++_0x416312);}(_0x8722,0x1e4));var _0x2872=function(_0x51834b,_0x5d814d){_0x51834b=_0x51834b-0x0;var _0x41beac=_0x8722[_0x51834b];return _0x41beac;};'use strict';var _=require(_0x2872('0x0'));var util=require(_0x2872('0x1'));var logger=require(_0x2872('0x2'))(_0x2872('0x3'));var moment=require('moment');var BPromise=require(_0x2872('0x4'));var rp=require(_0x2872('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2872('0x6'));var config=require(_0x2872('0x7'));var attributes=require('./squareProject.attributes');module[_0x2872('0x8')]=function(_0x4105c5,_0x40aa53){return _0x4105c5['define']('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x598933,_0x2f1016,_0x3b8c45){if(_0x598933['changed'](_0x2872('0x9'))){_0x598933[_0x2872('0xa')]=moment()[_0x2872('0xb')](_0x2872('0xc'));}if(_0x598933[_0x2872('0xd')](_0x2872('0xe'))){_0x598933[_0x2872('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x3b8c45(null,_0x598933);}}});};