tercul-backend/internal/adapters/graphql
google-labs-jules[bot] 9fd2331eb4 feat: Implement production-ready API patterns
This commit introduces a comprehensive set of foundational improvements to make the API more robust, secure, and observable.

The following features have been implemented:

- **Observability Stack:** A new `internal/observability` package has been added, providing structured logging with `zerolog`, Prometheus metrics, and OpenTelemetry tracing. This stack is fully integrated into the application's request pipeline.

- **Centralized Authorization:** A new `internal/app/authz` service has been created to centralize authorization logic. This service is now used by the `user`, `work`, and `comment` services to protect all Create, Update, and Delete operations.

- **Standardized Input Validation:** The previous ad-hoc validation has been replaced with a more robust, struct-tag-based system using the `go-playground/validator` library. This has been applied to all GraphQL input models.

- **Structured Error Handling:** A new set of custom error types has been introduced in the `internal/domain` package. A custom `gqlgen` error presenter has been implemented to map these domain errors to structured GraphQL error responses with specific error codes.

- **`updateUser` Endpoint:** The `updateUser` mutation has been fully implemented as a proof of concept for the new patterns, including support for partial updates and comprehensive authorization checks.

- **Test Refactoring:** The test suite has been significantly improved by decoupling mock repositories from the shared `testutil` package, resolving circular dependency issues and making the tests more maintainable.
2025-10-04 18:16:08 +00:00
..
model feat: Implement production-ready API patterns 2025-10-04 18:16:08 +00:00
.keep I have refactored the background jobs by moving all related logic from the syncjob/, linguistics/, and internal/enrich directories into the new internal/jobs/sync and internal/jobs/linguistics packages. I have also updated their package declarations to be consistent with their new locations. 2025-09-02 15:02:04 +00:00
binding.go feat(analytics): Enhance analytics capabilities 2025-09-07 19:26:51 +00:00
errors.go feat: Implement production-ready API patterns 2025-10-04 18:16:08 +00:00
generated.go refactor: Refactor GraphQL tests to use mock-based unit tests 2025-10-03 09:21:41 +00:00
graphql_test_utils_test.go refactor: Refactor GraphQL tests to use mock-based unit tests 2025-10-03 09:21:41 +00:00
helpers.go This commit introduces goose as the database migration tool for the project, replacing the previous gorm.AutoMigrate system. It also includes several code quality improvements identified during the refactoring process. 2025-10-03 02:52:01 +00:00
integration_test.go feat: Implement production-ready API patterns 2025-10-04 18:16:08 +00:00
like_resolvers_unit_test.go feat: Implement production-ready API patterns 2025-10-04 18:16:08 +00:00
resolver.go refactor: Refactor GraphQL tests to use mock-based unit tests 2025-10-03 09:21:41 +00:00
schema.graphqls refactor: Refactor GraphQL tests to use mock-based unit tests 2025-10-03 09:21:41 +00:00
schema.resolvers.go feat: Implement production-ready API patterns 2025-10-04 18:16:08 +00:00
validation.go feat: Implement production-ready API patterns 2025-10-04 18:16:08 +00:00
work_repo_mock_test.go feat: Implement production-ready API patterns 2025-10-04 18:16:08 +00:00