7406d516724527a8301a44fd0b1ca2fb907cd416
[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 _0x38f6=['rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','../../config/logger','moment','bluebird','request-promise'];(function(_0x31fa17,_0x4e9825){var _0x9d8c5e=function(_0x1de9a7){while(--_0x1de9a7){_0x31fa17['push'](_0x31fa17['shift']());}};_0x9d8c5e(++_0x4e9825);}(_0x38f6,0x1b6));var _0x638f=function(_0x4e9043,_0x11fb9e){_0x4e9043=_0x4e9043-0x0;var _0x3af9e8=_0x38f6[_0x4e9043];return _0x3af9e8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x638f('0x0'))('api');var moment=require(_0x638f('0x1'));var BPromise=require(_0x638f('0x2'));var rp=require(_0x638f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x638f('0x4'));var config=require(_0x638f('0x5'));var attributes=require(_0x638f('0x6'));module[_0x638f('0x7')]=function(_0x1d89e5,_0xb1c5f){return _0x1d89e5[_0x638f('0x8')](_0x638f('0x9'),attributes,{'tableName':_0x638f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2fb349,_0x42408a,_0x5dd74a){if(_0x2fb349[_0x638f('0xb')](_0x638f('0xc'))){_0x2fb349[_0x638f('0xd')]=moment()['format'](_0x638f('0xe'));}if(_0x2fb349['changed'](_0x638f('0xf'))){_0x2fb349[_0x638f('0x10')]=moment()['format'](_0x638f('0xe'));}_0x5dd74a(null,_0x2fb349);}}});};