Skip to content

Commit

Permalink
further code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
xHeaven committed Aug 8, 2023
1 parent c04d4a9 commit 1a593de
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 70 deletions.
11 changes: 4 additions & 7 deletions src/Enums/AccessScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@

namespace Nordigen\NordigenPHP\Enums;

final class AccessScope
enum AccessScope: string
{
/**
* Details scope.
* @var string
*/
public const DETAILS = 'details';
case DETAILS = 'details';
/**
* Balance scope.
* @var string
*/
public const BALANCES = 'balances';
case BALANCES = 'balances';
/**
* Transactions scope.
* @var string
*/
public const TRANSACTIONS = 'transactions';
case TRANSACTIONS = 'transactions';
}
20 changes: 7 additions & 13 deletions src/Enums/AccountProcessingStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,30 @@

namespace Nordigen\NordigenPHP\Enums;

class AccountProcessingStatus
enum AccountProcessingStatus: string
{
/**
* User has successfully authenticated themselves, and the account has been discovered.
* @var string
*/
public const DISCOVERED = 'DISCOVERED';
case DISCOVERED = 'DISCOVERED';
/**
* An error was encountered while processing the account.
* @var string
*/
public const PROCESSING = 'PROCESSING';
case PROCESSING = 'PROCESSING';
/**
* Account has been successfully processed.
* @var string
*/
public const READY = 'READY';
case READY = 'READY';
/**
* An error was encountered while processing the account.
* @var string
*/
public const ERROR = 'ERROR';
case ERROR = 'ERROR';
/**
* Account has been suspended (more than 10 consecutive failed attempts to access the account).
* @var string
*/
public const SUSPENDED = 'SUSPENDED';
case SUSPENDED = 'SUSPENDED';
/**
* Access to account has expired as set in the End User Agreement.
* @var string
*/
public const EXPIRED = 'EXPIRED';
case EXPIRED = 'EXPIRED';
}
8 changes: 3 additions & 5 deletions src/Enums/AccountUsage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

namespace Nordigen\NordigenPHP\Enums;

class AccountUsage
enum AccountUsage: string
{
/**
* Professional account.
* @var string
*/
public const ORGA = 'ORGA';
case ORGA = 'ORGA';
/**
* Private personal account.
* @var string
*/
public const PRIV = 'PRIVATE';
case PRIV = 'PRIVATE';
}
38 changes: 13 additions & 25 deletions src/Enums/BalanceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Nordigen\NordigenPHP\Enums;

class BalanceType
enum BalanceType: string
{
/**
* Balance of the account at the end of the pre-agreed account reporting period.
Expand All @@ -11,14 +11,12 @@ class BalanceType
*
* For card-accounts, this is composed of:
* - invoiced, but not yet paid entries.
* @var string
*/
public const CLOSING_BOOKED = 'closingBooked';
case CLOSING_BOOKED = 'closingBooked';
/**
* Closing balance of amount of money that is at the disposal of the account owner on the date specified.
* @var string
*/
public const CLOSING_AVAILABLE = 'closingAvailable';
case CLOSING_AVAILABLE = 'closingAvailable';
/**
* Balance composed of booked entries and pending items known at the time of calculation,
* which projects the end of day balance if everything is booked
Expand All @@ -28,31 +26,26 @@ class BalanceType
* - invoiced, but not yet paid entries,
* - not yet invoiced but already booked entries,
* - pending items (not yet booked)
* @var string
*/
public const EXPECTED = 'expected';
case EXPECTED = 'expected';
/**
* Book balance of the account at the beginning of the account reporting period.<br>
* It always equals the closing book balance from the previous report.
* @var string
*/
public const OPENING_BOOKED = 'openingBooked';
case OPENING_BOOKED = 'openingBooked';
/**
* Opening balance of amount of money that is at the disposal of the account owner on the date specified.
* @var string
*/
public const OPENING_AVAILABLE = 'openingAvailable';
case OPENING_AVAILABLE = 'openingAvailable';
/**
* Balance of the account at the previously closed account reporting period.<br>
* The opening booked balance for the new period has to be equal to this balance.
* @var string
*/
public const PREVIOUSLY_CLOSING_BOOKED = 'previouslyClosingBooked';
case PREVIOUSLY_CLOSING_BOOKED = 'previouslyClosingBooked';
/**
* Balance for informational purposes.
* @var string
*/
public const INFORMATION = 'information';
case INFORMATION = 'information';
/**
* Available balance calculated in the course of the account servicer’s business day, at the time specified,
* and subject to further changes during the business day.<br>
Expand All @@ -61,30 +54,25 @@ class BalanceType
* For card-accounts, this is composed of:
* - invoiced, but not yet paid entries,
* - not yet invoiced but already booked entries
* @var string
*/
public const INTERIM_AVAILABLE = 'interimAvailable';
case INTERIM_AVAILABLE = 'interimAvailable';
/**
* Balance calculated in the course of the account servicer's business day, at the time specified,
* and subject to further changes during the business day.<br>
* The interim balance is calculated on the basis of
* booked credit and debit items during the calculation time/period specified.
* @var string
*/
public const INTERIM_BOOKED = 'interimBooked';
case INTERIM_BOOKED = 'interimBooked';
/**
* Forward available balance of money that is at the disposal of the account owner on the date specified.
* @var string
*/
public const FORWARD_AVAILABLE = 'forwardAvailable';
case FORWARD_AVAILABLE = 'forwardAvailable';
/**
* Only for card accounts, to be defined yet.
* @var string
*/
public const NON_INVOICED = 'nonInvoiced';
case NON_INVOICED = 'nonInvoiced';
/**
* Deprecated value. Analogous to interimBooked.
* @var string
*/
public const AUTHORIZED = 'authorized';
case AUTHORIZED = 'authorized';
}
31 changes: 11 additions & 20 deletions src/Enums/RequisitionStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,42 @@

namespace Nordigen\NordigenPHP\Enums;

class RequisitionStatus
enum RequisitionStatus: string
{
/**
* Requisition has been successfully created.
* @var string
*/
public const CREATED = 'CR';
case CREATED = 'CR';
/**
* Account has been successfully linked to requisition.
* @var string
*/
public const LINKED = 'LN';
case LINKED = 'LN';
/**
* Requisition is suspended due to numerous consecutive errors that happened while accessing its accounts.
* @var string
*/
public const SUSPENDED = 'SU';
case SUSPENDED = 'SU';
/**
* End-user is giving consent at Nordigen's consent screen.
* @var string
*/
public const GIVING_CONSENT = 'GC';
case GIVING_CONSENT = 'GC';
/**
* End-user is redirected to the financial institution for authentication.
* @var string
*/
public const UNDERGOING_AUTHENTICATION = 'UA';
case UNDERGOING_AUTHENTICATION = 'UA';
/**
* SSN verification has failed.
* @var string
*/
public const REJECTED = 'RJ';
case REJECTED = 'RJ';
/**
* End-user is selecting accounts.
* @var string
*/
public const SELECTING_ACCOUNTS = 'SA';
case SELECTING_ACCOUNTS = 'SA';
/**
* End-user is granting access to their account information.
* @var string
*/
public const GRANTING_ACCESS = 'GA';
case GRANTING_ACCESS = 'GA';
/**
* Access to accounts has expired as set in End User Agreement.
* @var string
* Access to accounts has expired as set in End User Agreement.
*/
public const EXPIRED = 'EX';
case EXPIRED = 'EX';
}

0 comments on commit 1a593de

Please sign in to comment.