Built motion from commit da617fac.|2.6.6
[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 _0xea54=['./squareProject.attributes','exports','define','SquareProject','preproduction','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x44b794,_0x451ad2){var _0x1f3c3b=function(_0x15c6c1){while(--_0x15c6c1){_0x44b794['push'](_0x44b794['shift']());}};_0x1f3c3b(++_0x451ad2);}(_0xea54,0x1c9));var _0x4ea5=function(_0x19a409,_0x24dac3){_0x19a409=_0x19a409-0x0;var _0x28241f=_0xea54[_0x19a409];return _0x28241f;};'use strict';var _=require(_0x4ea5('0x0'));var util=require(_0x4ea5('0x1'));var logger=require(_0x4ea5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4ea5('0x3'));var rp=require(_0x4ea5('0x4'));var fs=require('fs');var path=require(_0x4ea5('0x5'));var rimraf=require('rimraf');var config=require(_0x4ea5('0x6'));var attributes=require(_0x4ea5('0x7'));module[_0x4ea5('0x8')]=function(_0x5a5a8e,_0x4d1779){return _0x5a5a8e[_0x4ea5('0x9')](_0x4ea5('0xa'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2970f8,_0x2f2fb1,_0x27b427){if(_0x2970f8['changed'](_0x4ea5('0xb'))){_0x2970f8['savedAt']=moment()[_0x4ea5('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2970f8['changed'](_0x4ea5('0xd'))){_0x2970f8[_0x4ea5('0xe')]=moment()[_0x4ea5('0xc')](_0x4ea5('0xf'));}_0x27b427(null,_0x2970f8);}}});};