Skip to content

Feature/swagger ci fix#8

Merged
mohammad-farrokhnia merged 20 commits into
developfrom
feature/swagger-ci-fix
Jun 17, 2026
Merged

Feature/swagger ci fix#8
mohammad-farrokhnia merged 20 commits into
developfrom
feature/swagger-ci-fix

Conversation

@mohammad-farrokhnia

Copy link
Copy Markdown
Owner

No description provided.

- 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'
@mohammad-farrokhnia mohammad-farrokhnia self-assigned this Jun 17, 2026
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Proto / lint (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedJun 17, 2026, 7:37 AM

@mohammad-farrokhnia mohammad-farrokhnia merged commit c905d53 into develop Jun 17, 2026
5 checks passed
@mohammad-farrokhnia mohammad-farrokhnia deleted the feature/swagger-ci-fix branch June 17, 2026 07:41
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.

1 participant