mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 09:22:33 +00:00
Move constants to dedicated enum
This commit is contained in:
27
app/Enums/WebhookDelivery.php
Normal file
27
app/Enums/WebhookDelivery.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* WebhookDelivery.php
|
||||||
|
* Copyright (c) 2022 james@firefly-iii.org
|
||||||
|
*
|
||||||
|
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace FireflyIII\Enums;
|
||||||
|
|
||||||
|
enum WebhookDelivery: int
|
||||||
|
{
|
||||||
|
case DELIVERY_JSON = 300;
|
||||||
|
}
|
29
app/Enums/WebhookResponse.php
Normal file
29
app/Enums/WebhookResponse.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* WebhookResponse.php
|
||||||
|
* Copyright (c) 2022 james@firefly-iii.org
|
||||||
|
*
|
||||||
|
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace FireflyIII\Enums;
|
||||||
|
|
||||||
|
enum WebhookResponse: int
|
||||||
|
{
|
||||||
|
case RESPONSE_TRANSACTIONS = 200;
|
||||||
|
case RESPONSE_ACCOUNTS = 210;
|
||||||
|
case RESPONSE_NONE = 220;
|
||||||
|
}
|
29
app/Enums/WebhookTrigger.php
Normal file
29
app/Enums/WebhookTrigger.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* WebhookTrigger.php
|
||||||
|
* Copyright (c) 2022 james@firefly-iii.org
|
||||||
|
*
|
||||||
|
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace FireflyIII\Enums;
|
||||||
|
|
||||||
|
enum WebhookTrigger: int
|
||||||
|
{
|
||||||
|
case TRIGGER_STORE_TRANSACTION = 100;
|
||||||
|
case TRIGGER_UPDATE_TRANSACTION = 110;
|
||||||
|
case TRIGGER_DESTROY_TRANSACTION = 120;
|
||||||
|
}
|
@@ -77,20 +77,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|||||||
class Webhook extends Model
|
class Webhook extends Model
|
||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
// dont forget to update the config in firefly.php
|
|
||||||
// triggers
|
|
||||||
public const DELIVERY_JSON = 300;
|
|
||||||
public const RESPONSE_ACCOUNTS = 210;
|
|
||||||
public const RESPONSE_NONE = 220;
|
|
||||||
|
|
||||||
// actions
|
|
||||||
public const RESPONSE_TRANSACTIONS = 200;
|
|
||||||
public const TRIGGER_DESTROY_TRANSACTION = 120;
|
|
||||||
public const TRIGGER_STORE_TRANSACTION = 100;
|
|
||||||
|
|
||||||
// delivery
|
|
||||||
public const TRIGGER_UPDATE_TRANSACTION = 110;
|
|
||||||
protected $casts
|
protected $casts
|
||||||
= [
|
= [
|
||||||
'active' => 'boolean',
|
'active' => 'boolean',
|
||||||
|
Reference in New Issue
Block a user