e279b93ee7cb39b117c80deb04d74de6d299f629
[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 _0xa4fb=['rimraf','./squareProject.attributes','exports','define','SquareProject','square_projects','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x27e029,_0x17e305){var _0x29bf95=function(_0x4755a4){while(--_0x4755a4){_0x27e029['push'](_0x27e029['shift']());}};_0x29bf95(++_0x17e305);}(_0xa4fb,0x150));var _0xba4f=function(_0x1a37e3,_0x5db8f6){_0x1a37e3=_0x1a37e3-0x0;var _0x4db78a=_0xa4fb[_0x1a37e3];return _0x4db78a;};'use strict';var _=require(_0xba4f('0x0'));var util=require(_0xba4f('0x1'));var logger=require(_0xba4f('0x2'))(_0xba4f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xba4f('0x4'));var fs=require('fs');var path=require(_0xba4f('0x5'));var rimraf=require(_0xba4f('0x6'));var config=require('../../config/environment');var attributes=require(_0xba4f('0x7'));module[_0xba4f('0x8')]=function(_0x379b0f,_0x18baa8){return _0x379b0f[_0xba4f('0x9')](_0xba4f('0xa'),attributes,{'tableName':_0xba4f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1af837,_0x399847,_0x27f65a){if(_0x1af837['changed'](_0xba4f('0xc'))){_0x1af837['savedAt']=moment()[_0xba4f('0xd')](_0xba4f('0xe'));}if(_0x1af837[_0xba4f('0xf')](_0xba4f('0x10'))){_0x1af837[_0xba4f('0x11')]=moment()[_0xba4f('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x27f65a(null,_0x1af837);}}});};