Built motion from commit 936e8062.|2.5.33
[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 _0x6411=['production','publishedAt','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','SquareProject','square_projects','changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x15bdee,_0x1db4db){var _0x11ac81=function(_0xd89de0){while(--_0xd89de0){_0x15bdee['push'](_0x15bdee['shift']());}};_0x11ac81(++_0x1db4db);}(_0x6411,0x142));var _0x1641=function(_0x4fe3a3,_0x28a7a9){_0x4fe3a3=_0x4fe3a3-0x0;var _0x43893d=_0x6411[_0x4fe3a3];return _0x43893d;};'use strict';var _=require(_0x1641('0x0'));var util=require(_0x1641('0x1'));var logger=require(_0x1641('0x2'))(_0x1641('0x3'));var moment=require(_0x1641('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1641('0x5'));var rimraf=require(_0x1641('0x6'));var config=require(_0x1641('0x7'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x545750,_0x27be94){return _0x545750['define'](_0x1641('0x8'),attributes,{'tableName':_0x1641('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5bb57b,_0x11b2db,_0x3d7b91){if(_0x5bb57b[_0x1641('0xa')](_0x1641('0xb'))){_0x5bb57b['savedAt']=moment()[_0x1641('0xc')](_0x1641('0xd'));}if(_0x5bb57b['changed'](_0x1641('0xe'))){_0x5bb57b[_0x1641('0xf')]=moment()['format'](_0x1641('0xd'));}_0x3d7b91(null,_0x5bb57b);}}});};