Built motion from commit (unavailable).|2.5.25
[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 _0x84ab=['savedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./squareProject.attributes','exports','SquareProject','changed'];(function(_0x307d41,_0x1ba699){var _0x48e1e4=function(_0x13c84f){while(--_0x13c84f){_0x307d41['push'](_0x307d41['shift']());}};_0x48e1e4(++_0x1ba699);}(_0x84ab,0x12f));var _0xb84a=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x84ab[_0x46d0c9];return _0x174506;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var logger=require(_0xb84a('0x2'))(_0xb84a('0x3'));var moment=require(_0xb84a('0x4'));var BPromise=require('bluebird');var rp=require(_0xb84a('0x5'));var fs=require('fs');var path=require(_0xb84a('0x6'));var rimraf=require('rimraf');var config=require(_0xb84a('0x7'));var attributes=require(_0xb84a('0x8'));module[_0xb84a('0x9')]=function(_0x5b9def,_0x521a64){return _0x5b9def['define'](_0xb84a('0xa'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e9086,_0x8d9dbe,_0x4d9321){if(_0x3e9086[_0xb84a('0xb')]('preproduction')){_0x3e9086[_0xb84a('0xc')]=moment()[_0xb84a('0xd')](_0xb84a('0xe'));}if(_0x3e9086['changed']('production')){_0x3e9086['publishedAt']=moment()[_0xb84a('0xd')](_0xb84a('0xe'));}_0x4d9321(null,_0x3e9086);}}});};