Skip to content

Chore/delete redundant command#382

Merged
zigzagdev merged 3 commits intochore/clean-up-commmandsfrom
chore/delete-redundant-command
Mar 28, 2026
Merged

Chore/delete redundant command#382
zigzagdev merged 3 commits intochore/clean-up-commmandsfrom
chore/delete-redundant-command

Conversation

@zigzagdev
Copy link
Copy Markdown
Owner

No description provided.

@zigzagdev zigzagdev changed the base branch from main to chore/clean-up-commmands March 28, 2026 07:01
@zigzagdev zigzagdev requested a review from Copilot March 28, 2026 07:01
@zigzagdev zigzagdev self-assigned this Mar 28, 2026
Copy link
Copy Markdown
Owner Author

@zigzagdev zigzagdev left a comment

Choose a reason for hiding this comment

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

Ok

@zigzagdev zigzagdev linked an issue Mar 28, 2026 that may be closed by this pull request
@zigzagdev zigzagdev merged commit 970326f into chore/clean-up-commmands Mar 28, 2026
27 checks passed
@zigzagdev zigzagdev deleted the chore/delete-redundant-command branch March 28, 2026 07:01
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 removes several legacy console commands and shifts WorldHeritageQueryService to source the externally exposed region value from study_region (with seed/test updates to match).

Changes:

  • Add study_region values to seeded world_heritage_sites rows.
  • Update query service payloads to return region from study_region (and trim thumbnail select columns).
  • Delete multiple now-redundant console commands related to splitting/import/backfilling UNESCO data.

Reviewed changes

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

Show a summary per file
File Description
src/database/seeders/WorldHeritageSeeder.php Populate study_region for seeded sites.
src/app/Packages/Domains/WorldHeritageQueryService.php Use study_region as the source for returned region; adjust selected columns.
src/app/Packages/Domains/Test/QueryService/WorldHeritageQueryService_getByIdTest.php Update expectations to align with study_region-backed region behavior.
src/app/Console/Commands/SplitWorldHeritageImageJson.php Deleted redundant command.
src/app/Console/Commands/SplitCountryJson.php Deleted redundant command.
src/app/Console/Commands/ImportWorldHeritageFromJson.php Deleted redundant command.
src/app/Console/Commands/BuildWorldHeritageLocalDb.php Deleted redundant command.
src/app/Console/Commands/BackfillThumbnailImageId.php Deleted redundant command.
src/app/Console/Commands/BackfillStateParties.php Deleted redundant command.

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

Comment on lines 223 to 228
$thumbnailQuery->select([
'images.id',
'images.world_heritage_id',
'disk',
'path',
'width',
'height',
'format',
'checksum',
'sort_order',
'alt',
'credit',
]);
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

In the eager-loaded thumbnail relation select, the column names/table prefix appear to be for the old images table (images.id, images.world_heritage_id, path). The thumbnail() relation uses App\Models\Image which maps to world_heritage_site_images and its columns are world_heritage_site_id and url (no world_heritage_id/path). This will cause SQL errors when eager-loading the relation. Update the select to use the correct table/columns (or remove the select override entirely).

Copilot uses AI. Check for mistakes.
@@ -199,6 +199,7 @@ public function getHeritagesByIds(array $ids, int $currentPage, int $perPage): P
'name_jp',
'country',
'region',
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

getHeritagesByIds() selects both region and study_region, but the payload returned from the paginator uses only $heritage->study_region for the region field. Consider dropping region from the select list (or aliasing study_region as region) to avoid fetching an unused column and reduce confusion.

Suggested change
'region',

Copilot uses AI. Check for mistakes.
'country' => $displayCountry,
'country_name_jp' => $countryNameJp,
'region' => $heritage->region,
'region' => $heritage->study_region,
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

The PR title indicates only deleting a redundant command, but this change also alters the meaning of the API's region field to come from study_region (and updates seed/test data accordingly). Please update the PR title/description to reflect the behavior change, or split into separate PRs so reviewers/users can track the semantic change independently.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete Redundant Command

2 participants