2f270341497c393f7f9e76b819a873682451ff34
[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 _0x3c70=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareProject','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','moment'];(function(_0x3ef5a9,_0x4a2ac6){var _0x272e9a=function(_0x4e5d1d){while(--_0x4e5d1d){_0x3ef5a9['push'](_0x3ef5a9['shift']());}};_0x272e9a(++_0x4a2ac6);}(_0x3c70,0x10c));var _0x03c7=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x3c70[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x03c7('0x0'));var util=require(_0x03c7('0x1'));var logger=require(_0x03c7('0x2'))('api');var moment=require(_0x03c7('0x3'));var BPromise=require(_0x03c7('0x4'));var rp=require(_0x03c7('0x5'));var fs=require('fs');var path=require(_0x03c7('0x6'));var rimraf=require(_0x03c7('0x7'));var config=require(_0x03c7('0x8'));var attributes=require('./squareProject.attributes');module[_0x03c7('0x9')]=function(_0x4f774e,_0x5b6c32){return _0x4f774e[_0x03c7('0xa')](_0x03c7('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x263185,_0x1b6acc,_0x332fb3){if(_0x263185['changed'](_0x03c7('0xc'))){_0x263185['savedAt']=moment()[_0x03c7('0xd')](_0x03c7('0xe'));}if(_0x263185['changed'](_0x03c7('0xf'))){_0x263185[_0x03c7('0x10')]=moment()[_0x03c7('0xd')](_0x03c7('0xe'));}_0x332fb3(null,_0x263185);}}});};