Built motion from commit (unavailable).|2.5.22
[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 _0xd0bb=['request-promise','path','../../config/environment','exports','define','SquareProject','changed','preproduction','YYYY-MM-DD\x20HH:mm:ss','publishedAt','format','lodash','util','../../config/logger','moment'];(function(_0x5b409a,_0x229314){var _0xed0114=function(_0x130c5b){while(--_0x130c5b){_0x5b409a['push'](_0x5b409a['shift']());}};_0xed0114(++_0x229314);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x13117b,_0x3449eb){_0x13117b=_0x13117b-0x0;var _0x418124=_0xd0bb[_0x13117b];return _0x418124;};'use strict';var _=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var logger=require(_0xbd0b('0x2'))('api');var moment=require(_0xbd0b('0x3'));var BPromise=require('bluebird');var rp=require(_0xbd0b('0x4'));var fs=require('fs');var path=require(_0xbd0b('0x5'));var rimraf=require('rimraf');var config=require(_0xbd0b('0x6'));var attributes=require('./squareProject.attributes');module[_0xbd0b('0x7')]=function(_0x1b2499,_0x158b5c){return _0x1b2499[_0xbd0b('0x8')](_0xbd0b('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a4075,_0x4533ff,_0x39c099){if(_0x2a4075[_0xbd0b('0xa')](_0xbd0b('0xb'))){_0x2a4075['savedAt']=moment()['format'](_0xbd0b('0xc'));}if(_0x2a4075[_0xbd0b('0xa')]('production')){_0x2a4075[_0xbd0b('0xd')]=moment()[_0xbd0b('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x39c099(null,_0x2a4075);}}});};