Skip to content

South Asia Content#53

Merged
zigzagdev merged 18 commits intomainfrom
feature/south-asia
Aug 16, 2025
Merged

South Asia Content#53
zigzagdev merged 18 commits intomainfrom
feature/south-asia

Conversation

@zigzagdev
Copy link
Copy Markdown
Owner

What i have done

  • Created Services

    • WorldHeritage Repository
    • WorldHeritage Repository Interface
    • CreateWorldHeritage Command
    • Create WorldHeritage UseCase
  • Added Methods

    • WorldHeritage Controller register method

@zigzagdev zigzagdev requested a review from Copilot August 16, 2025 07:19
@zigzagdev zigzagdev self-assigned this Aug 16, 2025
@zigzagdev zigzagdev linked an issue Aug 16, 2025 that may be closed by this pull request
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 merged commit 94b82cf into main Aug 16, 2025
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 implements functionality to create new World Heritage sites by adding the necessary services, repositories, and API endpoints. The changes follow a clean architecture pattern with proper separation of concerns.

  • Added a complete service layer for creating World Heritage entries including repository pattern implementation
  • Created comprehensive test coverage for all new components including unit and integration tests
  • Added a new API endpoint for registering World Heritage sites

Reviewed Changes

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

Show a summary per file
File Description
src/routes/api.php Added POST endpoint for registering World Heritage sites
src/database/seeders/JapaneseWorldHeritageSeeder.php New seeder with Japanese World Heritage site data for testing
src/bootstrap/providers.php Registered new RepositoryProvider for dependency injection
src/app/Providers/RepositoryProvider.php Service provider binding repository interface to implementation
src/app/Packages/Features/QueryUseCases/UseCase/CreateWorldHeritageUseCase.php Use case handling World Heritage creation business logic
src/app/Packages/Features/Controller/WorldHeritageController.php Added controller method for heritage registration
src/app/Packages/Domains/WorldHeritageRepository*.php Repository interface and implementation for data persistence
src/app/Packages/Features/QueryUseCases/ListQuery/WorldHeritageListQuery.php Query object for World Heritage data validation
src/app/Packages/Features/QueryUseCases/Factory/WorldHeritageListQueryFactory.php Factory for creating validated query objects
src/app/Packages/Domains/WorldHeritageEntity.php Updated entity to allow nullable ID for new records
src/app/Models/WorldHeritage.php Added proper type casting for model attributes
Various test files Comprehensive test coverage for all new functionality
docker-compose.yml Fixed database name formatting for consistency

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

use App\Models\WorldHeritage;
use Exception;

readonly class WorldHeritageRepository implements WorldHeritageRepositoryInterface
Copy link

Copilot AI Aug 16, 2025

Choose a reason for hiding this comment

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

The 'readonly' keyword should be placed before the 'class' keyword. The correct syntax is 'readonly class WorldHeritageRepository'.

Suggested change
readonly class WorldHeritageRepository implements WorldHeritageRepositoryInterface
readonly class WorldHeritageRepository implements WorldHeritageRepositoryInterface

Copilot uses AI. Check for mistakes.
self::arrayData()['year_inscribed'],
self::arrayData()['is_endangered'],
self::arrayData()['latitude'],
self::arrayData()['longitude'],
Copy link

Copilot AI Aug 16, 2025

Choose a reason for hiding this comment

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

The parameter order in the WorldHeritageEntity constructor is incorrect. The 'is_endangered' parameter should come after 'year_inscribed', but it's currently placed after 'longitude'. This will cause the constructor to receive the wrong values for each parameter.

Suggested change
self::arrayData()['longitude'],
self::arrayData()['latitude'],
self::arrayData()['longitude'],
self::arrayData()['is_endangered'],

Copilot uses AI. Check for mistakes.

return new WorldHeritageListQuery(
id: Arr::get($request, 'id', null),
unesco_id: $request['unesco_id'],
Copy link

Copilot AI Aug 16, 2025

Choose a reason for hiding this comment

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

The unesco_id is expected to be an integer based on the WorldHeritageListQuery constructor, but no type casting is applied here. This could cause type errors if the input is a string. Consider casting to int: (int)$request['unesco_id'].

Suggested change
unesco_id: $request['unesco_id'],
unesco_id: (int)$request['unesco_id'],

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

South Asia

2 participants