bbd9af96587ad854699cb9eff96f68e322efc984
[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 _0x128e=['format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','../../config/logger','api','path','rimraf','../../config/environment','SquareProject','square_projects','changed','preproduction','savedAt'];(function(_0x5bdbfd,_0x3aaf24){var _0x5711c0=function(_0x14b3ac){while(--_0x14b3ac){_0x5bdbfd['push'](_0x5bdbfd['shift']());}};_0x5711c0(++_0x3aaf24);}(_0x128e,0x14e));var _0xe128=function(_0x445c33,_0x8805b2){_0x445c33=_0x445c33-0x0;var _0x3b2b12=_0x128e[_0x445c33];return _0x3b2b12;};'use strict';var _=require('lodash');var util=require(_0xe128('0x0'));var logger=require(_0xe128('0x1'))(_0xe128('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe128('0x3'));var rimraf=require(_0xe128('0x4'));var config=require(_0xe128('0x5'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x4e3f78,_0x26fd61){return _0x4e3f78['define'](_0xe128('0x6'),attributes,{'tableName':_0xe128('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xdba33f,_0x16628f,_0x39e5c4){if(_0xdba33f[_0xe128('0x8')](_0xe128('0x9'))){_0xdba33f[_0xe128('0xa')]=moment()[_0xe128('0xb')](_0xe128('0xc'));}if(_0xdba33f[_0xe128('0x8')](_0xe128('0xd'))){_0xdba33f[_0xe128('0xe')]=moment()[_0xe128('0xb')](_0xe128('0xc'));}_0x39e5c4(null,_0xdba33f);}}});};