Built motion from commit 351e7f9c.|2.6.31
[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 _0xe855=['SquareProject','square_projects','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./squareProject.attributes','exports','define'];(function(_0x50aa4b,_0x77f234){var _0x20fbd9=function(_0x52c967){while(--_0x52c967){_0x50aa4b['push'](_0x50aa4b['shift']());}};_0x20fbd9(++_0x77f234);}(_0xe855,0x1e3));var _0x5e85=function(_0x3b1000,_0x2c12dd){_0x3b1000=_0x3b1000-0x0;var _0x5ef136=_0xe855[_0x3b1000];return _0x5ef136;};'use strict';var _=require(_0x5e85('0x0'));var util=require(_0x5e85('0x1'));var logger=require(_0x5e85('0x2'))(_0x5e85('0x3'));var moment=require(_0x5e85('0x4'));var BPromise=require(_0x5e85('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e85('0x6'));var rimraf=require(_0x5e85('0x7'));var config=require('../../config/environment');var attributes=require(_0x5e85('0x8'));module[_0x5e85('0x9')]=function(_0x3c74d1,_0x474fee){return _0x3c74d1[_0x5e85('0xa')](_0x5e85('0xb'),attributes,{'tableName':_0x5e85('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x258dc0,_0x64a76a,_0x11da51){if(_0x258dc0[_0x5e85('0xd')]('preproduction')){_0x258dc0[_0x5e85('0xe')]=moment()[_0x5e85('0xf')](_0x5e85('0x10'));}if(_0x258dc0['changed'](_0x5e85('0x11'))){_0x258dc0[_0x5e85('0x12')]=moment()['format'](_0x5e85('0x10'));}_0x11da51(null,_0x258dc0);}}});};