630b6ebfb7b5fd63192a5b121af0022d85f34d8b
[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 _0xfc5c=['YYYY-MM-DD\x20HH:mm:ss','publishedAt','../../config/logger','api','moment','path','rimraf','../../config/environment','define','SquareProject','square_projects','changed','preproduction','savedAt','format'];(function(_0x1bb161,_0x25b93c){var _0x2d4246=function(_0x1bac38){while(--_0x1bac38){_0x1bb161['push'](_0x1bb161['shift']());}};_0x2d4246(++_0x25b93c);}(_0xfc5c,0x16a));var _0xcfc5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfc5c[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcfc5('0x0'))(_0xcfc5('0x1'));var moment=require(_0xcfc5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcfc5('0x3'));var rimraf=require(_0xcfc5('0x4'));var config=require(_0xcfc5('0x5'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x5abb6a,_0x2a2181){return _0x5abb6a[_0xcfc5('0x6')](_0xcfc5('0x7'),attributes,{'tableName':_0xcfc5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5e6215,_0x1aa947,_0x4fe46e){if(_0x5e6215[_0xcfc5('0x9')](_0xcfc5('0xa'))){_0x5e6215[_0xcfc5('0xb')]=moment()[_0xcfc5('0xc')](_0xcfc5('0xd'));}if(_0x5e6215[_0xcfc5('0x9')]('production')){_0x5e6215[_0xcfc5('0xe')]=moment()[_0xcfc5('0xc')](_0xcfc5('0xd'));}_0x4fe46e(null,_0x5e6215);}}});};