Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several enhancements and fixes across multiple areas, including workflow updates, API documentation improvements, validation and contract additions, and feature expansions for product and category management. Below is a summary of the most important changes grouped by theme:
Workflow Updates
.github/workflows/release.yml: Addedworkflow_dispatchto enable manual testing and updated the authentication token for Docker registry login to useGHCR_TOKENexclusively. Also expanded supported platforms for Docker builds to includelinux/arm64. [1] [2] [3]API Documentation Enhancements
docs/RESTAPI.md: Expanded documentation for thePOST /api/admin/test/emailendpoint, detailing request and response formats, query parameters, and status codes. Added status codes forDELETE /api/admin/categories/{id}to clarify error handling scenarios. [1] [2]docs/email_test_api_examples.md: Added examples for testing the email API, including request formats, response samples, and notes about fallback behavior and validation.Validation and Contract Additions
internal/infrastructure/validation/validator.go: Introduced email validation logic and a structured approach for handling validation errors.internal/interfaces/api/contracts/email_contract.go: AddedEmailTestRequestcontract with validation support for email format.internal/interfaces/api/contracts/payments_contracts.go: Added contracts for payment capture and refund requests, supporting partial and full operations.Category Management Enhancements
internal/application/usecase/category_usecase.go: UpdatedCategoryUseCaseto prevent deletion of categories with associated products. Added dependency onProductRepositoryfor this check. [1] [2]internal/application/usecase/category_usecase_test.go: Added unit tests to verify behavior when attempting to delete categories with products or child categories.internal/domain/repository/product_repository.go: AddedHasProductsWithCategorymethod to check for products linked to a category.Product Management Enhancements
internal/application/usecase/product_usecase.go: EnhancedUpdateProductto validate currency changes and explicitly updateCategoryID. [1] [2]internal/domain/entity/product.go: UpdatedProduct.Updatemethod to support currency and category updates. [1] [2] [3]internal/domain/entity/product_test.go: Adjusted tests forProduct.Updateto include new fields like currency and category.internal/infrastructure/repository/gorm/product_repository.go: ModifiedUpdateto explicitly handle all fields, includingCategoryID. AddedHasProductsWithCategorymethod implementation. [1] [2]These changes collectively improve the functionality, maintainability, and clarity of the codebase while addressing key feature gaps and enhancing documentation.