Fix get method Application Layer#97
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes issues in the Application Layer by updating the WorldHeritageDto parameter order, changing latitude/longitude types to nullable floats, and updating test data and configuration.
- Reorders parameters in WorldHeritageDto constructor to fix parameter sequence issues
- Changes latitude and longitude from required floats to nullable floats
- Updates test data from Japanese heritage site to European beech forests site
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| GetWorldHeritageByIdUseCase.php | Reorders DTO constructor parameters and adds unused WorldHeritage import |
| GetWorldHeritageByIdUseCaseTest.php | Updates test data and seeder, adds Country model import |
| GetWorldHeritageByIdDtoTest.php | Updates test data and adds database refresh functionality |
| WorldHeritageDtoCollection.php | Adds null coalescing operators for latitude/longitude |
| WorldHeritageDto.php | Changes latitude/longitude types to nullable float |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| namespace App\Packages\Features\QueryUseCases\UseCase; | ||
|
|
||
| use App\Models\WorldHeritage; |
There was a problem hiding this comment.
The WorldHeritage model import is not used in this file. Remove the unused import to keep the code clean.
| use App\Models\WorldHeritage; |
| DB::connection('mysql')->statement('SET FOREIGN_KEY_CHECKS=0;'); | ||
| WorldHeritage::truncate(); | ||
| Country::truncate(); | ||
| DB::table('site_state_parties')->truncate(); | ||
| DB::connection('mysql')->statement('SET FOREIGN_KEY_CHECKS=1;'); |
There was a problem hiding this comment.
The database refresh logic is duplicated between this test and GetWorldHeritageByIdUseCaseTest. Consider extracting this into a shared trait or base test class to reduce code duplication.
what i have done