Restore enums, replace one to enforce php 8.1 compatibility.

This commit is contained in:
James Cole
2022-04-13 16:27:01 +02:00
parent 71d53fbda4
commit cfcf860438
7 changed files with 76 additions and 20 deletions

View File

@@ -49,6 +49,22 @@ use Illuminate\Support\Carbon;
*/
class AccountType extends Model
{
public const ASSET = 'Asset account';
public const BENEFICIARY = 'Beneficiary account';
public const CASH = 'Cash account';
public const CREDITCARD = 'Credit card';
public const DEBT = 'Debt';
public const DEFAULT = 'Default account';
public const EXPENSE = 'Expense account';
public const IMPORT = 'Import account';
public const INITIAL_BALANCE = 'Initial balance account';
public const LIABILITY_CREDIT = 'Liability credit account';
public const LOAN = 'Loan';
public const MORTGAGE = 'Mortgage';
public const RECONCILIATION = 'Reconciliation account';
public const REVENUE = 'Revenue account';
/**
* The attributes that should be casted to native types.
*

View File

@@ -64,6 +64,9 @@ use Illuminate\Support\Carbon;
*/
class AutoBudget extends Model
{
public const AUTO_BUDGET_RESET = 1;
public const AUTO_BUDGET_ROLLOVER = 2;
use SoftDeletes;
/**

View File

@@ -62,6 +62,12 @@ use Illuminate\Support\Carbon;
*/
class RecurrenceRepetition extends Model
{
public const WEEKEND_DO_NOTHING = 1;
public const WEEKEND_SKIP_CREATION = 2;
public const WEEKEND_TO_FRIDAY = 3;
public const WEEKEND_TO_MONDAY = 4;
use SoftDeletes;
/**

View File

@@ -56,10 +56,17 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
*/
class TransactionType extends Model
{
public const DEPOSIT = 'Deposit';
public const INVALID = 'Invalid';
public const LIABILITY_CREDIT = 'Liability credit';
public const OPENING_BALANCE = 'Opening balance';
public const RECONCILIATION = 'Reconciliation';
public const TRANSFER = 'Transfer';
public const WITHDRAWAL = 'Withdrawal';
use SoftDeletes;
protected $casts
= [
= [
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',

View File

@@ -53,6 +53,16 @@ use Illuminate\Support\Carbon;
*/
class UserRole extends Model
{
public const CHANGE_PIGGY_BANKS = 'change_piggies';
public const CHANGE_REPETITIONS = 'change_reps';
public const CHANGE_RULES = 'change_rules';
public const CHANGE_TRANSACTIONS = 'change_tx';
public const FULL = 'full';
public const OWNER = 'owner';
public const READ_ONLY = 'ro';
public const VIEW_REPORTS = 'view_reports';
protected $fillable = ['title'];
/**

View File

@@ -76,7 +76,19 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
*/
class Webhook extends Model
{
// dont forget to update the config in firefly.php
public const DELIVERY_JSON = 300;
public const RESPONSE_ACCOUNTS = 210;
public const RESPONSE_NONE = 220;
public const RESPONSE_TRANSACTIONS = 200;
public const TRIGGER_DESTROY_TRANSACTION = 120;
public const TRIGGER_STORE_TRANSACTION = 100;
public const TRIGGER_UPDATE_TRANSACTION = 110;
use SoftDeletes;
protected $casts
= [
'active' => 'boolean',