Built motion from commit (unavailable).|2.5.22
[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 _0x5fd1=['preproduction','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','SquareProject'];(function(_0x1b6325,_0x1e53ce){var _0x5c8786=function(_0x5abb44){while(--_0x5abb44){_0x1b6325['push'](_0x1b6325['shift']());}};_0x5c8786(++_0x1e53ce);}(_0x5fd1,0x155));var _0x15fd=function(_0xba7507,_0x336146){_0xba7507=_0xba7507-0x0;var _0x2faa5a=_0x5fd1[_0xba7507];return _0x2faa5a;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var logger=require(_0x15fd('0x1'))(_0x15fd('0x2'));var moment=require(_0x15fd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x15fd('0x4'));var rimraf=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var attributes=require('./squareProject.attributes');module[_0x15fd('0x7')]=function(_0x386441,_0x18450c){return _0x386441[_0x15fd('0x8')](_0x15fd('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x210e90,_0x1ee117,_0x19806f){if(_0x210e90['changed'](_0x15fd('0xa'))){_0x210e90['savedAt']=moment()[_0x15fd('0xb')](_0x15fd('0xc'));}if(_0x210e90['changed']('production')){_0x210e90['publishedAt']=moment()[_0x15fd('0xb')](_0x15fd('0xc'));}_0x19806f(null,_0x210e90);}}});};