Conversation
Fix Domain EntityCollection
Fix Insert Many Heritages Repository
Fix: change request data for applying new method
Replace test data single data into multi data
There was a problem hiding this comment.
Pull Request Overview
This PR introduces support for transnational UNESCO World Heritage sites by adding functionality to handle multiple state parties for heritage sites, with metadata tracking for each state party. The implementation includes new data fields for state party codes and metadata, updates to test data to focus on transnational sites, and comprehensive testing across all layers.
- Updated data models to support state party collections and metadata
- Added database seeding for country data in test setup
- Modified test data from single-country Japanese sites to multi-country European and Central Asian sites
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| CreateManyWorldHeritagesTest.php | Updated test data and added country seeding setup |
| CreateWorldManyHeritagesUseCase.php | Added state party codes and metadata parameters to use case |
| WorldHeritageViewModelCollectionFactoryTest.php | Updated test data and added state party field handling |
| WorldHeritageDtoCollectionTest.php | Added country seeding and updated test data validation |
| CreateWorldHeritagesUseCaseTest.php | Added country model imports and seeding setup |
| CreateWorldHeritageUseCaseTest.php | Removed hardcoded ID from test data |
| WorldHeritageListQueryFactory.php | Fixed parameter mapping from state_party_codes to state_parties |
| WorldHeritageDtoCollectionFactory.php | Added state party codes and metadata to DTO factory |
| WorldHeritageDtoCollection.php | Added state party fields to array output |
| WorldHeritageDto.php | Updated array key from state_parties to state_party_codes |
| WorldHeritageController_registerManyTest.php | Updated constructor calls and added state party validation |
| WorldHeritageEntityCollectionTest.php | Added multi-country test cases and updated entity creation |
| WorldHeritageRepository_insertManyTest.php | Updated test data and added state party validation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| $data['id'], | ||
| $data['unesco_id'], | ||
| $data['official_name'], | ||
| $data['name'], | ||
| $data['country'], | ||
| $data['region'], | ||
| $data['category'], | ||
| $data['year_inscribed'], | ||
| $data['latitude'] ?? null, | ||
| $data['longitude'] ?? null, | ||
| $data['is_endangered'] ?? false, | ||
| $data['name_jp'] ?? null, | ||
| $data['state_party'] ?? null, | ||
| $data['criteria'] ?? [], | ||
| $data['area_hectares'] ?? null, | ||
| $data['buffer_zone_hectares'] ?? null, | ||
| $data['short_description'] ?? null, | ||
| $data['image_url'] ?? null, | ||
| $data['unesco_site_url'] ?? null, | ||
| $data['state_parties'] ?? [], | ||
| $data['state_parties_meta'] ?? [] |
There was a problem hiding this comment.
The WorldHeritageDto constructor is being called with positional arguments, which makes the code fragile to parameter order changes. Consider using named parameters for better maintainability.
| $data['id'], | |
| $data['unesco_id'], | |
| $data['official_name'], | |
| $data['name'], | |
| $data['country'], | |
| $data['region'], | |
| $data['category'], | |
| $data['year_inscribed'], | |
| $data['latitude'] ?? null, | |
| $data['longitude'] ?? null, | |
| $data['is_endangered'] ?? false, | |
| $data['name_jp'] ?? null, | |
| $data['state_party'] ?? null, | |
| $data['criteria'] ?? [], | |
| $data['area_hectares'] ?? null, | |
| $data['buffer_zone_hectares'] ?? null, | |
| $data['short_description'] ?? null, | |
| $data['image_url'] ?? null, | |
| $data['unesco_site_url'] ?? null, | |
| $data['state_parties'] ?? [], | |
| $data['state_parties_meta'] ?? [] | |
| id: $data['id'], | |
| unesco_id: $data['unesco_id'], | |
| official_name: $data['official_name'], | |
| name: $data['name'], | |
| country: $data['country'], | |
| region: $data['region'], | |
| category: $data['category'], | |
| year_inscribed: $data['year_inscribed'], | |
| latitude: $data['latitude'] ?? null, | |
| longitude: $data['longitude'] ?? null, | |
| is_endangered: $data['is_endangered'] ?? false, | |
| name_jp: $data['name_jp'] ?? null, | |
| state_party: $data['state_party'] ?? null, | |
| criteria: $data['criteria'] ?? [], | |
| area_hectares: $data['area_hectares'] ?? null, | |
| buffer_zone_hectares: $data['buffer_zone_hectares'] ?? null, | |
| short_description: $data['short_description'] ?? null, | |
| image_url: $data['image_url'] ?? null, | |
| unesco_site_url: $data['unesco_site_url'] ?? null, | |
| state_parties: $data['state_parties'] ?? [], | |
| state_parties_meta: $data['state_parties_meta'] ?? [] |
No description provided.