Feature/swagger ci fix#8
Merged
Merged
Conversation
- Move swaggerUIHTML constant from gateway.go to new swagger_ui.go file - Update Swagger UI CDN from jsdelivr to unpkg with version pinning (@5) - Add responsive styling for Swagger UI container with max-width and centering - Replace SwaggerUIBundle.SwaggerUIStandalonePreset with imported SwaggerUIStandalonePreset - Add window.onload wrapper for improved initialization handling - Enable deepLinking and DownloadUrl plugin for enhanced API documentation experience - Improves code organization by separating concerns between gateway setup and UI presentation
- Enable pull_request and push triggers on develop and main branches - Replace manual workflow_dispatch-only trigger with automated events - Add database migration step using golang-migrate before running tests - Rename DB_DSN to DB_DSN_TEST environment variable for test clarity - Ensure test database schema is up-to-date before test execution
- Replace inline Auditor interface with OutboxStore-based event persistence - Remove NoOp and WebhookAuditor implementations in favor of worker-based delivery - Add Worker type to handle asynchronous audit event processing and retry logic - Introduce AuditOutboxEntry and OutboxStore interface for durable event storage - Remove audit logging from Service.CreateTransaction, delegating to outbox worker - Simplify Service initialization by removing Auditor dependency - Implement polling-based delivery with configurable retry handling and status tracking - Improves reliability and decouples event production from delivery concerns
…ttern - Create audit_outbox table to implement transactional outbox pattern for reliable audit event delivery - Add audit_status ENUM type with states: PENDING, SENT, FAILED, DEAD_LETTERED - Include retry logic with configurable max_retries and retry_count tracking - Add partial index on status='PENDING' for efficient polling of pending events - Store action_type and JSONB payload for flexible audit event representation - Track processing metadata: created_at, processed_at, and last_error for observability - Ensures audit records are created atomically within the same transaction as ledger operations, preventing data loss during webhook failures
- Remove synchronous auditor from service initialization - Add audit outbox worker that polls and processes pending events - Create PollAuditOutbox, MarkAuditEntrySent, and MarkAuditEntryFailed store methods - Insert audit events into outbox table on transaction creation - Add /swagger.json endpoint to serve OpenAPI specification - Extract jsonEncode helper to eliminate repeated error suppression comments - Reorganize imports in gateway module for consistency - Configure worker with 5-second poll interval and retry logic - Enable graceful shutdown of audit worker through error group context
- Add i18n package with multi-language message catalog supporting English and Farsi - Implement language negotiation via Accept-Language header parsing - Create error mapping from domain errors to localized messages - Extract HTTP error response handling into dedicated response.go module - Implement CustomErrorHandler for gRPC-gateway with proper HTTP status code mapping - Add structured error response format with error details and metadata timestamps - Remove swagger.json route handler in favor of centralized response handling - Support locale fallback to English when requested language is unavailable
- Add regex pattern for UUID format validation - Implement validateUUID helper function to validate UUID format and non-empty values - Add UUID validation to GetAccount method - Add UUID validation to GetBalance method - Add UUID validation to CreateTransaction method for both from and to account IDs - Fix whitespace inconsistency in Service struct field alignment - Ensure all account ID parameters are validated before store operations
- Add service_test.go with mockStore implementation for testing ledger operations - Implement test cases for account creation validation (empty name, invalid currency, invalid type) - Implement test cases for transaction creation validation (zero/negative amounts, same account, empty idempotency key) - Implement test cases for wallet history pagination (default limit, limit cap enforcement) - Remove section comment headers from Makefile for cleaner organization - Add nolint directive to i18n/messages.go for intentional Persian typography character (U+200C ZWNJ)
- Add swaggo/http-swagger dependency for Swagger UI integration - Update buf.gen.yaml to output OpenAPI spec to internal/transport/http - Rename merged OpenAPI file from ledger to swagger for clarity - Create swagger.swagger.json with generated OpenAPI specification - Implement swagger_ui.go module to serve Swagger UI endpoints - Update gateway.go HTTP transport layer to include Swagger routes - Add response.go utilities for consistent HTTP response formatting - Update audit worker.go for compatibility with transport changes - Fix Makefile run target with proper go run command syntax - Add go-openapi and related dependencies to support OpenAPI generation - Consolidate API documentation in application rather than separate api/ directory
- Extract error logging into dedicated logHandlerError function for consistent error handling - Differentiate between validation/domain errors (warn level) and unexpected errors (error level) - Add context and slog imports for structured logging with context support - Update CreateWallet handler to use new logHandlerError utility - Improves observability by categorizing errors appropriately and reducing code duplication across handlers
…yError swagger: - //go:embed swagger.json was missing — variable was always empty bytes - Adding directive compiles the 8464-byte spec into the binary classifyError: - ErrAccountNotFound and ErrTransactionNotFound now map to 'not_found'
|
The latest Buf updates on your PR. Results from workflow Proto / lint (pull_request).
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.