Skip to content

Refactor BankDTO to use BankType enum and remove RecipientType refere…#21

Merged
faridibin merged 1 commit intomainfrom
development
Nov 3, 2025
Merged

Refactor BankDTO to use BankType enum and remove RecipientType refere…#21
faridibin merged 1 commit intomainfrom
development

Conversation

@faridibin
Copy link
Copy Markdown
Owner

@faridibin faridibin commented Nov 3, 2025

This pull request refactors the handling of bank types in the codebase by introducing a new BankType enum and updating the BankDTO data transfer object to use it instead of the previously used RecipientType enum. This change improves type safety and better reflects the domain model for banks, separating bank types from recipient types. Additionally, the RecipientType enum is cleaned up by removing the unused AUTHORIZATION case.

Bank Type Refactoring:

  • Added a new BankType enum in src/Enums/BankType.php, which defines specific bank types and includes helper methods for descriptions and supported currencies.
  • Updated the BankDTO class in src/DataTransferObjects/Miscellaneous/BankDTO.php to use BankType instead of RecipientType for the type property and constructor parameter, including all related type hints and docblocks. [1] [2] [3] [4] [5]

Recipient Type Cleanup:

  • Removed the AUTHORIZATION case from the RecipientType enum in src/Enums/RecipientType.php, along with its references in the description and supported currencies methods. [1] [2] [3]…nces

@faridibin faridibin requested a review from Copilot November 3, 2025 01:39
@faridibin faridibin self-assigned this Nov 3, 2025
@faridibin faridibin added the enhancement New feature or request label Nov 3, 2025
@faridibin faridibin merged commit 6383ea0 into main Nov 3, 2025
6 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the codebase to introduce a new BankType enum to replace the use of RecipientType in the BankDTO class, and removes the AUTHORIZATION case from RecipientType enum. The key changes include:

  • Created a new BankType enum with bank-specific types including MOBILE_MONEY_BUSINESS
  • Removed AUTHORIZATION case from RecipientType enum
  • Updated BankDTO to use BankType instead of RecipientType for better semantic clarity

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/Enums/RecipientType.php Removed the AUTHORIZATION case and its associated description and currencies
src/Enums/BankType.php Newly created enum with bank-specific types and methods, includes additional MOBILE_MONEY_BUSINESS case
src/DataTransferObjects/Miscellaneous/BankDTO.php Updated to use BankType instead of RecipientType for the type property, with corresponding documentation updates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

case BASA = 'basa';

/**
* Get the description of the recipient type.
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation comment incorrectly refers to 'recipient type' instead of 'bank type'. This should be updated to match the enum's purpose.

Copilot uses AI. Check for mistakes.
}

/**
* Get the currencies supported by the recipient type.
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation comment incorrectly refers to 'recipient type' instead of 'bank type'. This should be updated to match the enum's purpose.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants