Refactor BankDTO to use BankType enum and remove RecipientType refere…#21
Refactor BankDTO to use BankType enum and remove RecipientType refere…#21
Conversation
There was a problem hiding this comment.
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
BankTypeenum with bank-specific types includingMOBILE_MONEY_BUSINESS - Removed
AUTHORIZATIONcase fromRecipientTypeenum - Updated
BankDTOto useBankTypeinstead ofRecipientTypefor 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. |
There was a problem hiding this comment.
The documentation comment incorrectly refers to 'recipient type' instead of 'bank type'. This should be updated to match the enum's purpose.
| } | ||
|
|
||
| /** | ||
| * Get the currencies supported by the recipient type. |
There was a problem hiding this comment.
The documentation comment incorrectly refers to 'recipient type' instead of 'bank type'. This should be updated to match the enum's purpose.
This pull request refactors the handling of bank types in the codebase by introducing a new
BankTypeenum and updating theBankDTOdata transfer object to use it instead of the previously usedRecipientTypeenum. This change improves type safety and better reflects the domain model for banks, separating bank types from recipient types. Additionally, theRecipientTypeenum is cleaned up by removing the unusedAUTHORIZATIONcase.Bank Type Refactoring:
BankTypeenum insrc/Enums/BankType.php, which defines specific bank types and includes helper methods for descriptions and supported currencies.BankDTOclass insrc/DataTransferObjects/Miscellaneous/BankDTO.phpto useBankTypeinstead ofRecipientTypefor thetypeproperty and constructor parameter, including all related type hints and docblocks. [1] [2] [3] [4] [5]Recipient Type Cleanup:
AUTHORIZATIONcase from theRecipientTypeenum insrc/Enums/RecipientType.php, along with its references in the description and supported currencies methods. [1] [2] [3]…nces